PLCnext API Documentation 25.0.2.69
IEnumerator.hxx
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include <memory>
9
10namespace Arp { namespace Base { namespace Core
11{
12
47template <class T>
49{
50public: // usings
52 using Ptr = std::shared_ptr<IEnumerator>;
53
55 using ValueType = T;
56
57public: // construction/destruction
59 IEnumerator(void) = default;
61 IEnumerator(const IEnumerator& arg) = default;
63 IEnumerator(IEnumerator&& arg)noexcept = default;
65 IEnumerator& operator=(const IEnumerator& arg) = default;
67 IEnumerator& operator=(IEnumerator&& arg)noexcept = default;
69 virtual ~IEnumerator(void) = default;
70
71public: // abstract operations
75 virtual bool MoveNext(void) = 0;
76
83 virtual T GetCurrent(void) = 0;
84};
85
86}}} // end of namespace Arp::Base::Core
87
88
89namespace Arp {
92}
Declares the interface of the enumerator pattern, which is leaned on .NET enumerator idiom.
Definition: IEnumerator.hxx:49
IEnumerator(IEnumerator &&arg) noexcept=default
Move constructor.
IEnumerator(void)=default
Constructs an IEnumerator instance.
IEnumerator & operator=(IEnumerator &&arg) noexcept=default
Move-assignment operator.
virtual ~IEnumerator(void)=default
Destructs this instance and frees all resources.
IEnumerator & operator=(const IEnumerator &arg)=default
Deleted copy-assignment IEnumerator.
virtual T GetCurrent(void)=0
Gets the element at the current position.
virtual bool MoveNext(void)=0
Moves this enumerator to the next position.
std::shared_ptr< IEnumerator > Ptr
The smart pointer type of this interface.
Definition: IEnumerator.hxx:52
T ValueType
Type of the enumerated values
Definition: IEnumerator.hxx:55
IEnumerator(const IEnumerator &arg)=default
Deleted copy constructor.
Root namespace for the PLCnext API