#include <lib_description.h>
An ID class for description elements. Contains a stack of DescLevel objects.
A description ID is used to exactly identify a parameter value.
Private Attributes | |
union { | |
maxon::StrongCOWRef< Int > _refData | |
maxon::Block< const DescLevel > _constData | |
}; | |
Constructor/Destructor | |
DescID () | |
DescID (const DescID &src) | |
DescID (DescID &&src) | |
template<int elementCount> | |
constexpr | DescID (maxon::IN_PLACE_TYPE v, const DescLevel(&ids)[elementCount]) |
DescID (maxon::IN_PLACE_TYPE v, const maxon::Block< const DescLevel > &ids) | |
~DescID () | |
template<typename... T> | |
static DescID | Create (const T &... ids) |
Set/Push/Pop Level | |
void | SetId (const DescLevel &subid) |
void | PushId (const DescLevel &subid) |
void | PushId (const std::initializer_list< DescLevel > &subids) |
void | PopId () |
Operator | |
const DescLevel & | operator[] (Int32 pos) const |
const DescID & | operator= (const DescID &id) |
const DescID & | operator= (DescID &&id) |
Bool | operator== (const DescID &d) const |
Bool | operator!= (const DescID &d) const |
const DescID | operator<< (Int32 shift) const |
const DescID & | operator+= (const DescID &s) |
const DescID | operator+ (const DescID &v1, const DescID &v2) |
Read/Write | |
Bool | Read (HyperFile *hf) |
Bool | Write (HyperFile *hf) const |
Miscellaneous | |
Int32 | GetDepth () const |
Bool | IsPopulated () const |
Bool | IsEmpty () const |
Bool | IsPartOf (const DescID &cmp, Int32 *pos) const |
maxon::HashInt | GetHashCode () const |
Additional Inherited Members | |
Static Public Attributes inherited from CustomDataTypeT< TDATATYPEID > | |
static constexpr Int32 | DATATYPEID |
DescID | ( | ) |
Default constructor.
|
explicitconstexpr |
Creates an ID with any number of levels. Must be used only with ConstDescID or memory which is never deleted.
[in] | ids | array with DescLevels. |
|
explicit |
Creates an ID with any number of levels. Must be used only with ConstDescID or memory which is never deleted.
[in] | ids | array with DescLevels. |
~DescID | ( | ) |
Default destructor.
|
static |
Creates an ID with any number of levels.
[in] | ids | array with DescLevels. |
void SetId | ( | const DescLevel & | subid | ) |
Sets the highest level to subid.
[in] | subid | New top level. |
void PushId | ( | const DescLevel & | subid | ) |
Pushes a new level onto the stack.
[in] | subid | Level to push. |
void PushId | ( | const std::initializer_list< DescLevel > & | subids | ) |
Pushes a new level onto the stack.
[in] | subids | Levels to push. |
void PopId | ( | ) |
Pop the highest level from the stack.
Accesses the level at position pos in the stack.
[in] | pos | The position: 0 <= pos < GetDepth() |
Assignment operator. Assigns id to the description ID.
[in] | id | Right operand. Source description ID. |
Move Assignment operator. Assigns id to the description ID.
[in] | id | Right operand. Source description ID. |
Equality operator. Checks if all levels are equal.
[in] | d | Right operand description ID. |
Inequality operator. Checks if any level is different.
[in] | d | Right operand description ID. |
Get the result of popping levels from the bottom of the stack.
[in] | shift | Number of levels to pop. 0 <= shift < GetDepth(). |
Add operator. Merges two description IDs.
[in] | s | Right operand. Source description ID. |
Reads the description ID from hf.
[in] | hf | The hyper file to read from. The caller owns the pointed hyper file. |
Writes the description ID to hf.
[in] | hf | The hyper file to write to. The caller owns the pointed hyper file. |
Int32 GetDepth | ( | ) | const |
Gets the depth of the stack, i.e. the number of levels.
Bool IsPopulated | ( | ) | const |
Returns True if Id is set to any value.
Bool IsEmpty | ( | ) | const |
Returns True if Id is not set to any value.
Checks if the description ID is part of cmp and assigns the length of the match to pos.
[in] | cmp | The super description ID. |
[out] | pos | If not nullptr this is assigned the length of the match. |
maxon::HashInt GetHashCode | ( | ) | const |
Gets a hash code for the description ID.
Add operator. Merges two description IDs.
[in] | v1 | Left operand. |
[in] | v2 | Right operand. |
maxon::StrongCOWRef<Int> _refData |
maxon::Block<const DescLevel> _constData |
union { ... } |