HDK
|
#include <UN_Types.h>
Public Types | |
enum | ValueType : ValueIntType |
using | ValueIntType = exint |
Public Member Functions | |
UN_DataNumber (ValueType value=INVALID_NUMBER) | |
void | setValue (ValueType value) |
Sets the numerical value of this number. More... | |
ValueType | value () const |
Returns the numerical value of this number. More... | |
operator ValueType () const | |
exint | exintValue () const |
Returns an exint value of this number. More... | |
bool | isValid () const |
Returns true if this data number is valid; false otherwise. More... | |
operator bool () const | |
Returns true if this data number is valid; false otherwise. More... | |
bool | operator== (const UN_DataNumber &other) const |
Comparison operators. More... | |
bool | operator!= (const UN_DataNumber &other) const |
Comparison operators. More... | |
bool | operator< (const UN_DataNumber &other) const |
Comparison operators. More... | |
bool | operator<= (const UN_DataNumber &other) const |
Comparison operators. More... | |
bool | operator> (const UN_DataNumber &other) const |
Comparison operators. More... | |
bool | operator>= (const UN_DataNumber &other) const |
Comparison operators. More... | |
UN_DataNumber & | operator++ () |
Basic arithmetic operators. More... | |
UN_DataNumber | operator++ (int) |
Basic arithmetic operators. More... | |
Static Public Attributes | |
static constexpr ValueType | INVALID_NUMBER = ValueType(-1) |
Friends | |
size_t | hash_value (const UN_DataNumber &data_number) |
Hash function for use of UN_DataNumber as a key in the UT_Map class. More... | |
Definition at line 24 of file UN_Types.h.
using UN_DataNumber::ValueIntType = exint |
A numerical value for indexing into data containers and for unique IDs to validate of data objects.
An enum class ValueType
and UN_DataNumber
should be interchangeable. UN_DataNumber really just provides methods to operate on it and the ability to "derive" from it. In particular, it should be possible to implicitly cast ValueType
to UN_DataNumber class type. It should be possible to implicitly cast this UN_DataNumber class type to ValueType since it is an enum class, and therefore not implicitly castable to other types such as exint
or int
(and therefore deemed "safe" without the risk of data narrowing).
Definition at line 39 of file UN_Types.h.
|
strong |
Definition at line 40 of file UN_Types.h.
|
inline |
A constructor for the data number. Note, this is not an explicit constructor to allow asting from ValueType to UN_DataNumber. See comment for ValueType
definition.
Definition at line 51 of file UN_Types.h.
|
inline |
Returns an exint value of this number.
Definition at line 75 of file UN_Types.h.
|
inline |
Returns true if this data number is valid; false otherwise.
Definition at line 55 of file UN_Types.h.
|
inlineexplicit |
Returns true if this data number is valid; false otherwise.
Definition at line 57 of file UN_Types.h.
|
inline |
Implicit cast to ValueType
since it is an enum class. See the comment for ValueType
definition.
Definition at line 71 of file UN_Types.h.
|
inline |
Comparison operators.
Definition at line 86 of file UN_Types.h.
|
inline |
Basic arithmetic operators.
Definition at line 99 of file UN_Types.h.
|
inline |
Basic arithmetic operators.
Definition at line 104 of file UN_Types.h.
|
inline |
Comparison operators.
Definition at line 88 of file UN_Types.h.
|
inline |
Comparison operators.
Definition at line 90 of file UN_Types.h.
|
inline |
Comparison operators.
Definition at line 84 of file UN_Types.h.
|
inline |
Comparison operators.
Definition at line 92 of file UN_Types.h.
|
inline |
Comparison operators.
Definition at line 94 of file UN_Types.h.
Sets the numerical value of this number.
Definition at line 62 of file UN_Types.h.
|
inline |
Returns the numerical value of this number.
Definition at line 66 of file UN_Types.h.
|
friend |
Hash function for use of UN_DataNumber as a key in the UT_Map class.
Definition at line 113 of file UN_Types.h.
A numerical value for an invalid data object number. It is used in initialization to denote a non-existent, invalid, or an unknown data object. The value of -1 is consistent in its use as an index into data arrays.
Definition at line 46 of file UN_Types.h.