HDK
|
A specialization of GA_AIFDictArray to access "shared strings". More...
#include <GA_AIFSharedDictArray.h>
Classes | |
class | iterator |
Class to iterate over all the strings in the shared string table. More... | |
Public Member Functions | |
GA_AIFSharedDictArray () | |
virtual | ~GA_AIFSharedDictArray () |
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 > &strings, 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 &string) 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 &string) const =0 |
iterator | begin (const GA_Attribute *a) const |
iterator | end () const |
virtual int | getTupleSize (const GA_Attribute *attrib) const =0 |
virtual bool | setTupleSize (GA_Attribute *attrib, int size) const =0 |
virtual GA_Storage | getStorage (const GA_Attribute *attrib) const =0 |
virtual void | getDict (const GA_Attribute *attribute, GA_Offset offset, UT_Array< UT_OptionsHolder > &strings) const =0 |
Get a single string from the array for a single tuple of an element. More... | |
virtual void | getDictIndex (const GA_Attribute *attribute, GA_Offset offset, UT_Array< GA_DictIndexType > &indices) const =0 |
Get the handle from the array for a single tuple of an element. More... | |
virtual void | setDict (GA_Attribute *attribute, GA_Offset offset, const UT_Array< UT_OptionsHolder > &strings) const =0 |
Set a single component for a single element. More... | |
virtual void | setDictIndex (GA_Attribute *attribute, GA_Offset offset, const UT_Array< GA_DictIndexType > &indices) const =0 |
Set a single component for a range of elements. More... | |
virtual exint | arraySize (const GA_Attribute *atr, GA_Offset off) const =0 |
Return the size of the array for the GA_Offset. More... | |
bool | get (const GA_Attribute *attrib, GA_Offset o, UT_Array< UT_OptionsHolder > &v) const |
bool | set (GA_Attribute *attrib, GA_Offset o, const UT_Array< UT_OptionsHolder > &v) const |
virtual exint | findMaximumArrayLength (const GA_Attribute *attrib) const =0 |
Protected Member Functions | |
virtual GA_DictIndexType | addDictReference (GA_Attribute *attribute, const UT_OptionsHolder &string) 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_AIFDictArray 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 32 of file GA_AIFSharedDictArray.h.
GA_AIFSharedDictArray::GA_AIFSharedDictArray | ( | ) |
|
virtual |
|
protectedpure virtual |
Add (or increment) reference to a string.
|
pure virtual |
Return the size of the array for the GA_Offset.
|
inline |
Definition at line 199 of file GA_AIFSharedDictArray.h.
|
pure virtual |
Compact the string storage.
|
protectedpure virtual |
Decrement reference to a handle.
Definition at line 201 of file GA_AIFSharedDictArray.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.
|
pure virtual |
Return the length of longest array
|
inline |
Get a UT_Array<UT_OptionsHolder> at specific GA_Offset. This is an alias for getDict() so that we can treat this AIF similar to GA_AIFNumericArray.
Definition at line 239 of file GA_AIFSharedDictArray.h.
|
pure 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.
|
pure virtual |
Query information about the string storage.
|
pure virtual |
|
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 70 of file GA_AIFSharedDictArray.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. Dicts 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 |
|
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.
|
inline |
Set a UT_DictArray at specific GA_Offset. This is an alias for setDict() so that we can treat this AIF similar to GA_AIFNumericArray.
Definition at line 248 of file GA_AIFSharedDictArray.h.
|
pure virtual |
Set a single component for a single element.
|
pure virtual |
Set a single component for a range of elements.
|
pure virtual |
|
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.