SNAP Library 3.0, User Reference  2016-07-20 17:56:49
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TPredicateNode Class Reference

Predicate node - represents a binary predicate operation on two predicate nodes. More...

#include <table.h>

Public Member Functions

 TPredicateNode ()
 Default constructor. More...
 
 TPredicateNode (const TAtomicPredicate &A)
 Constructor for atomic predicate node (leaf) More...
 
 TPredicateNode (TPredOp Opr)
 Constructor for logical operation predicate node (internal node) More...
 
 TPredicateNode (const TPredicateNode &P)
 Copy constructor. More...
 
void AddLeftChild (TPredicateNode *Child)
 Add left child to this node. More...
 
void AddRightChild (TPredicateNode *Child)
 Add right child to this node. More...
 
void GetVariables (TStrV &Variables)
 Get variables in the predicate tree rooted at this node. More...
 

Public Attributes

TPredOp Op
 Logical op represented by this node. More...
 
TBool Result
 Result of evaulating the predicate rooted at this node. More...
 
TAtomicPredicate Atom
 Atomic predicate at this node. More...
 
TPredicateNodeParent
 Parent node of this node. More...
 
TPredicateNodeLeft
 Left child of this node. More...
 
TPredicateNodeRight
 

Friends

class TPredicate
 

Detailed Description

Predicate node - represents a binary predicate operation on two predicate nodes.

Definition at line 51 of file table.h.

Constructor & Destructor Documentation

TPredicateNode::TPredicateNode ( )
inline

Default constructor.

Definition at line 60 of file table.h.

60  : Op(NOP), Result(false), Atom(), Parent(NULL), Left(NULL),
61  Right(NULL) {}
TPredicateNode * Left
Left child of this node.
Definition: table.h:57
TBool Result
Result of evaulating the predicate rooted at this node.
Definition: table.h:54
TPredicateNode * Right
Definition: table.h:58
TPredOp Op
Logical op represented by this node.
Definition: table.h:53
Definition: table.h:5
TPredicateNode * Parent
Parent node of this node.
Definition: table.h:56
TAtomicPredicate Atom
Atomic predicate at this node.
Definition: table.h:55
TPredicateNode::TPredicateNode ( const TAtomicPredicate A)
inline

Constructor for atomic predicate node (leaf)

Definition at line 63 of file table.h.

63  : Op(NOP), Result(false), Atom(A),
64  Parent(NULL), Left(NULL), Right(NULL) {}
TPredicateNode * Left
Left child of this node.
Definition: table.h:57
TBool Result
Result of evaulating the predicate rooted at this node.
Definition: table.h:54
TPredicateNode * Right
Definition: table.h:58
TPredOp Op
Logical op represented by this node.
Definition: table.h:53
Definition: table.h:5
TPredicateNode * Parent
Parent node of this node.
Definition: table.h:56
TAtomicPredicate Atom
Atomic predicate at this node.
Definition: table.h:55
TPredicateNode::TPredicateNode ( TPredOp  Opr)
inline

Constructor for logical operation predicate node (internal node)

Definition at line 66 of file table.h.

66  : Op(Opr), Result(false), Atom(), Parent(NULL),
67  Left(NULL), Right(NULL) {}
TPredicateNode * Left
Left child of this node.
Definition: table.h:57
TBool Result
Result of evaulating the predicate rooted at this node.
Definition: table.h:54
TPredicateNode * Right
Definition: table.h:58
TPredOp Op
Logical op represented by this node.
Definition: table.h:53
TPredicateNode * Parent
Parent node of this node.
Definition: table.h:56
TAtomicPredicate Atom
Atomic predicate at this node.
Definition: table.h:55
TPredicateNode::TPredicateNode ( const TPredicateNode P)
inline

Copy constructor.

Definition at line 69 of file table.h.

69  : Op(P.Op), Result(P.Result), Atom(P.Atom),
70  Parent(P.Parent), Left(P.Left), Right(P.Right) {}
TPredicateNode * Left
Left child of this node.
Definition: table.h:57
TBool Result
Result of evaulating the predicate rooted at this node.
Definition: table.h:54
TPredicateNode * Right
Definition: table.h:58
TPredOp Op
Logical op represented by this node.
Definition: table.h:53
TPredicateNode * Parent
Parent node of this node.
Definition: table.h:56
TAtomicPredicate Atom
Atomic predicate at this node.
Definition: table.h:55

Member Function Documentation

void TPredicateNode::AddLeftChild ( TPredicateNode Child)
inline

Add left child to this node.

Definition at line 72 of file table.h.

72 { Left = Child; Child->Parent = this; }
TPredicateNode * Left
Left child of this node.
Definition: table.h:57
TPredicateNode * Parent
Parent node of this node.
Definition: table.h:56
void TPredicateNode::AddRightChild ( TPredicateNode Child)
inline

Add right child to this node.

Definition at line 74 of file table.h.

74 { Right = Child; Child->Parent = this; }
TPredicateNode * Right
Definition: table.h:58
TPredicateNode * Parent
Parent node of this node.
Definition: table.h:56
void TPredicateNode::GetVariables ( TStrV Variables)

Get variables in the predicate tree rooted at this node.

Definition at line 1 of file table.cpp.

1  {
2  if (Left != NULL) { Left->GetVariables(Variables); }
3  if (Right != NULL) { Right->GetVariables(Variables); }
4  if (Op == NOP) {
5  if (Atom.Lvar != "" ) { Variables.Add(Atom.Lvar); }
6  if (Atom.Rvar != "" ) { Variables.Add(Atom.Rvar); }
7  }
8 }
TStr Rvar
Right variable of the comparison op.
Definition: table.h:21
TPredicateNode * Left
Left child of this node.
Definition: table.h:57
TStr Lvar
Left variable of the comparison op.
Definition: table.h:20
TPredicateNode * Right
Definition: table.h:58
TPredOp Op
Logical op represented by this node.
Definition: table.h:53
void GetVariables(TStrV &Variables)
Get variables in the predicate tree rooted at this node.
Definition: table.cpp:1
Definition: table.h:5
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
TAtomicPredicate Atom
Atomic predicate at this node.
Definition: table.h:55

Friends And Related Function Documentation

friend class TPredicate
friend

Definition at line 77 of file table.h.

Member Data Documentation

TAtomicPredicate TPredicateNode::Atom

Atomic predicate at this node.

Definition at line 55 of file table.h.

TPredicateNode* TPredicateNode::Left

Left child of this node.

Definition at line 57 of file table.h.

TPredOp TPredicateNode::Op

Logical op represented by this node.

Definition at line 53 of file table.h.

TPredicateNode* TPredicateNode::Parent

Parent node of this node.

Definition at line 56 of file table.h.

TBool TPredicateNode::Result

Result of evaulating the predicate rooted at this node.

Definition at line 54 of file table.h.

TPredicateNode* TPredicateNode::Right

Right child of this node

Definition at line 58 of file table.h.


The documentation for this class was generated from the following files: