共用方式為


CComEnumImpl Class

This class provides the implementation for a COM enumerator interface where the items being enumerated are stored in an array.

template < 
   class Base, 
   const IID* piid, 
   class T, 
   class Copy 
> 
class ATL_NO_VTABLE CComEnumImpl :  
   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 homogeneous copy policy class.

Members

Public Constructors

Name

Description

CComEnumImpl::CComEnumImpl

The constructor.

CComEnumImpl::~CComEnumImpl

The destructor.

Public Methods

Name

Description

CComEnumImpl::Clone

The implementation of IEnumXXXX::Clone.

CComEnumImpl::Init

Initializes the enumerator.

CComEnumImpl::Next

The implementation of IEnumXXXX::Next.

CComEnumImpl::Reset

The implementation of IEnumXXXX::Reset.

CComEnumImpl::Skip

The implementation of IEnumXXXX::Skip.

Public Data Members

Name

Description

CComEnumImpl::m_begin

A pointer to the first item in the array.

CComEnumImpl::m_dwFlags

Copy flags passed through Init.

CComEnumImpl::m_end

A pointer to the location just beyond the last item in the array.

CComEnumImpl::m_iter

A pointer to the current item in the array.

CComEnumImpl::m_spUnk

The IUnknown pointer of the object supplying the collection being enumerated.

Remarks

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

Note

For details on further differences between CComEnumImpl and IEnumOnSTLImpl, see CComEnumImpl::Init.

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 array, it is more common to create an instance of CComEnum.

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 CComEnumImpl::Clone method to provide your own implementation.

For more information, see ATL Collections and Enumerators.

Inheritance Hierarchy

Base

CComEnumImpl

Requirements

Header: atlcom.h

See Also

Reference

IEnumOnSTLImpl Class

CComEnum Class

Other Resources

ATL Class Overview