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

Generic enumerator. More...

#include <arccore/common/Collection.h>

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

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.

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

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