HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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_ArrayStringMap
< UT_StringHolder
ExportMapType
 
typedef
ExportMapType::const_iterator 
const_export_iterator
 
typedef UT_ArrayStringMap< intNamesMapType
 
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_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 () 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_IntrusiveRefCounteroperator= (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...
 

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.

Examples:
RAY/RAY_DemoGT.C.

Definition at line 42 of file GT_AttributeMap.h.

Member Typedef Documentation

Constructor & Destructor Documentation

GT_AttributeMap::GT_AttributeMap ( int  capacity = 0)
explicit

Default constructor.

GT_AttributeMap::GT_AttributeMap ( const GT_AttributeMap src)

Copy constructor.

GT_AttributeMap::~GT_AttributeMap ( )

Destructor.

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.

Examples:
RAY/RAY_DemoGT.C.
void GT_AttributeMap::addExportName ( int  idx,
const UT_StringHolder export_name 
)
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)

const_names_iterator GT_AttributeMap::begin ( void  ) const
inline

Access to a symbol table traverser.

Definition at line 127 of file GT_AttributeMap.h.

void GT_AttributeMap::clear ( )

Clear the map.

int GT_AttributeMap::entries ( ) const
inline

How many symbols are there.

Definition at line 74 of file GT_AttributeMap.h.

static const GT_AttributeMapHandle GT_AttributeMap::filter ( const GT_AttributeMapHandle src,
const GT_AttributeMapFilter filter 
)
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.

int GT_AttributeMap::get ( const UT_StringRef name) const
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.

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

Find the name for the given index.

Definition at line 91 of file GT_AttributeMap.h.

const UT_StringArray& GT_AttributeMap::getNames ( ) const
inline

Get the symbol names.

Definition at line 119 of file GT_AttributeMap.h.

GT_Owner GT_AttributeMap::getOriginalOwner ( int  idx) const
inline

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.

bool GT_AttributeMap::hasName ( const UT_StringRef name) const
inline

Test if a name exists.

Definition at line 87 of file GT_AttributeMap.h.

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

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

Set the original owner.

Definition at line 116 of file GT_AttributeMap.h.

Friends And Related Function Documentation

friend class GT_AttributeList
friend

Definition at line 134 of file GT_AttributeMap.h.


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