All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GT_AttributeMap Class Reference

A symbol table for attribute data. More...

#include <GT_AttributeMap.h>

+ Inheritance diagram for GT_AttributeMap:

Public Types

typedef UT_SymbolMap
< UT_StringHolder
typedef UT_SymbolMap< intNamesMapType

Public Member Functions

 GT_AttributeMap ()
 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_StringHolder &name) const
 Find the symbol index (or -1 if no symbol exists) More...
bool hasName (const UT_StringHolder &name) const
 Test if a name exists. More...
const UT_StringHoldergetName (int index) const
 Find the name for the given index. More...
const char * getLabel (int index, UT_WorkBuffer &label_storage) const
const UT_StringHoldergetExportName (int index) const
GT_Owner getOriginalOwner (int idx) const
void setOriginalOwner (int i, GT_Owner o)
 Set the original owner. More...
const UT_StringArraygetNames () 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 ()
 Default constructor: Sets counter to 0. More...
SYS_FORCE_INLINE UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &)
 Copy constructor: Sets counter to 0. More...
UT_IntrusiveRefCounteroperator= (const UT_IntrusiveRefCounter &)
 Assignment operator: Does not modify counter. More...
SYS_FORCE_INLINE uint32 use_count () const
 Return current counter. More...

Static Public Member Functions

static const GT_AttributeMapHandle filter (const GT_AttributeMapHandle &src, const GT_AttributeMapFilter &filter)


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...

Detailed Description

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 41 of file GT_AttributeMap.h.

Member Typedef Documentation

Definition at line 47 of file GT_AttributeMap.h.

Constructor & Destructor Documentation

GT_AttributeMap::GT_AttributeMap ( )

Default constructor.

GT_AttributeMap::GT_AttributeMap ( const GT_AttributeMap src)

Copy constructor.

GT_AttributeMap::~GT_AttributeMap ( )


Member Function Documentation

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.

void GT_AttributeMap::addExportName ( int  idx,
const UT_StringHolder export_name 

Add export mapping (from parameter name to export name)

Definition at line 95 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)

const_names_iterator GT_AttributeMap::begin ( void  ) const

Access to a symbol table traverser.

Definition at line 122 of file GT_AttributeMap.h.

void GT_AttributeMap::clear ( )

Clear the map.

int GT_AttributeMap::entries ( void  ) const

How many symbols are there.

Definition at line 73 of file GT_AttributeMap.h.

static const GT_AttributeMapHandle GT_AttributeMap::filter ( const GT_AttributeMapHandle src,
const GT_AttributeMapFilter filter 

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.

int GT_AttributeMap::get ( const UT_StringHolder name) const

Find the symbol index (or -1 if no symbol exists)

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.

const UT_StringHolder& GT_AttributeMap::getName ( int  index) const

Find the name for the given index.

Definition at line 86 of file GT_AttributeMap.h.

const UT_StringArray& GT_AttributeMap::getNames ( ) const

Get the symbol names.

Definition at line 114 of file GT_AttributeMap.h.

GT_Owner GT_AttributeMap::getOriginalOwner ( int  idx) const

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 108 of file GT_AttributeMap.h.

bool GT_AttributeMap::hasName ( const UT_StringHolder name) const

Test if a name exists.

Definition at line 82 of file GT_AttributeMap.h.

bool GT_AttributeMap::operator!= ( const GT_AttributeMap map) const

Definition at line 66 of file GT_AttributeMap.h.

bool GT_AttributeMap::operator== ( const GT_AttributeMap map) const

Compare two maps.

void GT_AttributeMap::setOriginalOwner ( int  i,
GT_Owner  o 

Set the original owner.

Definition at line 111 of file GT_AttributeMap.h.

Friends And Related Function Documentation

friend class GT_AttributeList

Definition at line 129 of file GT_AttributeMap.h.

The documentation for this class was generated from the following file: