countingNodeHash Class Reference

Hastable like nodeHash with the additional feature of scanning through all elements. More...

#include <disassemblerhashes.h>

Collaboration diagram for countingNodeHash:

Collaboration graph
[legend]

List of all members.

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_cnextScan (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
hashNodelinkStart
 pointer to the inverse linked list of all added elements
hashNodescanPtr
 current scan position
bool scanActive
 is there a scan active?


Detailed Description

Hastable like nodeHash with the additional feature of scanning through all elements.

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


Constructor & Destructor Documentation

countingNodeHash::countingNodeHash ( void   ) 

countingNodeHash::~countingNodeHash ( void   ) 

References clear(), and tab.

countingNodeHash::countingNodeHash ( const countingNodeHash  )  [private]


Member Function Documentation

void countingNodeHash::clear ( void   ) 

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]


Member Data Documentation

pointer to the inverse linked list of all added elements

Referenced by clear(), countingNodeHash(), initScan(), and insert().

is there a scan active?

Referenced by countingNodeHash(), initScan(), and nextScan().

current scan position

Referenced by countingNodeHash(), initScan(), and nextScan().

the hash table

Referenced by clear(), countingNodeHash(), insert(), and ~countingNodeHash().

unsigned long countingNodeHash::tab_entries [private]

current number of entries

Referenced by clear(), countingNodeHash(), and insert().

unsigned long countingNodeHash::tab_size [private]

current table size

Referenced by clear(), countingNodeHash(), and insert().


The documentation for this class was generated from the following files:

Generated on Sun Oct 10 10:02:44 2010 for BurrTools by  doxygen 1.5.8