omni::graph::core::IBundle
Defined in omni/graph/core/bundle/IBundle1.h
-
struct IBundle
Interface for bundle attribute data.
Public Members
-
size_t (*getAttributesCount)(const GraphContextObj &contextObj, ConstBundleHandle bundle)
Counts the number of attributes contained in the bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param bundle
[in] The handle to the bundle data
- Return
the number of attributes in the bundle
-
void (*getAttributesR)(ConstAttributeDataHandle *attrsOut, const GraphContextObj &contextObj, ConstBundleHandle bundle, size_t count)
Get all of the attributes on the bundle in read-only form.
- Param attrsOut
[out] Handles to the attributes on the bundle (preallocated to hold “count” members)
- Param contextObj
[in] The context to which the bundle belongs
- Param bundle
[in] The handle to the bundle data
- Param count
[in] The number of attribute slots allocated in attrsOut (should be >= getAttributesCount())
-
void (*getAttributesW)(AttributeDataHandle *attrsOut, const GraphContextObj &contextObj, BundleHandle bundle, size_t count)
Get all of the attributes on the bundle in writable form.
- Param attrsOut
[out] Handles to the attributes on the bundle (preallocated to hold “count” members)
- Param contextObj
[in] The context to which the bundle belongs
- Param bundle
[in] The handle to the bundle data
- Param count
[in] The number of attribute slots allocated in attrsOut (should be >= getAttributesCount())
-
void (*getAttributesByNameR)(ConstAttributeDataHandle *attrsOut, const GraphContextObj &contextObj, ConstBundleHandle bundle, const NameToken *attrNames, size_t count)
Get attributes on the bundle whose names appear in “attrNames” in read-only form.
- Param attrsOut
[out] Handles to the attributes on the bundle (preallocated to hold “count” members)
- Param contextObj
[in] The context to which the bundle belongs
- Param bundle
[in] The handle to the bundle data
- Param attrNames
[in] The list of attribute names to be looked up
- Param count
[in] The number of attribute slots allocated in attrsOut (should be >= getAttributesCount())
-
void (*getAttributesByNameW)(AttributeDataHandle *attrsOut, const GraphContextObj &contextObj, BundleHandle bundle, const NameToken *attrNames, size_t count)
Get attributes on the bundle whose names appear in “attrNames” in writable form.
- Param attrsOut
[out] Handles to the attributes on the bundle (preallocated to hold “count” members)
- Param contextObj
[in] The context to which the bundle belongs
- Param bundle
[in] The handle to the bundle data
- Param attrNames
[in] The list of attribute names to be looked up
- Param count
[in] The number of attribute slots allocated in attrsOut (should be >= getAttributesCount())
-
void (*getAttributeNamesAndTypes)(NameToken *namesOut, Type *typesOut, const GraphContextObj &contextObj, ConstBundleHandle bundle, size_t count)
Get the names and types of all attributes on the bundle.
- Param namesOut
[out] Handles to the names of attributes on the bundle (preallocated to hold “count” members)
- Param typesOut
[out] Handles to the types of attributes on the bundle (preallocated to hold “count” members)
- Param contextObj
[in] The context to which the bundle belongs
- Param bundle
[in] The handle to the bundle data
- Param count
[in] The number of attribute slots allocated in attrsOut (should be >= getAttributesCount())
-
AttributeDataHandle (*addAttribute)(const GraphContextObj &contextObj, BundleHandle destination, NameToken attrName, Type attrType)
Create a new attribute and add it to the bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param attrName
[in] Name for the new attribute
- Param attrType
[in] Type for the new attribute
- Return
Handle to the newly created attribute
-
AttributeDataHandle (*addAttributeLike)(const GraphContextObj &contextObj, BundleHandle destination, ConstAttributeDataHandle pattern)
Create a new attribute and add it to the bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param pattern
[in] Attribute whose name and type is to be copied for the new attribute
- Return
Handle to the newly created attribute
-
AttributeDataHandle (*addArrayAttribute)(const GraphContextObj &contextObj, BundleHandle destination, NameToken attrName, Type attrType, size_t elementCount)
Create a new array attribute and add it to the bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param attrName
[in] Name for the new attribute
- Param attrType
[in] Type for the new attribute
- Param elementCount
[in] Starting element count for the array attribute
- Return
Handle to the newly created attribute
-
AttributeDataHandle (*addArrayOfArraysAttribute)(const GraphContextObj &contextObj, BundleHandle destination, NameToken attrName, BaseDataType baseType, size_t numComponents, size_t numArrays, ...)
Create a new array-of-arrays attribute and add it to the bundle.
Note: At the moment only arrays and arrays-of-tuples are fully supported so use with caution
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param attrName
[in] Name for the new attribute
- Param baseType
[in] Base data type for the new attribute
- Param numComponents
[in] Number of tuple elements for the new attribute (e.g. 3 for float[3])
- Param numArrays
[in] How many levels of arrays are on the attribute (currently only 1 is supported)
- Param …
[in] Variadic list containing the starting element count for each level of array
- Return
Handle to the newly created attribute
-
void (*copyAttribute)(const GraphContextObj &contextObj, BundleHandle destination, NameToken destinationAttrName, ConstAttributeDataHandle source)
Create a new attribute by copying an existing one, including its data, and renaming and add it to the bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param destinationAttrName
[in] Name for the new attribute
- Param source
[in] Handle to attribute whose data type is to be copied
- Return
Handle to the newly created attribute
-
uint64_t (*getDataID)(ConstBundleHandle bundle)
Get the unique data ID of a bundle.
- Param bundle
[in] The bundle whose ID is to be found
- Return
The unique ID of the bundle
-
void (*removeAttribute)(const GraphContextObj &contextObj, BundleHandle destination, NameToken attrName)
Remove an existing attribute from the bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param attrName
[in] Name of the attribute to remove
-
bool (*addAttributes)(const GraphContextObj &contextObj, BundleHandle destination, size_t attributeCount, const NameToken *attrNames, const Type *attrTypes)
Add a batch of attributes to a bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param attributeCount
[in] Number of attributes to be added
- Param attrNames
[in] Array of names for the new attributes
- Param attrTypes
[in] Array of types for the new attributes
- Return
Whether addition was successful
-
bool (*removeAttributes)(const GraphContextObj &contextObj, BundleHandle destination, size_t attributeCount, const NameToken *attrNames)
Remove a batch of attributes from a bundle.
- Param contextObj
[in] The context to which the bundle belongs
- Param destination
[in] The handle to the bundle data
- Param attributeCount
[in] Number of attributes to be removed
- Param attrNames
[in] Array of names to be removed
-
void (*copyAttributes)(const GraphContextObj &contextObj, BundleHandle destBundle, ConstBundleHandle sourceBundle, NameToken const *srcNames, NameToken const *dstNames, size_t namesCount)
Copy a set of attributes from a source bundle/node to another bundle/node Attributes taht don’t exists on the destination will be created The name on the destination can differ from the one on the source.
- Param contextObj
[in] The context object used to find the variable data.
- Param destBundleHandle
[in] The destination node/bundle on which to copy/create the the attributes.
- Param sourceBundleHandle
[in] The source node/bundle from which to read the data.
- Param srcNames
[in] The attributes to copy
- Param dstNames
[in] Optional - the name of the destination attribute. if nullptr, the name of input will be used if not nullptr, lenght must be equal to namesCount
- Param namesCount
[in] Length of srcNames array (and dstNames if provided)
-
const char *(*getBundlePath)(ConstBundleHandle bundle)
Retrieves the path to the bundle.
It will be part of the node in which it is defined.
- Param bundle
[in] A handle pointing to a bundle
- Return
the bundle path
-
size_t (*getAttributesCount)(const GraphContextObj &contextObj, ConstBundleHandle bundle)