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

SSD::NodeAssignments Class Reference

a reference counting list carrying two Node* as data this is a reference counting list since we are not going to use it a true list, but it can grow into different directions. The real structure will look like a tree, but with the children pointing to its parents. More...

#include <diff.h>

Collaboration diagram for SSD::NodeAssignments:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NodeAssignments (Node *nn1, Node *nn2, NodeAssignments *nnext)
 make a new list element
bool release ()
 release and return if needed to be destroyed
 ~NodeAssignments ()
 destructor

Public Attributes

Noden1
 data: node in first document
Noden2
 data: node in second document
NodeAssignmentsnext
 linked list structure
int refcount
 reference counting for destruction

Detailed Description

a reference counting list carrying two Node* as data this is a reference counting list since we are not going to use it a true list, but it can grow into different directions. The real structure will look like a tree, but with the children pointing to its parents.

Once a leaf is closed it will be "destroyed", in turn collapsing parents if their refcount reaches zero.

if you want to keep a child, increase the refcount, if you do not need it any more, use 'if (na->release()) delete(na);' so it is correctly destroyed.

Definition at line 57 of file diff.h.


Constructor & Destructor Documentation

SSD::NodeAssignments::NodeAssignments Node nn1,
Node nn2,
NodeAssignments nnext
 

make a new list element

this will set the new elements refcount to 1 and increase the parents

Parameters:
nn1 first data part, a node from first document
nn2 second data part, a node from the second document
nnext parent list element

Definition at line 307 of file diff.cc.

References next, and refcount.

SSD::NodeAssignments::~NodeAssignments  ) 
 

destructor

Definition at line 316 of file diff.cc.

References next, and release().

Here is the call graph for this function:


Member Function Documentation

bool SSD::NodeAssignments::release  ) 
 

release and return if needed to be destroyed

Returns:
true when the object should be deleted now

Definition at line 312 of file diff.cc.

References refcount.

Referenced by SSD::DiffDijkstraState::~DiffDijkstraState(), and ~NodeAssignments().


Member Data Documentation

Node* SSD::NodeAssignments::n1
 

data: node in first document

Definition at line 60 of file diff.h.

Referenced by SSD::DiffDijkstraState::findNodeAssignment1(), and SSD::DiffDijkstra::step().

Node* SSD::NodeAssignments::n2
 

data: node in second document

Definition at line 62 of file diff.h.

Referenced by SSD::DiffDijkstraState::findNodeAssignment2(), SSD::process_relations(), and SSD::DiffDijkstra::step().

NodeAssignments* SSD::NodeAssignments::next
 

linked list structure

Definition at line 64 of file diff.h.

Referenced by SSD::DiffDijkstraState::findNodeAssignment1(), SSD::DiffDijkstraState::findNodeAssignment2(), NodeAssignments(), SSD::XUpdateWriter::run(), SSD::MergedWriter::run(), SSD::MarkedWriter::run(), and ~NodeAssignments().

int SSD::NodeAssignments::refcount
 

reference counting for destruction

Definition at line 66 of file diff.h.

Referenced by NodeAssignments(), and release().


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