PLCnext API Documentation 25.0.2.69
Public Member Functions | List of all members
Arp::Base::Core::Enumerator< T >::StlAdapter< T > Class Template Reference

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

#include <Enumerator.StlAdapter.hxx>

Inheritance diagram for Arp::Base::Core::Enumerator< T >::StlAdapter< T >:
Inheritance graph

Public Member Functions

 StlAdapter (Iterator begin, Iterator end)
 Constructs an StlAdapter instance. More...
 
 StlAdapter (const StlAdapter &arg)=delete
 
 StlAdapter (StlAdapter &&arg) noexcept
 Move constructor. More...
 
StlAdapteroperator= (const StlAdapter &arg)=delete
 
StlAdapteroperator= (StlAdapter &&arg) noexcept
 Move assignment operator. More...
 
 ~StlAdapter (void) override
 Destructs this instance and frees all resources.
 
bool MoveNext (void) override
 Moves this enumerator to the next position. More...
 
GetCurrent (void) override
 Gets the element at the current position. More...
 
- Public Member Functions inherited from Arp::Base::Core::IEnumerator< T >
 IEnumerator (void)=default
 Constructs an IEnumerator instance.
 
 IEnumerator (const IEnumerator &arg)=default
 Deleted copy constructor.
 
 IEnumerator (IEnumerator &&arg) noexcept=default
 Move constructor.
 
IEnumeratoroperator= (const IEnumerator &arg)=default
 Deleted copy-assignment IEnumerator.
 
IEnumeratoroperator= (IEnumerator &&arg) noexcept=default
 Move-assignment operator.
 
virtual ~IEnumerator (void)=default
 Destructs this instance and frees all resources.
 
virtual bool MoveNext (void)=0
 Moves this enumerator to the next position. More...
 
virtual T GetCurrent (void)=0
 Gets the element at the current position. More...
 

Additional Inherited Members

- Public Types inherited from Arp::Base::Core::IEnumerator< T >
using Ptr = std::shared_ptr< IEnumerator >
 The smart pointer type of this interface.
 
using ValueType = T
 Type of the enumerated values
 

Detailed Description

template<class T>
template<class T>
class Arp::Base::Core::Enumerator< T >::StlAdapter< T >

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::Base::Core::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 >
Arp::Base::Core::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::StlAdapter ( StlAdapter< T > &&  arg)
inlinedefaultnoexcept

Move constructor.

Parameters
argThe argument to move.

Member Function Documentation

◆ GetCurrent()

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

Gets the element at the current position.

Returns
The element at the current position.

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

Exceptions
InvalidOperationExceptionWhen GetCurrent() is called before MoveNext() or after MoveNext() has returned false once.

Implements Arp::Base::Core::IEnumerator< T >.

◆ MoveNext()

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

Moves this enumerator to the next position.

Returns
false if the end of the container/collections/enumeration has reached, otherwise true.
See also
IEnumerator

Implements Arp::Base::Core::IEnumerator< T >.

◆ operator=()

template<class T >
template<class Iterator , class IteratorAdapter >
Enumerator< T >::StlAdapter< Iterator, IteratorAdapter > & Arp::Base::Core::Enumerator< T >::StlAdapter< Iterator, IteratorAdapter >::operator= ( StlAdapter< T > &&  arg)
inlinedefaultnoexcept

Move assignment operator.

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

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