HDK
|
A symbol table for attribute data. More...
#include <GT_AttributeMap.h>
Public Types | |
typedef UT_ArrayStringMap < UT_StringHolder > | ExportMapType |
typedef ExportMapType::const_iterator | const_export_iterator |
typedef UT_ArrayStringMap< int > | NamesMapType |
typedef NamesMapType::const_iterator | const_names_iterator |
Public Member Functions | |
GT_AttributeMap (int capacity=0) | |
Default constructor. More... | |
GT_AttributeMap (const GT_AttributeMap &src) | |
Copy constructor. More... | |
~GT_AttributeMap () | |
Destructor. More... | |
bool | operator== (const GT_AttributeMap &map) const |
Compare two maps. More... | |
bool | operator!= (const GT_AttributeMap &map) const |
void | clear () |
Clear the map. More... | |
int | entries () const |
How many symbols are there. More... | |
int64 | getMemoryUsage (bool inclusive) const |
Return approximate memory used by map. More... | |
int | get (const UT_StringRef &name) const |
Find the symbol index (or -1 if no symbol exists) More... | |
bool | hasName (const UT_StringRef &name) const |
Test if a name exists. More... | |
const UT_StringHolder & | getName (int index) const |
Find the name for the given index. More... | |
const char * | getLabel (int index, UT_WorkBuffer &label_storage) const |
const UT_StringHolder & | getExportName (int index) const |
GT_Owner | getOriginalOwner (int idx) const |
void | setOriginalOwner (int i, GT_Owner o) |
Set the original owner. More... | |
const UT_StringArray & | getNames () const |
Get the symbol names. More... | |
int | add (const UT_StringHolder &name, bool replace_existing) |
const_names_iterator | begin () const |
Access to a symbol table traverser. More... | |
void | addExportName (int idx, const UT_StringHolder &export_name) |
void | addExportName (const UT_StringHolder &name, const UT_StringHolder &export_name) |
Public Member Functions inherited from UT_IntrusiveRefCounter< GT_AttributeMap > | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
Default constructor: Sets counter to 0. More... | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
Copy constructor: Sets counter to 0. More... | |
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
Assignment operator: Does not modify counter. More... | |
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
Return current counter. More... | |
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
Static Public Member Functions | |
static const GT_AttributeMapHandle | filter (const GT_AttributeMapHandle &src, const GT_AttributeMapFilter &filter) |
Friends | |
class | GT_AttributeList |
Additional Inherited Members | |
Protected Member Functions inherited from UT_IntrusiveRefCounter< GT_AttributeMap > | |
SYS_FORCE_INLINE | ~UT_IntrusiveRefCounter () |
Destructor: Only derived classes can destruct this. More... | |
A symbol table for attribute data.
Attribute data is stored in two structures. The GT_AttributeMap keeps a mapping of names to integer values. The integer values are the offsets into the GT_AttributeList, which stores the actual data.
Definition at line 42 of file GT_AttributeMap.h.
Definition at line 47 of file GT_AttributeMap.h.
Definition at line 49 of file GT_AttributeMap.h.
Definition at line 46 of file GT_AttributeMap.h.
Definition at line 48 of file GT_AttributeMap.h.
|
explicit |
Default constructor.
GT_AttributeMap::GT_AttributeMap | ( | const GT_AttributeMap & | src | ) |
Copy constructor.
GT_AttributeMap::~GT_AttributeMap | ( | ) |
Destructor.
int GT_AttributeMap::add | ( | const UT_StringHolder & | name, |
bool | replace_existing | ||
) |
Add a new symbol to the index. If this is a duplicate symbol, setting replace_existing
will return the previous index. Otherwise, -1 will be returned.
|
inline |
Add export mapping (from parameter name to export name)
Definition at line 100 of file GT_AttributeMap.h.
void GT_AttributeMap::addExportName | ( | const UT_StringHolder & | name, |
const UT_StringHolder & | export_name | ||
) |
Add export mapping (from parameter name to export name)
|
inline |
Access to a symbol table traverser.
Definition at line 127 of file GT_AttributeMap.h.
void GT_AttributeMap::clear | ( | ) |
Clear the map.
|
inline |
How many symbols are there.
Definition at line 74 of file GT_AttributeMap.h.
|
static |
Create a new attribute map by filtering the entries. Each entry in the src
is filtered by the filter
and if accepted, added to the new map.
|
inline |
Find the symbol index (or -1 if no symbol exists)
Definition at line 80 of file GT_AttributeMap.h.
const UT_StringHolder& GT_AttributeMap::getExportName | ( | int | index | ) | const |
Get the exported name for a parameter
const char* GT_AttributeMap::getLabel | ( | int | index, |
UT_WorkBuffer & | label_storage | ||
) | const |
Get a label which includes the export name and other properties This returns the string stored in the label_storage
int64 GT_AttributeMap::getMemoryUsage | ( | bool | inclusive | ) | const |
Return approximate memory used by map.
|
inline |
Find the name for the given index.
Definition at line 91 of file GT_AttributeMap.h.
|
inline |
Get the symbol names.
Definition at line 119 of file GT_AttributeMap.h.
Since GT can move attribute storage classes around, especially compared with GEO, it's sometimes useful to know what the original attribute owner was. This is not always guaranteed to be set to something other that GT_OWNER_INVALID, but it will likely be set if the attribute originates from a GA_Attribute.
Definition at line 113 of file GT_AttributeMap.h.
|
inline |
Test if a name exists.
Definition at line 87 of file GT_AttributeMap.h.
|
inline |
Definition at line 67 of file GT_AttributeMap.h.
bool GT_AttributeMap::operator== | ( | const GT_AttributeMap & | map | ) | const |
Compare two maps.
Set the original owner.
Definition at line 116 of file GT_AttributeMap.h.
|
friend |
Definition at line 134 of file GT_AttributeMap.h.