PLCnext API Documentation  22.9.0.33
Public Member Functions | List of all members
Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter > Class Template Reference

This class implements an enumerator adapter for STL container based on iterators. More...

#include <Enumerator.hxx>

Inheritance diagram for Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >:
Inheritance graph

Public Member Functions

 StlAdapter (Iterator begin, Iterator end)
 Constructs an StlAdapter instance. More...
 
 StlAdapter (const StlAdapter &arg)=default
 Copy constructor. More...
 
StlAdapteroperator= (const StlAdapter &arg)=default
 Assignment operator. More...
 
virtual ~StlAdapter (void)=default
 Destructs this instance and frees all resources. More...
 
bool MoveNext (void) override
 Moves this enumerator to the next position. More...
 
GetCurrent (void) override
 Gets the element at the current position. More...
 

Additional Inherited Members

- Public Types inherited from Arp::IEnumerator< T >
typedef std::shared_ptr< IEnumeratorPtr
 The smart pointer tpye of this interface. More...
 
- Protected Member Functions inherited from Arp::IEnumerator< T >
 IEnumerator (void)=default
 Constructs an IEnumerator instance. More...
 
virtual ~IEnumerator (void)=default
 Destructs this instance and frees all resources. More...
 
 IEnumerator (const IEnumerator &arg)=default
 Copies an IEnumerator instance. More...
 
IEnumeratoroperator= (const IEnumerator &arg)=default
 Assigns an IEnumerator instance. More...
 

Detailed Description

template<class T>
template<class Iterator, class IteratorAdapter = typename IteratorAdapters<Iterator>::Value>
class Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >

This class implements an enumerator adapter for STL container based on iterators.

Template Parameters
IteratorThe iterator type of the container.
IteratorAdapterThe iterator type of the container.

Use Enumerator<T>::CreateStlAdapter() to create an instance of this class.

Constructor & Destructor Documentation

◆ StlAdapter() [1/2]

template<class T >
template<class Iterator , class IteratorAdapter >
Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::StlAdapter ( Iterator  begin,
Iterator  end 
)
inline

Constructs an StlAdapter instance.

Parameters
beginThe begin iterator of the container to enumerate.
endThe end iterator of the container to enumerate.

◆ StlAdapter() [2/2]

template<class T >
template<class Iterator , class IteratorAdapter = typename IteratorAdapters<Iterator>::Value>
Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::StlAdapter ( const StlAdapter< Iterator, IteratorAdapter > &  arg)
default

Copy constructor.

Parameters
argThe argument to copy.

◆ ~StlAdapter()

template<class T >
template<class Iterator , class IteratorAdapter = typename IteratorAdapters<Iterator>::Value>
virtual Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::~StlAdapter ( void  )
virtualdefault

Destructs this instance and frees all resources.

Member Function Documentation

◆ GetCurrent()

template<class T >
template<class Iterator , class IteratorAdapter >
T Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::GetCurrent ( void  )
inlineoverridevirtual

Gets the element at the current position.

Returns
The element at the current position.

Depending an the template parameter type of this interface, a reference or even const reference might be returned.

Implements Arp::IEnumerator< T >.

◆ MoveNext()

template<class T >
template<class Iterator , class IteratorAdapter >
bool Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::MoveNext ( void  )
inlineoverridevirtual

Moves this enumerator to the next position.

Returns
false if the end of the container/collections was reached and the enumerator was not moved, otherwise false.

See comments of interface declaration for more information about this operation.

IEnumerator

Implements Arp::IEnumerator< T >.

◆ operator=()

template<class T >
template<class Iterator , class IteratorAdapter = typename IteratorAdapters<Iterator>::Value>
StlAdapter& Arp::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::operator= ( const StlAdapter< Iterator, IteratorAdapter > &  arg)
default

Assignment operator.

Parameters
argThe argument to copy.
Returns
This instance as reference.

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