PLCnext API Documentation  22.9.0.33
Classes | Functions
Enum

Classes

class  Arp::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::make_enum (T value)
 Global make function to adapt any enum class by class Enum. More...
 
template<class T >
std::ostream & Arp::operator<< (std::ostream &os, Enum< T > value)
 Makes the Enum class loggable and streamable. More...
 
template<class T >
std::istream & Arp::operator>> (std::istream &is, Enum< T > &value)
 Makes the Enum class parsable. More...
 
template<class T >
Enum< T > Arp::operator| (Enum< T > lhs, Enum< T > rhs)
 Bitwise Or operator for class Enum. More...
 
template<class T >
Enum< T > Arp::operator& (Enum< T > lhs, Enum< T > rhs)
 Bitwise And operator for class Enum. More...
 
template<class T >
bool Arp::operator== (Enum< T > lhs, Enum< T > rhs)
 Equality operator of class Enum. More...
 
template<class T >
bool Arp::operator< (Enum< T > lhs, Enum< T > rhs)
 Less operator for class Enum. More...
 
template<class T >
bool Arp::operator> (Enum< T > lhs, Enum< T > rhs)
 Greater operator for class Enum. More...
 
template<class T >
bool Arp::operator<= (Enum< T > lhs, Enum< T > rhs)
 Less or equal operator for class Enum. More...
 
template<class T >
bool Arp::operator>= (Enum< T > lhs, Enum< T > rhs)
 Greater or equal operator for class Enum. More...
 
template<class T >
bool Arp::operator== (Enum< T > lhs, T rhs)
 Equality operator of class Enum. More...
 
template<class T >
bool Arp::operator< (Enum< T > lhs, T rhs)
 Less operator for class Enum. More...
 
template<class T >
bool Arp::operator> (Enum< T > lhs, T rhs)
 Greater operator for class Enum. More...
 
template<class T >
bool Arp::operator<= (Enum< T > lhs, T rhs)
 Less or equal operator for class Enum. More...
 
template<class T >
bool Arp::operator>= (Enum< T > lhs, T rhs)
 Greater or equal operator for class Enum. More...
 
template<class T >
bool Arp::operator== (T lhs, Enum< T > rhs)
 Equality operator of class Enum. More...
 
template<class T >
bool Arp::operator< (T lhs, Enum< T > rhs)
 Less operator for class Enum. More...
 
template<class T >
bool Arp::operator> (T lhs, Enum< T > rhs)
 Greater operator for class Enum. More...
 
template<class T >
bool Arp::operator<= (T lhs, Enum< T > rhs)
 Less or equal operator for class Enum. More...
 
template<class T >
bool Arp::operator>= (T lhs, Enum< T > rhs)
 Greater or equal operator for class Enum. More...
 
 Arp::Enum< T >::Enum (Value val=Zero)
 Constructs an instace of Enum with the given value. More...
 
EnumArp::Enum< T >::operator= (Value rhs)
 The assignment operator for a value of the adapted type. More...
 
 Arp::Enum< T >::operator T (void) const
 Converts this instance implicitely to the value of its adapted type More...
 
EnumArp::Enum< T >::operator&= (Enum rhs)
 The assignment AND operator. More...
 
EnumArp::Enum< T >::operator|= (Enum rhs)
 The assignment OR operator. More...
 
Arp::Enum< T >::GetValue (void) const
 
Arp::Enum< T >::ToUnderlyingType (void) const
 Converts this instance to the underlying type of its adapted enum type More...
 
String Arp::Enum< T >::ToString (bool throwIfInvalid=true) const
 Converts this instance to its string representation. More...
 
static bool Arp::Enum< T >::TryParse (const String &input, T &result)
 Tries to parse the given input string. More...
 
static bool Arp::Enum< T >::TryParse (const String &input, Enum &result)
 Tries to parse the given input string. More...
 
static bool Arp::Enum< T >::TryParse (const char *input, T &result)
 Tries to parse the given input string. More...
 
static bool Arp::Enum< T >::TryParse (const char *input, Enum &result)
 Tries to parse the given input string. More...
 
static Enum Arp::Enum< T >::Parse (const String &input)
 Parses the given input string. More...
 
static Enum Arp::Enum< T >::Parse (const char *input)
 Parses the given input string. More...
 

Detailed Description

Function Documentation

◆ Enum()

template<class T >
Arp::Enum< T >::Enum ( Value  val = Zero)
inline

Constructs an instace of Enum with the given value.

Parameters
valueThe enum value to initialize this instance with.

◆ make_enum()

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

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.
Returns
The new created enum adapter of type Enum.

◆ operator T()

template<class T >
Arp::Enum< T >::operator T ( void  ) const
inline

Converts this instance implicitely to the value of its adapted type

◆ operator&()

template<class T >
Enum<T> Arp::operator& ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Bitwise And operator for class Enum.

Parameters
lhsThe left argument to combine bitwise.
rhsThe right argument to combine bitwise.
Returns
The bitwise And combination of the arguments.

◆ operator&=()

template<class T >
Enum< T > & Arp::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<() [1/3]

template<class T >
bool Arp::operator< ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Less operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is less than the right argument, otherwise false.

◆ operator<() [2/3]

template<class T >
bool Arp::operator< ( Enum< T >  lhs,
rhs 
)
inline

Less operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is less than the right argument, otherwise false.

◆ operator<() [3/3]

template<class T >
bool Arp::operator< ( lhs,
Enum< T >  rhs 
)
inline

Less operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is less than the right argument, otherwise false.

◆ operator<<()

template<class T >
std::ostream& Arp::operator<< ( std::ostream &  os,
Enum< T >  value 
)
inline

Makes the Enum class loggable and streamable.

Parameters
osThe stream to write the typename to.
valueThe enum value to write.
Returns
The as argument passed stream.

◆ operator<=() [1/3]

template<class T >
bool Arp::operator<= ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Less or equal operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is less or equal than the right argument, otherwise false.

◆ operator<=() [2/3]

template<class T >
bool Arp::operator<= ( Enum< T >  lhs,
rhs 
)
inline

Less or equal operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is less or equal than the right argument, otherwise false.

◆ operator<=() [3/3]

template<class T >
bool Arp::operator<= ( lhs,
Enum< T >  rhs 
)
inline

Less or equal operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is less or equal than the right argument, otherwise false.

◆ operator=()

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

The assignment operator for a value of the adapted type.

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

◆ operator==() [1/3]

template<class T >
bool Arp::operator== ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Equality operator of class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the arguments are equal, otherwise false.

◆ operator==() [2/3]

template<class T >
bool Arp::operator== ( Enum< T >  lhs,
rhs 
)
inline

Equality operator of class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the arguments are equal, otherwise false.

◆ operator==() [3/3]

template<class T >
bool Arp::operator== ( lhs,
Enum< T >  rhs 
)
inline

Equality operator of class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the arguments are equal, otherwise false.

◆ operator>() [1/3]

template<class T >
bool Arp::operator> ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Greater operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is greater than the right argument, otherwise false.

◆ operator>() [2/3]

template<class T >
bool Arp::operator> ( Enum< T >  lhs,
rhs 
)
inline

Greater operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is greater than the right argument, otherwise false.

◆ operator>() [3/3]

template<class T >
bool Arp::operator> ( lhs,
Enum< T >  rhs 
)
inline

Greater operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is greater than the right argument, otherwise false.

◆ operator>=() [1/3]

template<class T >
bool Arp::operator>= ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Greater or equal operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is greater or equal than the right argument, otherwise false.

◆ operator>=() [2/3]

template<class T >
bool Arp::operator>= ( Enum< T >  lhs,
rhs 
)
inline

Greater or equal operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is greater or equal than the right argument, otherwise false.

◆ operator>=() [3/3]

template<class T >
bool Arp::operator>= ( lhs,
Enum< T >  rhs 
)
inline

Greater or equal operator for class Enum.

Parameters
lhsThe left argument to compare.
rhsThe right argument to compare.
Returns
true if the left argument is greater or equal than the right argument, otherwise false.

◆ operator>>()

template<class T >
std::istream& Arp::operator>> ( std::istream &  is,
Enum< T > &  value 
)
inline

Makes the Enum class parsable.

Parameters
osThe stream to read the value from.
valueThe resulting enum value.
Returns
The as argument passed stream.

◆ operator|()

template<class T >
Enum<T> Arp::operator| ( Enum< T >  lhs,
Enum< T >  rhs 
)
inline

Bitwise Or operator for class Enum.

Parameters
lhsThe left argument to combine bitwise.
rhsThe right argument to combine bitwise.
Returns
The bitwise Or combination of the arguments.

◆ operator|=()

template<class T >
Enum< T > & Arp::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::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::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::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::Enum< T >::ToUnderlyingType ( void  ) const
inline

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

Returns
The enum value as integral type.

◆ TryParse() [1/4]

template<class T >
bool Arp::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.
Returns
true on success, otherwise false.

◆ TryParse() [2/4]

template<class T >
bool Arp::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 value.
Returns
true on success, otherwise false.

◆ TryParse() [3/4]

template<class T >
bool Arp::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.
Returns
true on success, otherwise false.

◆ TryParse() [4/4]

template<class T >
bool Arp::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 value.
Returns
true on success, otherwise false.