obmap Private Interface
More...
#include "../obmap.h"
#include "../obvector.h"
#include "../obdeque.h"
Go to the source code of this file.
|
struct | obmap_pair_struct |
| obmap pair internal structure, encapsulates a key-value pair for the given map More...
|
|
struct | obmap_struct |
| obmap internal structure, encapsulating all data needed for an instance of obmap More...
|
|
obmap Private Interface
- Author
- theck
Adds an obdeque_iterator to the proper location within the obmap.
- Parameters
-
m | The obmap to add the iterator to |
it | The obdeque_iterator to add to the hash table |
int8_t obmap_compare |
( |
const obj * |
a, |
|
|
const obj * |
b |
|
) |
| |
Compares two instances of obmap.
- Parameters
-
a | A non-NULL obj pointer to type obmap |
b | A non-NULL obj pointer to type obmap |
- Return values
-
OB_LESS_THAN | obj a is less than b |
OB_GREATER_THAN | obj a is equivalent to b |
OB_EQUAL_TO | obj a is greater than b |
Copy constructor, creates a new obmap_pair with the same key-value of an existing obmap_pair.
- Parameters
-
mp | The obmap instance to copy |
- Returns
- An instance of class obmap_pair that contains the same key-value as mp
obmap* obmap_create_default |
( |
void |
) | |
|
Default constructor for obmap.
- Returns
- An instance of class obmap
- Warning
- All public constructors should call this constructor and intialize individual members as needed, so that all base data is initialized properly.
void obmap_destroy |
( |
obj * |
to_dealloc) | |
|
Destructor for obmap.
- Parameters
-
to_dealloc | An obj pointer to an instance of obmap with reference count of 0 |
- Warning
- Do not call manually, release will call automatically when the instances reference count drops to 0!
void obmap_destroy_pair |
( |
obj * |
to_dealloc) | |
|
Destructor for obmap_pair.
- Parameters
-
to_dealloc | An obj pointer to an instance of obmap with reference count of 0 |
- Warning
- Do not call manually, release will call automatically when the instances reference count drops to 0!
void obmap_display |
( |
const obj * |
to_print) | |
|
Displays an instance of obmap to stderr.
- Parameters
-
to_print | A non-NULL obj pointer to type obmap |
void obmap_display_pair |
( |
const obj * |
to_print) | |
|
Displays an instance of obmap_pair to stderr.
- Parameters
-
to_print | A non-NULL obj pointer to type obmap_pair |
Finds a key within the hash table, it exists.
- Parameters
-
m | The obmap in which to search for the key |
key | The key to serach for within the obmap |
- Returns
- Index in the hash_table where a result can be found or where a NULL value resides if key was not found
Hash function for obmap.
- Parameters
-
to_hash | An obj pointer to an instance of obmap |
- Returns
- Key value (hash) for the given obj pointer to a obmap
Hash function for obmap_pair.
- Parameters
-
to_hash | An obj pointer to an instance of obmap_pair |
- Returns
- Key value (hash) for the given obj pointer to a obmap_pair
void obmap_increase_size |
( |
obmap * |
to_size) | |
|
Increases the size of the map to the next capacity within MAP_CAPACITIES array.
- Parameters
-
Default constructor for an obmap_pair.
- Parameters
-
key | Offbrand compatible class instance used to lookup value within hash table |
value | Offbrand compatible class stored within the obmap at a position denoted by key |
- Returns
- An instance of class obmap_pair
- Warning
- All public constructors should call this constructor and intialize individual members as needed, so that all base data is initialized properly.
Generates an offset from the hash value to rectify collisions.
- Parameters
-
prev_offset | Last offset provided (0 if initiating call for the first time) |
- Returns
- New offset to the next possible location to insert within table
Replaces existing value in an obmap_pair with the supplied value.
- Parameters
-
mp | An instance of obmap_pair |
value | The new value to replace the existing value |
const uint32_t MAP_CAPACITIES[] |
Map capacity table, where capacities are the nearest prime numbers less than powers of 2.
const double MAX_LOAD_FACTOR |
Maximum load factor of an obmap before the map will be resized.
const uint32_t NUM_CAPACITIES |
Number of elements in the map capacity table.