8 #include "Arp/System/Core/TypeName.hxx" 9 #include "Arp/System/Core/EnumStrings.hxx" 10 #include "Arp/System/Core/Exception.hpp" 22 template<
class T =
void>
91 operator T(
void)
const;
134 using U =
typename std::underlying_type<T>::type;
135 this->value =
static_cast<T
>(
static_cast<U
>(this->value) & static_cast<U>(rhs.value));
142 using U =
typename std::underlying_type<T>::type;
143 this->value =
static_cast<T
>(
static_cast<U
>(this->value) | static_cast<U>(rhs.value));
162 T resultValue = (T)0;
165 result =
Enum(resultValue);
208 inline std::ostream& operator<<(std::ostream& os, Enum<T> value)
210 return os << Enum<T>(value).
ToString();
228 inline bool operator<(Enum<T> lhs,
Enum<T> rhs)
Enum & operator=(const Enum &rhs)=default
The default assignment operator.
Enum< T > operator|(Enum< T > lhs, Enum< T > rhs)
Bitwise Or operator for class Enum.
Definition: Enum.hxx:250
Enum(Value value=Value(0))
Constructs an instace of Enum with the given value.
Definition: Enum.hxx:113
static bool TryParse(const char *input, Enum &result)
Tries to parse the given input string.
Definition: Enum.hxx:184
This (meta programming) class provides the C++ typename of the as template argument passed type...
Definition: TypeName.hxx:55
Enum< T > make_enum(T value)
Global make function to adapt any enum class by class Enum.
Definition: Enum.hxx:105
T ToValue(void) const
Converts this instance to the value of its adapted type
Definition: Enum.hxx:148
static Enum Parse(const char *input)
Parses the given input string.
Definition: Enum.hxx:190
T Value
The adapted enum class type.
Definition: Enum.hxx:27
Adapter class for enums to make them loggable and parsable from e.g. XML files.
Definition: Enum.hxx:23
Enum & operator &=(Enum rhs)
The assignment AND operator.
Arp::BasicString< char8 > String
The Arp String class.
Definition: TypeSystem.h:27
static const char * GetEntry(T key)
Returns the string of the specified enum entry.
Definition: EnumStrings.hxx:70
The class implements an adapter for enums to define the string literals of the enum entries...
Definition: EnumStrings.hxx:39
Root namespace for the PLCnext API
Enum< T > operator &(Enum< T > lhs, Enum< T > rhs)
Bitwise And operator for class Enum.
Definition: Enum.hxx:238
Enum & operator|=(Enum rhs)
The assignment OR operator.
Definition: Enum.hxx:140
bool operator==(const BasicString< CharType, Alloc > &left, const BasicString< CharType, Alloc > &right)
Compares the left string to the right string on equality.
Definition: BasicString.hxx:1752
String ToString(void) const
Converts this instance to its string representation.
Definition: Enum.hxx:154
This is the base class of all Arp exception classes.
Definition: Exception.hpp:15