class CBNSLink

The Link data structure is used primarily to store the relation between the two nodes

Public Fields

static int m_nCounter
The variable is used to check for the memory leaks in the program
static int m_nID
Is a unique identifier for the link and is used to remove duplicates

Public Methods

virtual void Copy (CBNSLink& cLink)
This function can be used to copy the contents from cLink

Public

Constructors and Destructor
CBNSLink ()
Default Constructor
CBNSLink (CBNSNode* pParentNode, CBNSNode* pChildNode, bool bIsDirected = true)
Constructor with three parameters
virtual ~CBNSLink ()
Destructor
Out Functions
string GetLabel ()
Returns the Label of the Link
CBNSNode* GetParent ()
Returns the pointer to the parent node
CBNSNode* GetChild ()
Returns the pointer to the child node
In Functions
void SetDirected (bool bDirected)
Sets the link to bDirected
void SetLabel (string sLabel)
Sets the label of the link to sLabel
void SetParent (CBNSNode* pParentNode)
Sets the parent node of the link to pParentNode
void SetChild ( CBNSNode* pChildNode)
Sets the child node of the link to pChildNode
Other Utility Functions
bool IsDirected ()
Returns true if the link is directed
bool IsConnected (CBNSNode* pNode)
Returns true if pNode is either a parent node or a child node
bool IsParent (CBNSNode* pNode)
Returns true if pNode is a parent node
bool IsChild (CBNSNode* pNode)
Returns true if pNode is a child node
void PrintLink ()
Prints the information of the link to the console
Overloaded Operators
void operator= (CBNSLink & cLink)
Assignment Operator
bool operator== (CBNSLink & cLink)
Comparison Operator
bool operator > (CBNSLink & cLink)
Greater than Operator
bool operator < (CBNSLink & cLink)
Less than Operator
Friend Functions
friend ostream& operator<< (ostream & stream, CBNSLink& cLink)
Stream insertion operator
friend void PrintLinkSet (const CBNSSet<CBNSLink*> linkSet)
Prints the contents in the linkSet

Private


bool m_bDirected
This variable is true if the link is directed
string m_sLabel
Label for the link
CBNSNode* m_pcParentNode
Pointer to the parent node
CBNSNode* m_pcChildNode
Pointer to the child node

Documentation

The Link data structure is used primarily to store the relation between the two nodes. A Link can be either directed or undirected. Undirected links are not handled in this implementation. A directed link has a "from node" (also called as the parent node) and a "to node" (also called as the child node).
static int m_nCounter
The variable is used to check for the memory leaks in the program

static int m_nID
Is a unique identifier for the link and is used to remove duplicates

Constructors and Destructor

CBNSLink()
Default Constructor

CBNSLink(CBNSNode* pParentNode, CBNSNode* pChildNode, bool bIsDirected = true)
Constructor with three parameters
Parameters:
pParentNode - a pointer to the parent node
pChildNode - a pointer to the child node
bIsDirected - is true if the link is directed

virtual ~CBNSLink()
Destructor

virtual void Copy(CBNSLink& cLink)
This function can be used to copy the contents from cLink
Parameters:
cLink - a reference to CBNSLink object

Out Functions

string GetLabel()
Returns the Label of the Link
Returns:
string

CBNSNode* GetParent()
Returns the pointer to the parent node
Returns:
CBNSNode*

CBNSNode* GetChild()
Returns the pointer to the child node
Returns:
CBNSNode*

In Functions

void SetDirected(bool bDirected)
Sets the link to bDirected
Parameters:
bDirected - is true if the link is directed

void SetLabel(string sLabel)
Sets the label of the link to sLabel
Parameters:
sLabel - label for the link

void SetParent(CBNSNode* pParentNode)
Sets the parent node of the link to pParentNode
Parameters:
pParentNode - a pointer to CBNSNode

void SetChild( CBNSNode* pChildNode)
Sets the child node of the link to pChildNode
Parameters:
pChildNode - a pointer to CBNSNode

Other Utility Functions

bool IsDirected()
Returns true if the link is directed
Returns:
bool

bool IsConnected(CBNSNode* pNode)
Returns true if pNode is either a parent node or a child node
Returns:
bool

bool IsParent(CBNSNode* pNode)
Returns true if pNode is a parent node
Returns:
bool

bool IsChild(CBNSNode* pNode)
Returns true if pNode is a child node
Returns:
bool

void PrintLink()
Prints the information of the link to the console

Overloaded Operators

void operator=(CBNSLink & cLink)
Assignment Operator
Parameters:
cLink - a reference to CBNSLink object

bool operator==(CBNSLink & cLink)
Comparison Operator
Parameters:
cLink - a reference to CBNSLink object

bool operator >(CBNSLink & cLink)
Greater than Operator
Parameters:
cLink - a reference to CBNSLink object

bool operator <(CBNSLink & cLink)
Less than Operator
Parameters:
cLink - a reference to CBNSLink object

Friend Functions

friend ostream& operator<<(ostream & stream, CBNSLink& cLink)
Stream insertion operator
Returns:
ostream
Parameters:
stream - a reference to ostream object
cLink - a reference to CBNSLink object

friend void PrintLinkSet(const CBNSSet<CBNSLink*> linkSet)
Prints the contents in the linkSet
Parameters:
linkSet - set of links

bool m_bDirected
This variable is true if the link is directed

string m_sLabel
Label for the link

CBNSNode* m_pcParentNode
Pointer to the parent node

CBNSNode* m_pcChildNode
Pointer to the child node


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de