Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::EnumeratorBase Class Reference

Generic enumerator. More...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/common/arccore/common/Collection.h>

Inheritance diagram for Arcane::EnumeratorBase:
Collaboration diagram for Arcane::EnumeratorBase:

Public Member Functions

 EnumeratorBase ()=default
 Constructs a null enumerator.
 EnumeratorBase (EnumeratorImplBase *impl)
 Constructs an enumerator associated with the implementation impl.
void reset ()
bool moveNext ()
void * current ()
const void * current () const
bool operator++ ()
 Advances the enumerator to the next element.

Protected Member Functions

EnumeratorImplBase_impl ()
const EnumeratorImplBase_impl () const

Private Attributes

AutoRef2< EnumeratorImplBasem_impl
 Implementation.

Detailed Description

Generic enumerator.

This class allows generic iteration over a collection without knowing the type of the collection elements. For iteration using strong typing, you must use the template class EnumeratorT.

Example of enumerator usage:

VectorT<int> integers;
for( Enumerator i(integers.enumerator()); ++i; )
cout << i.current() << '\n';

Definition at line 149 of file arccore/src/common/arccore/common/Collection.h.

Constructor & Destructor Documentation

◆ EnumeratorBase()

Arcane::EnumeratorBase::EnumeratorBase ( EnumeratorImplBase * impl)
inlineexplicit

Constructs an enumerator associated with the implementation impl.

The instance becomes the owner of the implementation, which is destroyed when the instance is destroyed.

Definition at line 162 of file arccore/src/common/arccore/common/Collection.h.

References m_impl.

Member Function Documentation

◆ _impl() [1/2]

EnumeratorImplBase * Arcane::EnumeratorBase::_impl ( )
inlineprotected

◆ _impl() [2/2]

const EnumeratorImplBase * Arcane::EnumeratorBase::_impl ( ) const
inlineprotected

◆ current() [1/2]

void * Arcane::EnumeratorBase::current ( )
inline

◆ current() [2/2]

const void * Arcane::EnumeratorBase::current ( ) const
inline

◆ moveNext()

bool Arcane::EnumeratorBase::moveNext ( )
inline

◆ operator++()

bool Arcane::EnumeratorBase::operator++ ( )
inline

Advances the enumerator to the next element.

Definition at line 176 of file arccore/src/common/arccore/common/Collection.h.

◆ reset()

void Arcane::EnumeratorBase::reset ( )
inline

Member Data Documentation

◆ m_impl

AutoRef2<EnumeratorImplBase> Arcane::EnumeratorBase::m_impl
private

Implementation.

Definition at line 185 of file arccore/src/common/arccore/common/Collection.h.

Referenced by EnumeratorBase().


The documentation for this class was generated from the following file: