bpp-core  2.2.0
bpp::TNode Class Referenceabstract

Tree Node interface. More...

#include <Bpp/Graph/TNode.h>

+ Inheritance diagram for bpp::TNode:
+ Collaboration diagram for bpp::TNode:

Public Member Functions

Neighbors
virtual const TNodegetNeighbor (int pos) const =0
 Get a neighbor of this node in const context. More...
 
virtual TNodegetNeighbor (int pos)=0
 Get a neighbor of this node. More...
 
The Clonable interface.
TNodeclone () const =0
 Create a copy of this object and send a pointer to it. More...
 
Fathers
virtual const TNodegetFather (int pos) const =0
 Get a particular father in const environment. More...
 
virtual TNodegetFather (int pos)=0
 Get a particular father. More...
 
virtual const TNodegetFather () const =0
 Get the father in const environment. More...
 
virtual TNodegetFather ()=0
 Get the father. More...
 
Sons
virtual const TNodegetSon (int pos) const =0
 Get a particular son in const environment. More...
 
virtual TNodegetSon (int pos)=0
 Get a particular son. More...
 
Operators
virtual const TNodeoperator[] (int i) const =0
 Direct access to a neighbor in const context. More...
 
virtual TNodeoperator[] (int i)=0
 Direct access to a neighbor. More...
 
Fathers
virtual bool hasFathers () const =0
 Tell if this node has one or more father nodes. More...
 
virtual int getNumberOfFathers () const =0
 Give the number of father nodes for this node. More...
 
Sons
virtual bool hasSons () const =0
 Tell if this node has one or more son nodes. More...
 
virtual int getNumberOfSons () const =0
 Give the number of son nodes for this node. More...
 
Neighbors
virtual int degree () const =0
 Get the degree i.e. the number of neighbors of this node. More...
 

Detailed Description

Tree Node interface.

TNode is an interface for tree nodes (i.e. oriented nodes with only one father). It is aimed to build trees.

Author
Sylvain Gaillard

Definition at line 54 of file TNode.h.

Member Function Documentation

◆ clone()

TNode* bpp::TNode::clone ( ) const
pure virtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ degree()

virtual int bpp::UNode::degree ( ) const
pure virtualinherited

Get the degree i.e. the number of neighbors of this node.

Implemented in bpp::BasicTNode.

◆ getFather() [1/4]

virtual const TNode* bpp::TNode::getFather ( int  pos) const
pure virtual

Get a particular father in const environment.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ getFather() [2/4]

virtual TNode* bpp::TNode::getFather ( int  pos)
pure virtual

Get a particular father.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ getFather() [3/4]

virtual const TNode* bpp::TNode::getFather ( ) const
pure virtual

Get the father in const environment.

Implemented in bpp::BasicTNode.

◆ getFather() [4/4]

virtual TNode* bpp::TNode::getFather ( )
pure virtual

Get the father.

Implemented in bpp::BasicTNode.

◆ getNeighbor() [1/2]

virtual const TNode* bpp::TNode::getNeighbor ( int  pos) const
pure virtual

Get a neighbor of this node in const context.

Parameters
posthe position of the neighbor to get.
Returns
A pointer toward the neighbor node.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ getNeighbor() [2/2]

virtual TNode* bpp::TNode::getNeighbor ( int  pos)
pure virtual

Get a neighbor of this node.

Parameters
posthe position of the neighbor to get.
Returns
A pointer toward the neighbor node.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ getNumberOfFathers()

virtual int bpp::ONode::getNumberOfFathers ( ) const
pure virtualinherited

Give the number of father nodes for this node.

Implemented in bpp::BasicTNode.

◆ getNumberOfSons()

virtual int bpp::ONode::getNumberOfSons ( ) const
pure virtualinherited

Give the number of son nodes for this node.

Implemented in bpp::BasicTNode.

◆ getSon() [1/2]

virtual const TNode* bpp::TNode::getSon ( int  pos) const
pure virtual

Get a particular son in const environment.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ getSon() [2/2]

virtual TNode* bpp::TNode::getSon ( int  pos)
pure virtual

Get a particular son.

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ hasFathers()

virtual bool bpp::ONode::hasFathers ( ) const
pure virtualinherited

Tell if this node has one or more father nodes.

Implemented in bpp::BasicTNode.

◆ hasSons()

virtual bool bpp::ONode::hasSons ( ) const
pure virtualinherited

Tell if this node has one or more son nodes.

Implemented in bpp::BasicTNode.

◆ operator[]() [1/2]

virtual const TNode* bpp::TNode::operator[] ( int  i) const
pure virtual

Direct access to a neighbor in const context.

  • a positive i gives access to sons (from 0 to n - 1)
  • a negative i gives access to fathers (from 1 to m)

No check is done, you have to ensure that you query an existing neighbor.

Parameters
ithe position of the neighbor
Returns
A pointer toward the neighbor

Implements bpp::ONode.

Implemented in bpp::BasicTNode.

◆ operator[]() [2/2]

virtual TNode* bpp::TNode::operator[] ( int  i)
pure virtual

Direct access to a neighbor.

  • a positive i gives access to sons (from 0 to n - 1)
  • a negative i gives access to fathers (from 1 to m)

No check is done, you have to ensure that you query an existing neighbor.

Parameters
ithe position of the neighbor
Returns
A pointer toward the neighbor

Implements bpp::ONode.

Implemented in bpp::BasicTNode.


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