HDK
|
#include <PI_ImportUtils.h>
Classes | |
class | base_iterator |
Iterator conforming to Houdini's atEnd(), advance() interface. More... | |
Public Types | |
typedef UT_StringMap< ITEM_T > | MapType |
typedef MapType::const_iterator | const_map_iterator |
typedef MapType::iterator | map_iterator |
typedef ITEM_T | value_type |
typedef base_iterator< ITEM_T, map_iterator > | iterator |
typedef base_iterator< const ITEM_T, const_map_iterator > | const_iterator |
typedef const_iterator | traverser |
Public Member Functions | |
UT_SymbolMap () | |
Constructor. More... | |
~UT_SymbolMap () | |
Destructor. More... | |
void | addSymbol (const UT_StringHolder &symbol, const ITEM_T &data) |
Add a symbol to the map. More... | |
bool | findSymbol (const UT_StringRef &symbol, ITEM_T *datap) const |
bool | contains (const UT_StringRef &symbol) const |
Check if a symbol exists. More... | |
exint | count (const UT_StringRef &symbol) const |
Find out how many times a symbol exists (this will be either 0 or 1). More... | |
bool | deleteSymbol (const UT_StringRef &symbol) |
Erase a symbol from the map. More... | |
void | clear () |
const char * | addSymbolAndGetReference (const UT_StringHolder &symbol, const ITEM_T &data) |
Add a symbol and return the string reference. More... | |
bool | empty () const |
Check if the map is empty. More... | |
ITEM_T & | operator[] (const UT_StringHolder &symbol) |
ITEM_T & | insert (const UT_StringHolder &name, const ITEM_T &item) |
void | reserveTableSize (exint size) |
float | getLoadFactor () const |
Get current load factor. More... | |
void | mergeTable (const UT_SymbolMap &table) |
Merge the specified table with ourselves. More... | |
const char * | getStringReference (const UT_StringRef &symbol) |
UT_StringHolder | makeUniqueKey (const char *name) const |
Returns a unique key based using the passed-in string as a prefix. More... | |
int64 | getMemoryUsage (bool inclusive) const |
Return an approximation of how much memory we use. More... | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
const_map_iterator | map_begin () const |
const_map_iterator | map_end () const |
map_iterator | map_begin () |
map_iterator | map_end () |
UT_IteratorRange < const_map_iterator > | map_range () const |
UT_IteratorRange< map_iterator > | map_range () |
void | outputStats (std::ostream &os) const |
map_iterator | find (const UT_StringRef &symbol) |
const_map_iterator | find (const UT_StringRef &symbol) const |
exint | erase (const UT_StringRef &symbol) |
map_iterator | erase (const_map_iterator it) |
exint | entries () const |
exint | size () const |
exint | bucket_count () const |
exint | capacity () const |
float | getMaxLoadFactor () const |
void | setMaxLoadFactor (float f) |
float | getMinLoadFactor () const |
void | setMinLoadFactor (float) |
int | traverseConst (int(*function)(ITEM_T &, const char *, void *), void *data) const |
int | traverse (int(*function)(ITEM_T &, const char *, void *), void *data) |
Protected Attributes | |
MapType | myMap |
Friends | |
template<typename OS , typename T > | |
OS & | operator<< (OS &os, const UT_SymbolMap< T > &d) |
A UT_SymbolMap contains a UT_Map but provides the interface required by what was UT_SymbolTable. Strings are passed as const char *
.
Definition at line 22 of file PI_ImportUtils.h.
typedef base_iterator<const ITEM_T, const_map_iterator> UT_SymbolMap< T >::const_iterator |
Definition at line 334 of file UT_SymbolTable.h.
typedef MapType::const_iterator UT_SymbolMap< T >::const_map_iterator |
Definition at line 34 of file UT_SymbolTable.h.
typedef base_iterator<ITEM_T, map_iterator> UT_SymbolMap< T >::iterator |
Definition at line 333 of file UT_SymbolTable.h.
typedef MapType::iterator UT_SymbolMap< T >::map_iterator |
Definition at line 35 of file UT_SymbolTable.h.
typedef UT_StringMap<ITEM_T> UT_SymbolMap< T >::MapType |
Definition at line 33 of file UT_SymbolTable.h.
typedef const_iterator UT_SymbolMap< T >::traverser |
Definition at line 336 of file UT_SymbolTable.h.
typedef ITEM_T UT_SymbolMap< T >::value_type |
Definition at line 36 of file UT_SymbolTable.h.
|
inlineexplicit |
Constructor.
Definition at line 39 of file UT_SymbolTable.h.
|
inline |
Destructor.
Definition at line 44 of file UT_SymbolTable.h.
|
inline |
Add a symbol to the map.
Definition at line 52 of file UT_SymbolTable.h.
|
inline |
Add a symbol and return the string reference.
Definition at line 114 of file UT_SymbolTable.h.
|
inline |
Definition at line 338 of file UT_SymbolTable.h.
|
inline |
Definition at line 340 of file UT_SymbolTable.h.
|
inline |
Information about the buckets
Definition at line 132 of file UT_SymbolTable.h.
|
inline |
Information about the buckets
Definition at line 133 of file UT_SymbolTable.h.
|
inline |
Clear the map
Definition at line 108 of file UT_SymbolTable.h.
|
inline |
Check if a symbol exists.
Definition at line 84 of file UT_SymbolTable.h.
|
inline |
Find out how many times a symbol exists (this will be either 0 or 1).
Definition at line 87 of file UT_SymbolTable.h.
|
inline |
Erase a symbol from the map.
Definition at line 91 of file UT_SymbolTable.h.
|
inline |
Check if the map is empty.
Definition at line 138 of file UT_SymbolTable.h.
|
inline |
Definition at line 339 of file UT_SymbolTable.h.
|
inline |
Definition at line 341 of file UT_SymbolTable.h.
|
inline |
Query the number of elements in the map
Definition at line 126 of file UT_SymbolTable.h.
|
inline |
Erase a symbol from the map
Definition at line 98 of file UT_SymbolTable.h.
|
inline |
Erase a symbol from the map
Definition at line 102 of file UT_SymbolTable.h.
|
inline |
Find a symbol and return an iterator. Returns map_end() if the symbol is not found in the map.
Definition at line 73 of file UT_SymbolTable.h.
|
inline |
Find a symbol and return an iterator. Returns map_end() if the symbol is not found in the map.
Definition at line 77 of file UT_SymbolTable.h.
|
inline |
Find a symbol in the map. If the symbol is found, the data pointer passed in will be assigned to the ITEM_T in the map.
Definition at line 58 of file UT_SymbolTable.h.
|
inline |
Get current load factor.
Definition at line 160 of file UT_SymbolTable.h.
|
inline |
Adjust the maximum/minimum load factors The table will automatically rebuild itself to keep the load factor within the specified range. A minimum load factor of 0 means that the table will never shrink when elements are deleted from it.
Definition at line 168 of file UT_SymbolTable.h.
|
inline |
Return an approximation of how much memory we use.
Definition at line 216 of file UT_SymbolTable.h.
|
inline |
Adjust the maximum/minimum load factors The table will automatically rebuild itself to keep the load factor within the specified range. A minimum load factor of 0 means that the table will never shrink when elements are deleted from it.
Definition at line 172 of file UT_SymbolTable.h.
|
inline |
"getStringReference" returns a pointer to the actual string that is maintained in the symbol table. This can be used to implement a shared string symbol table.
Definition at line 189 of file UT_SymbolTable.h.
|
inline |
Definition at line 146 of file UT_SymbolTable.h.
|
inline |
Returns a unique key based using the passed-in string as a prefix.
Definition at line 201 of file UT_SymbolTable.h.
|
inline |
Definition at line 343 of file UT_SymbolTable.h.
|
inline |
Definition at line 345 of file UT_SymbolTable.h.
|
inline |
Definition at line 344 of file UT_SymbolTable.h.
|
inline |
Definition at line 346 of file UT_SymbolTable.h.
|
inline |
Definition at line 348 of file UT_SymbolTable.h.
|
inline |
Definition at line 350 of file UT_SymbolTable.h.
|
inline |
Merge the specified table with ourselves.
Definition at line 178 of file UT_SymbolTable.h.
|
inline |
Retrieve an entry in the table by name, creating it if it doesn't already exist.
Definition at line 142 of file UT_SymbolTable.h.
void UT_SymbolMap< T >::outputStats | ( | std::ostream & | os | ) | const |
Write out some statistics pertaining to the underlying map container to the output stream given.
Definition at line 379 of file UT_SymbolTable.h.
|
inline |
Call this method when you're adding entries to a table inside a loop and you know how many entries you'll be adding. This will create at least size
buckets but also ensure the load factor is less than the maximum load factor.
Definition at line 156 of file UT_SymbolTable.h.
|
inline |
Adjust the maximum/minimum load factors The table will automatically rebuild itself to keep the load factor within the specified range. A minimum load factor of 0 means that the table will never shrink when elements are deleted from it.
Definition at line 170 of file UT_SymbolTable.h.
|
inline |
Adjust the maximum/minimum load factors The table will automatically rebuild itself to keep the load factor within the specified range. A minimum load factor of 0 means that the table will never shrink when elements are deleted from it.
Definition at line 174 of file UT_SymbolTable.h.
|
inline |
Query the number of elements in the map
Definition at line 127 of file UT_SymbolTable.h.
|
inline |
"traverse" invokes the given function with every member of the symbol table. The order of traversal is undefined. If the function returns a non-zero value the traversal continues. If it returns zero then traversal stops. The return value is zero if the traversal was interupted and one otherwise.
Call traverseConst() if you will not be removing things from the table while traversing, and traverse() if you might be. It is only safe to remove the current item when using traverse() – not other items. If you call traverse() and add something to the table, you may or may not encounter it later in the traversal.
Definition at line 252 of file UT_SymbolTable.h.
|
inline |
"traverse" invokes the given function with every member of the symbol table. The order of traversal is undefined. If the function returns a non-zero value the traversal continues. If it returns zero then traversal stops. The return value is zero if the traversal was interupted and one otherwise.
Call traverseConst() if you will not be removing things from the table while traversing, and traverse() if you might be. It is only safe to remove the current item when using traverse() – not other items. If you call traverse() and add something to the table, you may or may not encounter it later in the traversal.
Definition at line 238 of file UT_SymbolTable.h.
|
friend |
Definition at line 388 of file UT_SymbolTable.h.
|
protected |
Definition at line 360 of file UT_SymbolTable.h.