#include <disassemblerhashes.h>
Classes | |
struct | hashNode |
hash node data structur More... | |
Public Member Functions | |
countingNodeHash (void) | |
~countingNodeHash (void) | |
void | clear (void) |
delete all nodes and empty table for new usage | |
bool | insert (disassemblerNode_c *n) |
add a new node. | |
void | initScan (void) |
initialize a new scan. | |
const disassemblerNode_c * | nextScan (void) |
return next disassembler node of the current scan. | |
Private Member Functions | |
countingNodeHash (const countingNodeHash &) | |
void | operator= (const countingNodeHash &) |
Private Attributes | |
unsigned long | tab_size |
current table size | |
unsigned long | tab_entries |
current number of entries | |
hashNode ** | tab |
the hash table | |
hashNode * | linkStart |
pointer to the inverse linked list of all added elements | |
hashNode * | scanPtr |
current scan position | |
bool | scanActive |
is there a scan active? |
this is a hashtable that stores nodes but is also alows traversal of all nodes hat are within the table at a given point in time, only one such traversal can be active at one time and the nodes are scanned in the reverse order they were added
countingNodeHash::countingNodeHash | ( | void | ) |
References linkStart, scanActive, scanPtr, tab, tab_entries, and tab_size.
countingNodeHash::countingNodeHash | ( | const countingNodeHash & | ) | [private] |
void countingNodeHash::clear | ( | void | ) |
delete all nodes and empty table for new usage
References countingNodeHash::countingNodeHash::hashNode::dat, disassemblerNode_c::decRefCount(), countingNodeHash::countingNodeHash::hashNode::link, linkStart, tab, tab_entries, and tab_size.
Referenced by movementAnalysator_c::find(), and ~countingNodeHash().
void countingNodeHash::initScan | ( | void | ) |
initialize a new scan.
You can only do that one the currently active scan is over
References bt_assert, linkStart, scanActive, and scanPtr.
Referenced by movementAnalysator_c::find().
bool countingNodeHash::insert | ( | disassemblerNode_c * | n | ) |
add a new node.
Returns true, if the given node has already been in the table and nothing has changed false if the node is inserted
References countingNodeHash::countingNodeHash::hashNode::dat, disassemblerNode_c::hash(), disassemblerNode_c::incRefCount(), countingNodeHash::countingNodeHash::hashNode::link, linkStart, countingNodeHash::countingNodeHash::hashNode::next, tab, tab_entries, and tab_size.
Referenced by movementAnalysator_c::find().
const disassemblerNode_c * countingNodeHash::nextScan | ( | void | ) |
return next disassembler node of the current scan.
The nodes are returned one after the other in reverse order. Once the last node has been returned you will get NULL. Then you must not call this function any mode. You may then start a new scan with initScan
References bt_assert, countingNodeHash::countingNodeHash::hashNode::dat, countingNodeHash::countingNodeHash::hashNode::link, scanActive, and scanPtr.
Referenced by movementAnalysator_c::find().
void countingNodeHash::operator= | ( | const countingNodeHash & | ) | [private] |
hashNode* countingNodeHash::linkStart [private] |
pointer to the inverse linked list of all added elements
Referenced by clear(), countingNodeHash(), initScan(), and insert().
bool countingNodeHash::scanActive [private] |
hashNode* countingNodeHash::scanPtr [private] |
hashNode** countingNodeHash::tab [private] |
unsigned long countingNodeHash::tab_entries [private] |
unsigned long countingNodeHash::tab_size [private] |