Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

SSD::NodeEqClass Class Reference

Key for a node equality class, and hash function. More...

#include <node_eqclass.h>

Collaboration diagram for SSD::NodeEqClass:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NodeEqClass (Node *n)
 get class for a given node
 NodeEqClass (Node &n)
 get class for a given node
bool operator< (const NodeEqClass r2) const
 ordering needed for sorted maps
bool operator== (const NodeEqClass r2) const
 test equality of two classes
size_t hashfun () const
 hash function for equality classes this uses the string hash function, which supposedly is very efficient, being the pointer of the strings themselves

Public Attributes

ustring label
 node label
ustring content
 node content

Friends

std::ostream & operator<< (std::ostream &out, const SSD::NodeEqClass &cp)
 serialization to output streams

Detailed Description

Key for a node equality class, and hash function.

Calculates the node equality class for a given node, provides an ordering for these classes and a primitive hash function suiteable for indexing.

Definition at line 27 of file node_eqclass.h.


Constructor & Destructor Documentation

SSD::NodeEqClass::NodeEqClass Node n  ) 
 

get class for a given node

Parameters:
n node to calculate the clayss for

Definition at line 16 of file node_eqclass.cc.

SSD::NodeEqClass::NodeEqClass Node n  ) 
 

get class for a given node

Parameters:
n node to calculate the clayss for

Definition at line 19 of file node_eqclass.cc.


Member Function Documentation

size_t SSD::NodeEqClass::hashfun  )  const [inline]
 

hash function for equality classes this uses the string hash function, which supposedly is very efficient, being the pointer of the strings themselves

Returns:
hash value

Definition at line 66 of file node_eqclass.h.

References content, SSD::ustring::hashfun(), and label.

Referenced by SSD::hash_NEqC::operator()().

Here is the call graph for this function:

bool SSD::NodeEqClass::operator< const NodeEqClass  r2  )  const [inline]
 

ordering needed for sorted maps

Since this uses the ustring order, which is a memory order the sequence will vary from run to run. This randomization should give good performance on average, too.

Parameters:
r2 node equality class to compare to
Returns:
comparison result

Definition at line 49 of file node_eqclass.h.

References content, and label.

bool SSD::NodeEqClass::operator== const NodeEqClass  r2  )  const [inline]
 

test equality of two classes

Parameters:
r2 nodeeqclass to compare to
Returns:
comparison result

Definition at line 57 of file node_eqclass.h.

References content, and label.


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  out,
const SSD::NodeEqClass cp
[friend]
 

serialization to output streams

Parameters:
out output stream
cp node equality class to be printed
Returns:
updated stream


Member Data Documentation

ustring SSD::NodeEqClass::content
 

node content

Definition at line 32 of file node_eqclass.h.

Referenced by hashfun(), operator<(), SSD::operator<<(), and operator==().

ustring SSD::NodeEqClass::label
 

node label

Definition at line 30 of file node_eqclass.h.

Referenced by hashfun(), operator<(), SSD::operator<<(), and operator==().


The documentation for this class was generated from the following files:
Generated on Thu Aug 4 17:59:04 2005 for SSDDiff by  doxygen 1.4.3-20050530