MeshKit  1.0
BinaryTree Class Reference

#include <BinaryTree.hpp>

List of all members.

Public Member Functions

 BinaryTree (DualGraph *g)
 ~BinaryTree ()
void setTreeType (int t)
void build (BinaryNode *r=NULL)
BinaryNodegetRoot () const
void removeNode (BinaryNode *node)
void addNode (BinaryNode *tnode)
void unlinkNode (BinaryNode *node)
bool isMatched (const BinaryNode *u, const BinaryNode *v) const
const BNodeListgetLevelNodes (int l) const
int getHeight () const
size_t getSize () const
void clear ()
void deleteAll ()
void relinkAll ()
void saveAs (const string &s)

Static Public Attributes

static const int BREADTH_FIRST_TREE = 0
static const int DEPTH_FIRST_TREE = 1

Private Types

typedef std::map< Vertex
*, BinaryNode * > 
TNodeMap

Private Member Functions

void bfs_traverse (BinaryNode *parent, BNodeList &nextnodes)
void bfs_traverse (BinaryNode *parent)
void dfs_traverse (BinaryNode *parent)
void dfs_traverse (BinaryNode *parent, BNodeList &nextnodes)

Private Attributes

DualGraphdgraph
BinaryNoderoot
BNodeList emptylist
ObjectPool< BinaryNodepool
int treetype
TNodeMap tnodemap
std::map< int, BNodeListlevelnodes

Detailed Description

Definition at line 180 of file BinaryTree.hpp.


Member Typedef Documentation

typedef std::map<Vertex*, BinaryNode*> TNodeMap [private]

Definition at line 272 of file BinaryTree.hpp.


Constructor & Destructor Documentation

BinaryTree ( DualGraph g) [inline]

Definition at line 186 of file BinaryTree.hpp.

~BinaryTree ( ) [inline]

Definition at line 191 of file BinaryTree.hpp.


Member Function Documentation

void addNode ( BinaryNode tnode) [inline]

Definition at line 215 of file BinaryTree.hpp.

void bfs_traverse ( BinaryNode parent,
BNodeList nextnodes 
) [private]

Definition at line 54 of file BinaryTree.cpp.

void bfs_traverse ( BinaryNode parent) [private]

Definition at line 138 of file BinaryTree.cpp.

void build ( BinaryNode r = NULL)

Definition at line 164 of file BinaryTree.cpp.

void clear ( )

Definition at line 17 of file BinaryTree.cpp.

void deleteAll ( )

Definition at line 7 of file BinaryTree.cpp.

void dfs_traverse ( BinaryNode parent) [private]

Definition at line 124 of file BinaryTree.cpp.

void dfs_traverse ( BinaryNode parent,
BNodeList nextnodes 
) [private]

Definition at line 86 of file BinaryTree.cpp.

int getHeight ( ) const

Definition at line 35 of file BinaryTree.cpp.

const BNodeList & getLevelNodes ( int  l) const

Definition at line 152 of file BinaryTree.cpp.

BinaryNode* getRoot ( ) const [inline]

Definition at line 201 of file BinaryTree.hpp.

size_t getSize ( ) const

Definition at line 48 of file BinaryTree.cpp.

bool isMatched ( const BinaryNode u,
const BinaryNode v 
) const [inline]

Definition at line 227 of file BinaryTree.hpp.

void relinkAll ( )

Definition at line 24 of file BinaryTree.cpp.

void removeNode ( BinaryNode node) [inline]

Definition at line 207 of file BinaryTree.hpp.

void saveAs ( const string &  s)

Definition at line 234 of file BinaryTree.cpp.

void setTreeType ( int  t) [inline]

Definition at line 195 of file BinaryTree.hpp.

void unlinkNode ( BinaryNode node) [inline]

Definition at line 219 of file BinaryTree.hpp.


Member Data Documentation

const int BREADTH_FIRST_TREE = 0 [static]

Definition at line 183 of file BinaryTree.hpp.

const int DEPTH_FIRST_TREE = 1 [static]

Definition at line 184 of file BinaryTree.hpp.

DualGraph* dgraph [private]

Definition at line 262 of file BinaryTree.hpp.

BNodeList emptylist [private]

Definition at line 264 of file BinaryTree.hpp.

std::map<int, BNodeList> levelnodes [private]

Definition at line 276 of file BinaryTree.hpp.

Definition at line 265 of file BinaryTree.hpp.

BinaryNode* root [private]

Definition at line 263 of file BinaryTree.hpp.

TNodeMap tnodemap [private]

Definition at line 274 of file BinaryTree.hpp.

int treetype [private]

Definition at line 267 of file BinaryTree.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines