PLCnext API Documentation  22.9.0.33
IEnumerator.hxx
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 
9 namespace Arp
10 {
11 
46 template <class T>
48 {
49 public: // typedefs
51  typedef std::shared_ptr<IEnumerator> Ptr;
52 
53 protected: // construction/destruction
55  IEnumerator(void) = default;
57  virtual ~IEnumerator(void) = default;
58 
59 public: // abstract operations
64  virtual bool MoveNext(void) = 0;
65 
69  virtual T GetCurrent(void) = 0;
70 
71 protected: // 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 & operator=(const IEnumerator &arg)=default
Assigns an IEnumerator instance.
IEnumerator(void)=default
Constructs an IEnumerator instance.
IEnumerator(const IEnumerator &arg)=default
Copies 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