+ class final + +
+ DictionaryTraitExposes dictionary-like functionality of a type.
+ + +Public types
+-
+
- + using Length = std::size_t(*)(const void*instance) + +
- Function pointer to get the length of a dictionary instance. +
- + using Begin = void*(*)(uintptr_t instance, bool writeable) + +
- Function pointer to get an iterator to the first key-value pair of a dictionary instance. +
- + using Find = void*(*)(uintptr_t instance, const void*key, bool writeable) + +
- Function pointer to get an iterator to a value in an dictionary instance. +
- + using Advance = bool(*)(uintptr_t instance, void*iterator, bool writeable) + +
- Function pointer to advance an iterator. +
- + using Stop = void(*)(void*iterator, bool writeable) + +
- Function pointer to destroy an iterator instance. +
- + using Key = const void*(*)(const void*iterator, bool writeable) + +
- Function pointer to get the address of the key pointed to by an iterator. +
- + using Value = uintptr_t(*)(const void*iterator, bool writeable) + +
- Function pointer to get the address of the value pointed to by an iterator. +
- + using InsertDefault = void(*)(void*instance, const void*key) + +
- Function pointer to insert a default value into a dictionary instance. +
- + using InsertCopy = void(*)(void*instance, const void*key, const void*value) + +
- Function pointer to insert a copy of the given value into a dictionary instance. +
- + using InsertMove = void(*)(void*instance, const void*key, void*value) + +
- Function pointer to move the given value into a dictionary instance. +
- + using Erase = void(*)(void*instance, const void*iterator) + +
- Function pointer to remove a key-value pair of a dictionary instance. +
Constructors, destructors, conversion operators
+ +Public functions
+-
+
- + void setInsertDefault(InsertDefault insertDefault) + +
- Sets the default-construct insert operation of the trait. +
- + void setInsertCopy(InsertCopy insertCopy) + +
- Sets the copy-construct insert operation of the trait. +
- + void setInsertMove(InsertMove insertMove) + +
- Sets the move-construct insert operation of the trait. +
- + void setErase(Erase erase) + +
- Sets the erase operation of the trait. +
- + auto hasInsertDefault() const -> bool + +
- Checks if default-construct insert is supported. +
- + auto hasInsertCopy() const -> bool + +
- Checks if copy-construct insert is supported. +
- + auto hasInsertMove() const -> bool + +
- Checks if move-construct insert is supported. +
- + auto hasErase() const -> bool + +
- Checks if erase is supported. +
- + auto keyType() const -> const Type& + +
- Returns the key type of the dictionary. +
- + auto valueType() const -> const Type& + +
- Returns the value type of the dictionary. +
- + auto view(void* instance) const -> View + +
- Returns a view of the given dictionary instance. +
- + auto view(const void* instance) const -> ConstView + +
- Returns a view of the given dictionary instance. +
Typedef documentation
+
+ using cubos:: core:: reflection:: DictionaryTrait:: Begin = void*(*)(uintptr_t instance, bool writeable)
+
+ Function pointer to get an iterator to the first key-value pair of a dictionary instance.
+ +
+ using cubos:: core:: reflection:: DictionaryTrait:: Find = void*(*)(uintptr_t instance, const void*key, bool writeable)
+
+ Function pointer to get an iterator to a value in an dictionary instance.
+ +Function documentation
+
+ cubos:: core:: reflection:: DictionaryTrait:: DictionaryTrait(const Type& keyType,
+ const Type& valueType,
+ Length length,
+ Begin begin,
+ Find find,
+ Advance advance,
+ Stop stop,
+ Key key,
+ Value value)
+
+ Constructs.
+Parameters | |
---|---|
keyType | +Key type of the dictionary. | +
valueType | +Value type of the dictionary. | +
length | +Function used to get the length of a dictionary. | +
begin | +Function used to get an iterator to the first key-value pair of a | +
find | +Function used to find a key-value pair in a dictionary. | +
advance | +Function used to advance an iterator. | +
stop | +Function used to destroy an iterator. | +
key | +Function used to get the address of the key pointed to by an iterator. | +
value | +Function used to get the address of the value pointed to by an iterator. | +
+ void cubos:: core:: reflection:: DictionaryTrait:: setInsertDefault(InsertDefault insertDefault)
+
+ Sets the default-construct insert operation of the trait.
+Parameters | |
---|---|
insertDefault | +Function pointer. | +
+ void cubos:: core:: reflection:: DictionaryTrait:: setInsertCopy(InsertCopy insertCopy)
+
+ Sets the copy-construct insert operation of the trait.
+Parameters | |
---|---|
insertCopy | +Function pointer. | +
+ void cubos:: core:: reflection:: DictionaryTrait:: setInsertMove(InsertMove insertMove)
+
+ Sets the move-construct insert operation of the trait.
+Parameters | |
---|---|
insertMove | +Function pointer. | +
+ bool cubos:: core:: reflection:: DictionaryTrait:: hasInsertDefault() const
+
+ Checks if default-construct insert is supported.
+Returns | +Whether the operation is supported. | +
---|
+ bool cubos:: core:: reflection:: DictionaryTrait:: hasInsertCopy() const
+
+ Checks if copy-construct insert is supported.
+Returns | +Whether the operation is supported. | +
---|
+ bool cubos:: core:: reflection:: DictionaryTrait:: hasInsertMove() const
+
+ Checks if move-construct insert is supported.
+Returns | +Whether the operation is supported. | +
---|
+ bool cubos:: core:: reflection:: DictionaryTrait:: hasErase() const
+
+ Checks if erase is supported.
+Returns | +Whether the operation is supported. | +
---|