HDK
|
#include <UN_Include.h>
Public Types | |
enum | ValueType : ValueIntType |
using | ValueIntType = exint |
Public Member Functions | |
constexpr | UN_DataNumber (ValueType value=INVALID_NUMBER) |
void | setValue (ValueType value) |
Sets the numerical value of this number. More... | |
constexpr ValueType | value () const |
Returns the numerical value of this number. More... | |
operator ValueType () const | |
constexpr exint | exintValue () const |
Returns an exint value of this number. More... | |
constexpr bool | isValid () const |
Returns true if this data number is valid; false otherwise. More... | |
constexpr | operator bool () const |
Returns true if this data number is valid; false otherwise. More... | |
constexpr bool | operator== (const UN_DataNumber &other) const |
Comparison operators. More... | |
constexpr bool | operator!= (const UN_DataNumber &other) const |
Comparison operators. More... | |
constexpr bool | operator< (const UN_DataNumber &other) const |
Comparison operators. More... | |
constexpr bool | operator<= (const UN_DataNumber &other) const |
Comparison operators. More... | |
constexpr bool | operator> (const UN_DataNumber &other) const |
Comparison operators. More... | |
constexpr 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 26 of file UN_Include.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 41 of file UN_Include.h.
|
strong |
Definition at line 42 of file UN_Include.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 53 of file UN_Include.h.
|
inline |
Returns an exint value of this number.
Definition at line 77 of file UN_Include.h.
|
inline |
Returns true if this data number is valid; false otherwise.
Definition at line 57 of file UN_Include.h.
|
inlineexplicit |
Returns true if this data number is valid; false otherwise.
Definition at line 59 of file UN_Include.h.
|
inline |
Implicit cast to ValueType
since it is an enum class. See the comment for ValueType
definition.
Definition at line 73 of file UN_Include.h.
|
inline |
Comparison operators.
Definition at line 88 of file UN_Include.h.
|
inline |
Basic arithmetic operators.
Definition at line 101 of file UN_Include.h.
|
inline |
Basic arithmetic operators.
Definition at line 106 of file UN_Include.h.
|
inline |
Comparison operators.
Definition at line 90 of file UN_Include.h.
|
inline |
Comparison operators.
Definition at line 92 of file UN_Include.h.
|
inline |
Comparison operators.
Definition at line 86 of file UN_Include.h.
|
inline |
Comparison operators.
Definition at line 94 of file UN_Include.h.
|
inline |
Comparison operators.
Definition at line 96 of file UN_Include.h.
Sets the numerical value of this number.
Definition at line 64 of file UN_Include.h.
|
inline |
Returns the numerical value of this number.
Definition at line 68 of file UN_Include.h.
|
friend |
Hash function for use of UN_DataNumber as a key in the UT_Map class.
Definition at line 115 of file UN_Include.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 48 of file UN_Include.h.