HDK
|
A specialization of GA_AIFDictTuple to access "shared strings". More...
#include <GA_AIFSharedDictTuple.h>
Classes | |
class | iterator |
Class to iterate over all the options in the shared options table. More... | |
Public Member Functions | |
GA_AIFSharedDictTuple () | |
virtual | ~GA_AIFSharedDictTuple () |
virtual bool | getStatistics (const GA_Attribute *attrib, GA_DictTableStatistics &stats) const =0 |
Query information about the string storage. More... | |
virtual bool | compactStorage (GA_Attribute *attrib) const =0 |
Compact the string storage. More... | |
virtual bool | extractDicts (const GA_Attribute *attrib, UT_Array< UT_OptionsHolder > &options, UT_IntArray &handles) const =0 |
virtual bool | extractHandles (const GA_Attribute *attrib, UT_IntArray &handles) const =0 |
GA_Size | getTableEntries (const GA_Attribute *attrib) const |
Return the number of entries in the shared string table. More... | |
virtual GA_DictIndexType | validateTableHandle (const GA_Attribute *attrib, GA_DictIndexType index) const =0 |
virtual UT_OptionsHolder | getTableDict (const GA_Attribute *attrib, GA_DictIndexType handle) const =0 |
Get a string from the string table (without going through an attribute) More... | |
virtual GA_DictIndexType | getTableHandle (const GA_Attribute *attrib, const UT_OptionsRef &opt) const =0 |
virtual UT_OptionsHolder | getTableOrderedDict (const GA_Attribute *a, exint index) const =0 |
virtual bool | replaceTableDict (GA_Attribute *attrib, GA_DictIndexType handle, const UT_OptionsHolder &opt) const =0 |
iterator | begin (const GA_Attribute *a) const |
iterator | end () const |
virtual int | getTupleSize (const GA_Attribute *attrib) const =0 |
Query the tuple size. More... | |
virtual bool | setTupleSize (GA_Attribute *attrib, int size) const =0 |
Set the tuple size. More... | |
UT_StringHolder | getString (const GA_Attribute *attrib, GA_Offset offset, int component=0, bool onlyspaces=false) const |
virtual UT_OptionsHolder | getDict (const GA_Attribute *attrib, GA_Offset ai, int tuple_index=0) const |
Get a single string from the array for a single tuple of an element. More... | |
virtual GA_DictIndexType | getHandle (const GA_Attribute *attrib, GA_Offset ai, int tuple_index=0) const =0 |
Get the handle from the array for a single tuple of an element. More... | |
virtual bool | getHandles (const GA_Attribute *attrib, GA_Offset ai, GA_DictIndexType *handles, int count, int start=0) const |
Get the full tuple of indices for a single element. More... | |
virtual bool | setDict (GA_Attribute *attrib, GA_Offset ai, const UT_OptionsHolder &opt, int tuple_index) const |
Set a single component for a single element. More... | |
virtual bool | setDict (GA_Attribute *attrib, const GA_Range &ai, const UT_OptionsHolder &opt, int tuple_index) const |
Set a single component for a range of elements. More... | |
virtual bool | setHandle (GA_Attribute *attrib, GA_Offset ai, GA_DictIndexType handle, int tuple_index) const =0 |
Set a single component for a single element. More... | |
virtual bool | setHandle (GA_Attribute *attrib, const GA_Range &ai, GA_DictIndexType handle, int tuple_index) const |
Set a single component for a range of elements. More... | |
virtual bool | setHandles (GA_Attribute *attrib, GA_Offset ai, const GA_DictIndexType *handles, int count, int start=0) const |
Set multiple components for a single element. More... | |
virtual bool | setHandles (GA_Attribute *attrib, const GA_Range &ai, const GA_DictIndexType *handles, int count, int start=0) const |
Set multiple components for a range of elements. More... | |
Protected Member Functions | |
virtual GA_DictIndexType | addDictReference (GA_Attribute *attribute, const UT_OptionsHolder &opt) const =0 |
Add (or increment) reference to a string. More... | |
virtual void | delHandleReference (GA_Attribute *attribute, GA_DictIndexType handle) const =0 |
Decrement reference to a handle. More... | |
A specialization of GA_AIFDictTuple to access "shared strings".
This class provides the interface to access string table data. Each attribute type may provide this interface if it makes sense.
Definition at line 59 of file GA_AIFSharedDictTuple.h.
GA_AIFSharedDictTuple::GA_AIFSharedDictTuple | ( | ) |
|
virtual |
|
protectedpure virtual |
Add (or increment) reference to a string.
|
inline |
Definition at line 223 of file GA_AIFSharedDictTuple.h.
|
pure virtual |
Compact the string storage.
|
protectedpure virtual |
Decrement reference to a handle.
Definition at line 225 of file GA_AIFSharedDictTuple.h.
|
pure virtual |
Extract data from the string table. This will extract all the unique strings which are referenced by the attribute. The string handles are guaranteed to be in ascending order, but may or may not be contiguous.
|
pure virtual |
Extract all of the unique string handles of the attribute. The string handles are guaranteed to be in ascending order, but may or may not be contiguous.
|
virtual |
Get a single string from the array for a single tuple of an element.
|
pure virtual |
Get the handle from the array for a single tuple of an element.
|
virtual |
Get the full tuple of indices for a single element.
|
pure virtual |
Query information about the string storage.
UT_StringHolder GA_AIFSharedDictTuple::getString | ( | const GA_Attribute * | attrib, |
GA_Offset | offset, | ||
int | component = 0 , |
||
bool | onlyspaces = false |
||
) | const |
Get a string version to save writing marshalling code This lets you use this AIF in string-aware code and get sensible outputs. JSON normally has returns and tabs for formatting, onlyspaces will collapse these for a more compact output.
|
pure virtual |
Get a string from the string table (without going through an attribute)
|
inline |
Return the number of entries in the shared string table.
Definition at line 92 of file GA_AIFSharedDictTuple.h.
|
pure virtual |
Get the handle (index) corresponding to the given string, returning -1 if none.
|
pure virtual |
GA_DictIndexType indices may not be contiguous, this method allows you to get a string given an ordered index. Strings will be defined for all contiguous strings. This may be an expensive operation, it's better to access strings by their index if possible.
This method will return a NULL pointer past the end of the string table
|
pure virtual |
Query the tuple size.
|
pure virtual |
Replace a string in the shared string table with a new value. Warning, it's possible that the table will "collapse" after the replacement. For example:
In the above example, all elements which originally referenced "bar" will now reference "foo". This means that trying to swap two values will not work as expected.
|
virtual |
Set a single component for a single element.
|
virtual |
Set a single component for a range of elements.
|
pure virtual |
Set a single component for a single element.
|
virtual |
Set a single component for a range of elements.
|
virtual |
Set multiple components for a single element.
|
virtual |
Set multiple components for a range of elements.
|
pure virtual |
Set the tuple size.
|
pure virtual |
It's possible that there are invalid handle indexes mixed with the valid handles. When iterating over all the handles, you can call validateTableHandle()
which will ensure that there's a string associated with the given handle.