9 #ifndef RAMSES_STRONGLYTYPEDVALUE_H
10 #define RAMSES_STRONGLYTYPEDVALUE_H
14 #include <type_traits>
21 template <
typename _baseType, _baseType _inval
id,
typename _uniqueId>
93 return m_value != _invalid;
103 return m_value == other.m_value;
113 return m_value != other.m_value;
116 static_assert(std::is_arithmetic<BaseType>::value || std::is_pointer<BaseType>::value,
"expected arithmetic or pointer basetype");
126 template <
typename _baseType, _baseType _inval
id,
typename _uniqueId>
127 struct hash<
ramses::StronglyTypedValue<_baseType, _invalid, _uniqueId>>
137 return static_cast<size_t>(hash<_baseType>()(v.
getValue()));
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
_baseType BaseType
The underlying type of the class.
Definition: StronglyTypedValue.h:28
constexpr StronglyTypedValue()
Default constructor with invalid value.
Definition: StronglyTypedValue.h:51
constexpr BaseType getValue() const
Getter for retrieving the underlying value.
Definition: StronglyTypedValue.h:73
constexpr bool isValid() const
Predicate to check value is unequal to Invalid() value.
Definition: StronglyTypedValue.h:91
constexpr StronglyTypedValue(const StronglyTypedValue &other)=default
Copy constructor.
constexpr StronglyTypedValue(BaseType value)
Constructor based on the underlying type.
Definition: StronglyTypedValue.h:43
StronglyTypedValue & operator=(const StronglyTypedValue &other)=default
Assignment operator.
BaseType & getReference()
Getter for a reference of the underlying value.
Definition: StronglyTypedValue.h:82
constexpr bool operator==(const StronglyTypedValue &other) const
Equals operator, compares the object to another.
Definition: StronglyTypedValue.h:101
constexpr bool operator!=(const StronglyTypedValue &other) const
Not equals operator, compares the object to another.
Definition: StronglyTypedValue.h:111
static constexpr StronglyTypedValue Invalid()
Static Getter for Invalid.
Definition: StronglyTypedValue.h:34
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
size_t operator()(const ramses::StronglyTypedValue< _baseType, _invalid, _uniqueId > &v) const
Hasher implementation.
Definition: StronglyTypedValue.h:135