PLCnext API Documentation  21.0.0.35466
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 >
bool Arp::operator== (Enum< T > lhs, Enum< T > rhs)
 Equality operator for class Enum. More...
 
template<class T >
bool Arp::operator< (Enum< T > lhs, Enum< T > rhs)
 Less 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 >
Enum< T > Arp::operator| (Enum< T > lhs, Enum< T > rhs)
 Bitwise Or operator for class Enum. More...
 
 Arp::Enum< T >::Enum (Value value=Value(0))
 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 OR operator. More...
 
Arp::Enum< T >::ToValue (void) const
 Converts this instance to the value of its adapted type More...
 
String Arp::Enum< T >::ToString (void) const
 Converts this instance to its string representation. More...
 
static bool Arp::Enum< T >::TryParse (const String &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 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 char *input)
 Parses the given input string. More...
 

Detailed Description

Function Documentation

◆ Enum()

template<class T >
Arp::Enum< T >::Enum ( Value  value = Value(0))
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 &()

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 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 >
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<<()

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=()

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==()

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

Equality operator for class Enum.

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

◆ 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 ( void  ) const
inline

Converts this instance to its string representation.

Returns
The string literal of this enum value.

◆ ToValue()

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

Converts this instance to the value of its adapted type

Returns
The raw enum value.

◆ TryParse() [1/2]

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/2]

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.