PLCnext API Documentation 25.0.2.69
Classes | Functions
Enum

Classes

class  Arp::Base::Core::Enum< T >
 Adapter class for enums to make them loggable and parsable from e.g. XML files. More...
 

Functions

template<class T >
Enum< T > Arp::Base::Core::make_enum (T value)
 Global make function to adapt any enum class by class Enum. More...
 
 Arp::Base::Core::Enum< T >::Enum (Value initialValue=Zero)
 Constructs an instance of Enum with the given value. More...
 
static bool Arp::Base::Core::Enum< T >::TryParse (const String &input, T &result)
 Tries to parse the given input string. More...
 
static bool Arp::Base::Core::Enum< T >::TryParse (const String &input, Enum &result)
 Tries to parse the given input string. More...
 
static bool Arp::Base::Core::Enum< T >::TryParse (const char *input, Enum &result)
 Tries to parse the given input string. More...
 
static bool Arp::Base::Core::Enum< T >::TryParse (const char *input, T &result)
 Tries to parse the given input string. More...
 
static Enum Arp::Base::Core::Enum< T >::Parse (const String &input)
 Parses the given input string. More...
 
static Enum Arp::Base::Core::Enum< T >::Parse (const char *input)
 Parses the given input string. More...
 
 Arp::Base::Core::Enum< T >::operator T (void) const
 Converts this instance implicitly to the value of its adapted type
 
EnumArp::Base::Core::Enum< T >::operator= (Value arg)
 The assignment operator for a value of the adapted type. More...
 
EnumArp::Base::Core::Enum< T >::operator&= (Enum rhs)
 The assignment AND operator. More...
 
EnumArp::Base::Core::Enum< T >::operator|= (Enum rhs)
 The assignment OR operator. More...
 
Arp::Base::Core::Enum< T >::GetValue (void) const
 Gets the adapted enum value. More...
 
bool Arp::Base::Core::Enum< T >::HasFlag (Value flag)
 Determines if this enum value has the supplied flag set. More...
 
bool Arp::Base::Core::Enum< T >::HasAnyFlag (Value flags)
 Determines if this enum value has any of the the supplied flags set. More...
 
bool Arp::Base::Core::Enum< T >::HasAllFlags (Value flags)
 Determines if this enum value has all of the supplied flag set. More...
 
U Arp::Base::Core::Enum< T >::ToUnderlyingType (void) const
 Converts this instance to the underlying integral type of its adapted enum type More...
 
String Arp::Base::Core::Enum< T >::ToString (bool throwIfInvalid=true) const
 Converts this instance to its string representation. More...
 

Detailed Description

Function Documentation

◆ Enum()

template<class T >
Arp::Base::Core::Enum< T >::Enum ( Value  initialValue = Zero)
inline

Constructs an instance of Enum with the given value.

Parameters
initialValueThe enum value to initialize this instance with.

◆ GetValue()

template<class T >
T Arp::Base::Core::Enum< T >::GetValue ( void  ) const
inline

Gets the adapted enum value.

Returns
The enum value.

◆ HasAllFlags()

template<class T >
bool Arp::Base::Core::Enum< T >::HasAllFlags ( Value  flags)
inline

Determines if this enum value has all of the supplied flag set.

Parameters
flagsThe flags to test for.
Returns
true if all of the flags are set, otherwise false.

◆ HasAnyFlag()

template<class T >
bool Arp::Base::Core::Enum< T >::HasAnyFlag ( Value  flags)
inline

Determines if this enum value has any of the the supplied flags set.

Parameters
flagsThe flags to test for.
Returns
true if any of the flags is set, otherwise false.

◆ HasFlag()

template<class T >
bool Arp::Base::Core::Enum< T >::HasFlag ( Value  flag)
inline

Determines if this enum value has the supplied flag set.

Parameters
flagThe flag to test for.
Returns
true if the flag is set, otherwise false.

◆ make_enum()

template<class T >
Enum< T > Arp::Base::Core::make_enum ( value)
inline

Global make function to adapt any enum class by class Enum.

Parameters
valueThe enum value to adapt by class Enum.
Template Parameters
TThe enum type to adapt by class Enum through automatic type deduction.
Returns
The new created enum adapter of type Enum.

◆ operator&=()

template<class T >
Enum< T > & Arp::Base::Core::Enum< T >::operator&= ( Enum< T >  rhs)
inline

The assignment AND operator.

Parameters
rhsThe value to AND to this instance.
Returns
This instance as reference.

◆ operator=()

template<class T >
Enum< T > & Arp::Base::Core::Enum< T >::operator= ( Value  arg)
inline

The assignment operator for a value of the adapted type.

Parameters
argThe value to assign to this instance.
Returns
This instance as reference.

◆ operator|=()

template<class T >
Enum< T > & Arp::Base::Core::Enum< T >::operator|= ( Enum< T >  rhs)
inline

The assignment OR operator.

Parameters
rhsThe value to OR to this instance.
Returns
This instance as reference.

◆ Parse() [1/2]

template<class T >
Enum< T > Arp::Base::Core::Enum< T >::Parse ( const char *  input)
inlinestatic

Parses the given input string.

Parameters
inputThe input string to parse.
Returns
The resulting Enum value.
Exceptions
ExceptionIf the input string is not a valid enum entry.

◆ Parse() [2/2]

template<class T >
Enum< T > Arp::Base::Core::Enum< T >::Parse ( const String input)
inlinestatic

Parses the given input string.

Parameters
inputThe input string to parse.
Returns
The resulting Enum value.
Exceptions
ExceptionIf the input string is not a valid enum entry.

◆ ToString()

template<class T >
String Arp::Base::Core::Enum< T >::ToString ( bool  throwIfInvalid = true) const
inline

Converts this instance to its string representation.

Parameters
throwIfInvalidIf true an exception is thrown if the enum value is invalid, otherwise the number is converted to string.
Returns
The string literal of this enum value.

◆ ToUnderlyingType()

template<class T >
Enum< T >::U Arp::Base::Core::Enum< T >::ToUnderlyingType ( void  ) const
inline

Converts this instance to the underlying integral type of its adapted enum type

Returns
The enum value as integral type.

◆ TryParse() [1/4]

template<class T >
bool Arp::Base::Core::Enum< T >::TryParse ( const char *  input,
Enum< T > &  result 
)
inlinestatic

Tries to parse the given input string.

Parameters
inputThe input string to parse.
resultThe resulting enum value.
Returns
true on success, otherwise false.

◆ TryParse() [2/4]

template<class T >
bool Arp::Base::Core::Enum< T >::TryParse ( const char *  input,
T &  result 
)
inlinestatic

Tries to parse the given input string.

Parameters
inputThe input string to parse.
resultThe resulting Enum.
Returns
true on success, otherwise false.

◆ TryParse() [3/4]

template<class T >
bool Arp::Base::Core::Enum< T >::TryParse ( const String input,
Enum< T > &  result 
)
inlinestatic

Tries to parse the given input string.

Parameters
inputThe input string to parse.
resultThe resulting enum value.
Returns
true on success, otherwise false.

◆ TryParse() [4/4]

template<class T >
bool Arp::Base::Core::Enum< T >::TryParse ( const String input,
T &  result 
)
inlinestatic

Tries to parse the given input string.

Parameters
inputThe input string to parse.
resultThe resulting Enum.
Returns
true on success, otherwise false.