ARB
PRD_Node.cxx
Go to the documentation of this file.
1 #include "PRD_Node.hxx"
2 
3 using namespace std;
4 
5 //
6 // Constructors
7 //
8 void Node::init (Node* parent_, char base_, PRD_Sequence_Pos last_index_, PRD_Sequence_Pos offset_) {
9  parent = parent_;
10  child[0] = NULp;
11  child[1] = NULp;
12  child[2] = NULp;
13  child[3] = NULp;
14  base = base_;
15  last_base_index = last_index_;
16  child_bits = 0;
17  offset = offset_;
18 }
19 
20 Node::Node (Node* parent_, char base_, PRD_Sequence_Pos last_index_, PRD_Sequence_Pos offset_) {
21  init (parent_, base_, last_index_, offset_);
22 }
23 
24 Node::Node (Node* parent_, char base_, PRD_Sequence_Pos last_index_) {
25  init (parent_, base_, last_index_, 0);
26 }
27 
28 Node::Node (Node* parent_, char base_) {
29  init (parent_, base_, 0, 0);
30 }
31 
33  init (NULp, ' ', 0, 0);
34 }
35 
36 
37 //
38 // Destructor
39 //
41  if (child[0]) delete child[0];
42  if (child[1]) delete child[1];
43  if (child[2]) delete child[2];
44  if (child[3]) delete child[3];
45 }
46 
47 
48 //
49 // print
50 //
51 // recursively print Node and its children
52 //
53 void Node::print () {
54  printf ("[%c,%li,%li,%u (", base, last_base_index, offset, child_bits);
55  if (child[0]) { child[0]->print(); printf(","); }
56  if (child[1]) { child[1]->print(); printf(","); }
57  if (child[2]) { child[2]->print(); printf(","); }
58  if (child[3]) { child[3]->print(); }
59  printf(")]");
60 }
Definition: PRD_Node.hxx:9
Node()
Definition: PRD_Node.cxx:32
STL namespace.
void print()
Definition: PRD_Node.cxx:53
~Node()
Definition: PRD_Node.cxx:40
static ARB_init_perl_interface init
Definition: ARB_ext.c:101
#define NULp
Definition: cxxforward.h:116
#define offset(field)
Definition: GLwDrawA.c:73
long int PRD_Sequence_Pos
Definition: PRD_Globals.hxx:21