|
PLCnext API Documentation 23.0.2.9
|
Adapter class for enums to make them loggable and parsable from e.g. XML files. More...
#include <Enum.hxx>
Public Types | |
| using | Value = T |
| The adapted enum class type. | |
| using | U = typename std::underlying_type< T >::type |
Public Member Functions | |
| Enum (Value val=Zero) | |
| Constructs an instace of Enum with the given value. More... | |
| T | GetValue (void) const |
| U | ToUnderlyingType (void) const |
| Converts this instance to the underlying type of its adapted enum type More... | |
| String | ToString (bool throwIfInvalid=true) const |
| Converts this instance to its string representation. More... | |
| Enum & | operator= (const Enum &rhs)=default |
| The default assignment operator. More... | |
| Enum & | operator= (Value rhs) |
| The assignment operator for a value of the adapted type. More... | |
| Enum & | operator&= (Enum rhs) |
| The assignment AND operator. More... | |
| Enum & | operator|= (Enum rhs) |
| The assignment OR operator. More... | |
| operator T (void) const | |
| Converts this instance implicitely to the value of its adapted type | |
Static Public Member Functions | |
| static bool | TryParse (const String &input, Enum &result) |
| Tries to parse the given input string. More... | |
| static bool | TryParse (const String &input, T &result) |
| Tries to parse the given input string. More... | |
| static bool | TryParse (const char *input, Enum &result) |
| Tries to parse the given input string. More... | |
| static bool | TryParse (const char *input, T &result) |
| Tries to parse the given input string. More... | |
| static Enum | Parse (const String &input) |
| Parses the given input string. More... | |
| static Enum | Parse (const char *input) |
| Parses the given input string. More... | |
Static Public Attributes | |
| static const T | Zero = static_cast<T>(0) |
Adapter class for enums to make them loggable and parsable from e.g. XML files.
| T | The type of the enum. |
The default assignment operator.
| rhs | The value to assign to this instance. |