The custom data class is a simple container for named openvdb metadata. Its primary use case is passing arbitrary "external" data to an AX executable object when calling Compiler::compile. For example, it is the mechanism by which we pass data held inside of a parent DCC to executable AX code.
More...
#include <openvdb_ax/compiler/CustomData.h>
|
| CustomData () |
|
void | reset () |
| Reset the custom data. This will clear and delete all previously added data. This will invalidated any executable which links to this custom data. More...
|
|
bool | hasData (const Name &name) |
| Checks whether or not data of given name has been inserted. More...
|
|
template<typename TypedDataCacheT > |
bool | hasData (const Name &name) |
| Checks whether or not data of given name and type has been inserted. More...
|
|
const Metadata::ConstPtr | getData (const Name &name) const |
| Retrieves a const pointer to data of given name. If it does not exist, returns nullptr. More...
|
|
template<typename TypedDataCacheT > |
const TypedDataCacheT * | getData (const Name &name) const |
| Retrieves a const pointer to data of given name and type. If it does not exist, returns nullptr. More...
|
|
template<typename TypedDataCacheT > |
TypedDataCacheT * | getOrInsertData (const Name &name) |
| Retrieves or inserts typed metadata. If the data exists, it is dynamic-casted to the expected type, which may result in a nullptr. If the data does not exist it is guaranteed to be inserted and returned. The value of the inserted data can then be modified. More...
|
|
template<typename TypedDataCacheT > |
void | insertData (const Name &name, const typename TypedDataCacheT::Ptr data) |
| Inserts data of specified type with given name. More...
|
|
void | insertData (const Name &name, const Metadata::Ptr data) |
| Inserts data with given name. More...
|
|
The custom data class is a simple container for named openvdb metadata. Its primary use case is passing arbitrary "external" data to an AX executable object when calling Compiler::compile. For example, it is the mechanism by which we pass data held inside of a parent DCC to executable AX code.
Retrieves a const pointer to data of given name. If it does not exist, returns nullptr.
const TypedDataCacheT* getData |
( |
const Name & |
name | ) |
const |
|
inline |
Retrieves a const pointer to data of given name and type. If it does not exist, returns nullptr.
- Parameters
-
name | Name of the data entry |
- Returns
- The metadata. If the type does not match, nullptr is returned.
TypedDataCacheT* getOrInsertData |
( |
const Name & |
name | ) |
|
|
inline |
Retrieves or inserts typed metadata. If the data exists, it is dynamic-casted to the expected type, which may result in a nullptr. If the data does not exist it is guaranteed to be inserted and returned. The value of the inserted data can then be modified.
bool hasData |
( |
const Name & |
name | ) |
|
|
inline |
Checks whether or not data of given name has been inserted.
bool hasData |
( |
const Name & |
name | ) |
|
|
inline |
Checks whether or not data of given name and type has been inserted.
void insertData |
( |
const Name & |
name, |
|
|
const typename TypedDataCacheT::Ptr |
data |
|
) |
| |
|
inline |
Inserts data of specified type with given name.
- Parameters
-
name | Name of the data |
data | Shared pointer to the data |
- Note
- If an entry of the given name already exists, will copy the data into the existing entry rather than overwriting the pointer
Inserts data with given name.
- Parameters
-
name | Name of the data |
data | The metadata |
- Note
- If an entry of the given name already exists, will copy the data into the existing entry rather than overwriting the pointer
Reset the custom data. This will clear and delete all previously added data. This will invalidated any executable which links to this custom data.