Tree Compression with Top Trees Revisited
Public Member Functions | Public Attributes | Friends | List of all members
TreeNode Struct Reference

A node for an OrderedTree. More...

#include <Nodes.h>

Public Member Functions

 TreeNode ()
 
int numEdges () const
 Get the number of outgoing edges (both valid and invalid) More...
 
bool isLeaf () const
 Check whether the node is a leaf, i.e., has no outgoing edges. More...
 
bool hasOnlyOneChild () const
 
int hasChildren () const
 Check wether the node has outgoing edges (valid or invalid) More...
 
bool hasMoreThanOneChild () const
 Check wether the node has at last two outgoing edges (valid or invalid) More...
 

Public Attributes

int firstEdgeIndex
 
int lastEdgeIndex
 
int parent
 
int lastMergedIn
 
uint hash
 

Friends

std::ostream & operator<< (std::ostream &os, const TreeNode &node)
 

Detailed Description

A node for an OrderedTree.

Node type for use in OrderedTree You can write other nodes that suit your needs

Note that the member functions do not distinguish between valid and invalid edges!

Definition at line 15 of file Nodes.h.

Constructor & Destructor Documentation

TreeNode::TreeNode ( )
inline

Definition at line 22 of file Nodes.h.

Member Function Documentation

int TreeNode::hasChildren ( ) const
inline

Check wether the node has outgoing edges (valid or invalid)

Definition at line 43 of file Nodes.h.

bool TreeNode::hasMoreThanOneChild ( ) const
inline

Check wether the node has at last two outgoing edges (valid or invalid)

Definition at line 48 of file Nodes.h.

bool TreeNode::hasOnlyOneChild ( ) const
inline

Check wether the node has only one child. Does not check edge validity

Returns
true iff the node has exactly one outgoing edge

Definition at line 38 of file Nodes.h.

bool TreeNode::isLeaf ( ) const
inline

Check whether the node is a leaf, i.e., has no outgoing edges.

Definition at line 30 of file Nodes.h.

int TreeNode::numEdges ( ) const
inline

Get the number of outgoing edges (both valid and invalid)

Definition at line 25 of file Nodes.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const TreeNode node 
)
friend

Definition at line 52 of file Nodes.h.

Member Data Documentation

int TreeNode::firstEdgeIndex

Definition at line 16 of file Nodes.h.

uint TreeNode::hash

Definition at line 20 of file Nodes.h.

int TreeNode::lastEdgeIndex

Definition at line 17 of file Nodes.h.

int TreeNode::lastMergedIn

Definition at line 19 of file Nodes.h.

int TreeNode::parent

Definition at line 18 of file Nodes.h.


The documentation for this struct was generated from the following file: