PLCnext API Documentation 25.0.2.69
|
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 |
The underlying integral type of the adapted enum class type. | |
Public Member Functions | |
Enum (Value initialValue=Zero) | |
Constructs an instance of Enum with the given value. More... | |
operator T (void) const | |
Converts this instance implicitly to the value of its adapted type | |
Enum & | operator= (Value arg) |
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... | |
T | GetValue (void) const |
Gets the adapted enum value. More... | |
bool | HasFlag (Value flag) |
Determines if this enum value has the supplied flag set. More... | |
bool | HasAnyFlag (Value flags) |
Determines if this enum value has any of the the supplied flags set. More... | |
bool | HasAllFlags (Value flags) |
Determines if this enum value has all of the supplied flag set. More... | |
U | ToUnderlyingType (void) const |
Converts this instance to the underlying integral type of its adapted enum type More... | |
String | ToString (bool throwIfInvalid=true) const |
Converts this instance to its string representation. More... | |
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 constexpr T | Zero = static_cast<T>(0) |
Zero initialized Enum value. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, Enum arg) |
Makes the Enum class loggable and streamable. More... | |
std::istream & | operator>> (std::istream &is, Enum &arg) |
Makes the Enum class parsable. More... | |
Enum | operator| (Enum lhs, Enum rhs) |
Bitwise Or operator for class Enum. More... | |
Enum | operator& (Enum lhs, Enum rhs) |
Bitwise And operator for class Enum. More... | |
bool | operator== (Enum lhs, Enum rhs) |
Equality operator of class Enum. More... | |
bool | operator< (Enum lhs, Enum rhs) |
Less operator for class Enum. More... | |
bool | operator> (Enum lhs, Enum rhs) |
Greater operator for class Enum. More... | |
bool | operator<= (Enum lhs, Enum rhs) |
Less or equal operator for class Enum. More... | |
bool | operator>= (Enum lhs, Enum rhs) |
Greater or equal operator for class Enum. More... | |
bool | operator== (Enum lhs, T rhs) |
Equality operator of class Enum. More... | |
bool | operator< (Enum lhs, T rhs) |
Less operator for class Enum. More... | |
bool | operator> (Enum lhs, T rhs) |
Greater operator for class Enum. More... | |
bool | operator<= (Enum lhs, T rhs) |
Less or equal operator for class Enum. More... | |
bool | operator>= (Enum lhs, T rhs) |
Greater or equal operator for class Enum. More... | |
bool | operator== (T lhs, Enum rhs) |
Equality operator of class Enum. More... | |
bool | operator< (T lhs, Enum rhs) |
Less operator for class Enum. More... | |
bool | operator> (T lhs, Enum rhs) |
Greater operator for class Enum. More... | |
bool | operator<= (T lhs, Enum rhs) |
Less or equal operator for class Enum. More... | |
bool | operator>= (T lhs, Enum rhs) |
Greater or equal operator for class Enum. More... | |
Adapter class for enums to make them loggable and parsable from e.g. XML files.
T | The type of the enum. |
Bitwise And operator for class Enum.
lhs | The left argument to combine bitwise. |
rhs | The right argument to combine bitwise. |
Less operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is less than the right argument, otherwise false
.
|
friend |
Less operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is less than the right argument, otherwise false
.
|
friend |
Less operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is less than the right argument, otherwise false
.
|
friend |
Less or equal operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is less or equal than the right argument, otherwise false
.
|
friend |
Less or equal operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is less or equal than the right argument, otherwise false
.
|
friend |
Less or equal operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is less or equal than the right argument, otherwise false
.Equality operator of class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the arguments are equal, otherwise false
.
|
friend |
Equality operator of class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the arguments are equal, otherwise false
.
|
friend |
Equality operator of class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the arguments are equal, otherwise false
.Greater operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is greater than the right argument, otherwise false
.
|
friend |
Greater operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is greater than the right argument, otherwise false
.
|
friend |
Greater operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is greater than the right argument, otherwise false
.Greater or equal operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is greater or equal than the right argument, otherwise false
.
|
friend |
Greater or equal operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is greater or equal than the right argument, otherwise false
.
|
friend |
Greater or equal operator for class Enum.
lhs | The left argument to compare. |
rhs | The right argument to compare. |
true
if the left argument is greater or equal than the right argument, otherwise false
.
|
friend |
Makes the Enum class parsable.
is | The stream to read the value from. |
arg | The resulting enum value. |
Bitwise Or operator for class Enum.
lhs | The left argument to combine bitwise. |
rhs | The right argument to combine bitwise. |