11 #ifndef __UT_HashTable_h__
12 #define __UT_HashTable_h__
28 explicit UT_HashTable();
29 virtual ~UT_HashTable();
37 void useOrderedLists(
bool ordered);
41 const UT_Hash **hash_symbol = 0)
const;
53 if (!findSymbol(symbol, &thing))
55 return thing.template asPointer<T>();
58 int deleteSymbol(
const UT_Hash& symbol);
59 int moveSymbol(
const UT_Hash &oldsymbol,
63 unsigned entries()
const {
return myNbrEntries; }
64 unsigned size()
const {
return myNbrEntries; }
65 bool empty()
const {
return !myNbrEntries; }
72 void reserveTableSize(
int size);
78 void setMaxLoadFactor(
float max_load_factor);
80 void setMinLoadFactor(
float min_load_factor);
83 void mergeTable(
const UT_HashTable &
table);
92 void dumpTable(FILE *output)
const;
94 int64 getMemoryUsage(
bool inclusive)
const;
116 : myCurrList(0), myEndList(0)
124 {
return myCurrEntry.thing(); }
126 {
return myCurrEntry.
hash(); }
130 return ((!myCurrList && !cmp.myCurrList) ||
131 ((myCurrList == cmp.myCurrList) &&
132 (myCurrEntry == cmp.myCurrEntry)));
135 {
return !(*
this ==
cmp); }
155 myCurrList = src.myCurrList;
156 myEndList = src.myEndList;
157 myCurrEntry = src.myCurrEntry;
163 if( ++myCurrEntry == myCurrList->end() )
172 : myCurrList(list), myEndList(endlist)
173 { advanceToNextList(); }
175 void advanceToNextList()
177 while( myCurrList != myEndList &&
178 myCurrList->begin() == myCurrList->end() )
180 if( myCurrList == myEndList )
183 myCurrEntry = myCurrList->begin();
190 friend class UT_HashTable;
196 return traverser(myTable, myTable + mySize);
203 enum UT_AdjustType { UT_ADJUST_INCREASE, UT_ADJUST_DECREASE };
204 void adjustTableSize(UT_AdjustType adjust_type);
205 void allocateTableOfNewSize(
int size);
210 unsigned int myNbrEntries;
int contains(const UT_Hash &symbol) const
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
#define SYS_DEPRECATED_PUSH_DISABLE()
#define SYS_DEPRECATED_POP_DISABLE()
float getMaxLoadFactor() const
GLsizei const GLfloat * value
int count(const UT_Hash &symbol) const
T * findPointer(const UT_Hash &symbol) const
traverser(const traverser &src)
int operator!=(const traverser &cmp) const
IMATH_HOSTDEVICE constexpr int cmp(T a, T b) IMATH_NOEXCEPT
#define SYS_DEPRECATED_REPLACE(__V__, __R__)
traverser & operator++(int)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
virtual unsigned hash() const =0
GLenum GLenum GLsizei void * table
UT_API void outputStats(std::ostream &os, exint size, exint bucket_count, exint capacity, float load_factor, float min_load_factor, float max_load_factor)
float getMinLoadFactor() const
traverser & operator=(const traverser &src)
GU_API ComputeHierarchyResult traverse(const GU_Detail *gdp, GA_OffsetArray &roots, GA_OffsetArray &nodes, GA_OffsetArray &parents, UT_Map< GA_Offset, GA_OffsetArray > *children=nullptr)
bool OIIO_UTIL_API contains(string_view a, string_view b)
Does 'a' contain the string 'b' within it?
int operator==(const traverser &cmp) const