PLCnext API Documentation 24.0.0.71
IEnumerator.hxx
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8
9namespace Arp
10{
11
46template <class T>
48{
49public: // typedefs
51 typedef std::shared_ptr<IEnumerator> Ptr;
52
53protected: // construction/destruction
55 IEnumerator(void) = default;
57 virtual ~IEnumerator(void) = default;
58
59public: // abstract operations
64 virtual bool MoveNext(void) = 0;
65
69 virtual T GetCurrent(void) = 0;
70
71protected: // copying methods (for copyable classes)
74 IEnumerator(const IEnumerator& arg) = default;
78 IEnumerator& operator=(const IEnumerator& arg) = default;
79};
80
81} // end of namespace Arp
Declares the interface of the enumerator pattern, which is leaned on .NET enumerator idiom.
Definition: IEnumerator.hxx:48
IEnumerator(void)=default
Constructs an IEnumerator instance.
IEnumerator(const IEnumerator &arg)=default
Copies an IEnumerator instance.
IEnumerator & operator=(const IEnumerator &arg)=default
Assigns an IEnumerator instance.
std::shared_ptr< IEnumerator > Ptr
The smart pointer tpye of this interface.
Definition: IEnumerator.hxx:51
virtual T GetCurrent(void)=0
Gets the element at the current position.
virtual bool MoveNext(void)=0
Moves this enumerator to the next position.
virtual ~IEnumerator(void)=default
Destructs this instance and frees all resources.
Root namespace for the PLCnext API