imAttribTable Class Reference
[Utilities]
Detailed Description
- All the attributes have a name, a type, a count and the data.
Names are usually strings with less that 30 chars.
- Attributes are stored in a hash table for fast access.
We use the hash function described in "The Pratice of Programming" of Kernighan & Pike.
Public Member Functions | |
imAttribTable (int hash_size) | |
~imAttribTable () | |
int | Count () const |
void | RemoveAll () |
void | CopyFrom (const imAttribTable &table) |
void | Set (const char *name, int data_type, int count, const void *data) |
void | UnSet (const char *name) |
const void * | Get (const char *name, int *data_type=0, int *count=0) const |
void | ForEach (void *user_data, imAttribTableCallback attrib_func) const |
Constructor & Destructor Documentation
|
Creates an empty table. If size is zero the default size of 101 is used. Size must be a prime number. Other common values are 67, 599 and 1499.
|
|
Destroys the table and all the attributes.
|
Member Function Documentation
|
Returns the number of elements in the table.
|
|
Removes all the attributes in the table
|
|
Copies the contents of the given table into this table. 00046 { imAttribTableCopyFrom(ptable, table.ptable); }
|
|
Inserts an attribute into the table.
|
|
Removes an attribute from the table given its name.
|
|
Finds an attribute in the table. Returns the attribute if found, NULL otherwise. See also imDataType.
|
|
For each attribute calls the user callback. If the callback returns 0 the function returns.
|
The documentation for this class was generated from the following file: