IEnumOnSTLImpl Class

This class defines an enumerator interface based on an STL collection.

template <
   class Base,
   const IID* piid,
   class T,
   class Copy,
   class CollType
>
class ATL_NO_VTABLE IEnumOnSTLImpl :
   public Base

Parameters

  • Base
    A COM enumerator (IEnumXXXX) interface.

  • piid
    A pointer to the interface ID of the enumerator interface.

  • T
    The type of item exposed by the enumerator interface.

  • Copy
    A copy policy class.

  • CollType
    An STL container class.

Remarks

IEnumOnSTLImpl provides the implementation for a COM enumerator interface where the items being enumerated are stored in an STL-compatible container. This class is analogous to the CComEnumImpl class, which provides an implementation for an enumerator interface based on an array.

Note

See CComEnumImpl::Init for details on further differences between CComEnumImpl and IEnumOnSTLImpl.

Typically, you will not need to create your own enumerator class by deriving from this interface implementation. If you want to use an ATL-supplied enumerator based on an STL container, it is more common to create an instance of CComEnumOnSTL, or to create a collection class that returns an enumerator by deriving from ICollectionOnSTLImpl.

However, if you do need to provide a custom enumerator (for example, one that exposes interfaces in addition to the enumerator interface), you can derive from this class. In this situation it is likely that you'll need to override the Clone method to provide your own implementation.

Requirements

Header: atlcom.h

See Also

Other Resources

IEnumOnSTLImpl Members

ATL Class Overview