|
bpp-core
2.1.0
|
Simple implementation of TNode. More...
#include <Bpp/Graph/BasicTNode.h>
Inheritance diagram for bpp::BasicTNode:
Collaboration diagram for bpp::BasicTNode:Public Member Functions | |
| BasicTNode () | |
| Simple constructor. | |
| virtual | ~BasicTNode () |
| Destructor. | |
| BasicTNode (const BasicTNode &node) | |
| Copy constructor. | |
| BasicTNode & | operator= (const BasicTNode &node) |
| Assignation operator. | |
| BasicTNode * | clone () const |
| Create a copy of this object and send a pointer to it. | |
| const BasicTNode * | getNeighbor (int pos) const |
| BasicTNode * | getNeighbor (int pos) |
| int | degree () const |
| Get the degree i.e. the number of neighbors of this node. | |
| const BasicTNode * | operator[] (int i) const |
| Direct access to a neighbor in const context. | |
| BasicTNode * | operator[] (int i) |
| Direct access to a neighbor. | |
| bool | hasFather () const |
| Tell if the node has a father. | |
| bool | hasFathers () const |
| Tell if this node has one or more father nodes. | |
| int | getNumberOfFathers () const |
| Give the number of father nodes for this node. | |
| const BasicTNode * | getFather (int pos) const |
| Get a particular father in const environment. | |
| BasicTNode * | getFather (int pos) |
| Get a particular father. | |
| const BasicTNode * | getFather () const |
| Get the father in const environment. | |
| BasicTNode * | getFather () |
| Get the father. | |
| virtual bool | isFather (const BasicTNode *node) const |
| Tell if the node is a father of this node. | |
| virtual void | addFather (BasicTNode *node) |
| Add a father to this node. | |
| virtual BasicTNode * | removeFather () |
| Remove the father of this node. | |
| bool | hasSons () const |
| Tell if this node has one or more son nodes. | |
| int | getNumberOfSons () const |
| Give the number of son nodes for this node. | |
| const BasicTNode * | getSon (int pos) const |
| Get a particular son in const environment. | |
| BasicTNode * | getSon (int pos) |
| Get a particular son. | |
| virtual bool | isSon (const BasicTNode *node) const |
| Tell if a node is son of this node. | |
| virtual void | addSon (BasicTNode *node) |
| Add a son to this node. | |
| virtual void | removeSon (BasicTNode *son) |
| Remove a son of this node. | |
| virtual BasicTNode * | removeSon (int pos) |
| Remove a son of this node. | |
Private Attributes | |
| std::vector< BasicTNode * > | sons_ |
| BasicTNode * | father_ |
Simple implementation of TNode.
Contains only methods for node manipulation.
Definition at line 54 of file BasicTNode.h.
| bpp::BasicTNode::BasicTNode | ( | ) | [inline] |
| BasicTNode::~BasicTNode | ( | ) | [virtual] |
Destructor.
When destroyed, the node remove himself as son of its father and as father of its sons.
Definition at line 44 of file BasicTNode.cpp.
References father_, removeSon(), and sons_.
| BasicTNode::BasicTNode | ( | const BasicTNode & | node | ) |
Copy constructor.
Definition at line 53 of file BasicTNode.cpp.
| void BasicTNode::addFather | ( | BasicTNode * | node | ) | [virtual] |
Add a father to this node.
Definition at line 132 of file BasicTNode.cpp.
References addSon(), father_, isFather(), and isSon().
Referenced by addSon().
| void BasicTNode::addSon | ( | BasicTNode * | node | ) | [virtual] |
Add a son to this node.
Definition at line 177 of file BasicTNode.cpp.
References addFather(), isFather(), isSon(), and sons_.
Referenced by addFather().
| BasicTNode* bpp::BasicTNode::clone | ( | ) | const [inline, virtual] |
Create a copy of this object and send a pointer to it.
Implements bpp::TNode.
Definition at line 83 of file BasicTNode.h.
References BasicTNode().
| int bpp::BasicTNode::degree | ( | ) | const [inline, virtual] |
Get the degree i.e. the number of neighbors of this node.
Implements bpp::UNode.
Definition at line 92 of file BasicTNode.h.
| const BasicTNode * BasicTNode::getFather | ( | int | pos | ) | const [virtual] |
Get a particular father in const environment.
Implements bpp::TNode.
Definition at line 104 of file BasicTNode.cpp.
References getFather().
| BasicTNode * BasicTNode::getFather | ( | int | pos | ) | [virtual] |
Get a particular father.
Implements bpp::TNode.
Definition at line 111 of file BasicTNode.cpp.
References getFather().
| const BasicTNode * BasicTNode::getFather | ( | ) | const [virtual] |
Get the father in const environment.
Implements bpp::TNode.
Definition at line 118 of file BasicTNode.cpp.
References father_.
Referenced by getFather().
| BasicTNode * BasicTNode::getFather | ( | ) | [virtual] |
Get the father.
Implements bpp::TNode.
Definition at line 122 of file BasicTNode.cpp.
References father_.
| const BasicTNode * BasicTNode::getNeighbor | ( | int | pos | ) | const [virtual] |
Get a neighbor of this node in const context.
| pos | the position of the neighbor to get. |
Implements bpp::TNode.
Definition at line 66 of file BasicTNode.cpp.
| BasicTNode * BasicTNode::getNeighbor | ( | int | pos | ) | [virtual] |
Get a neighbor of this node.
| pos | the position of the neighbor to get. |
Implements bpp::TNode.
Definition at line 76 of file BasicTNode.cpp.
| int bpp::BasicTNode::getNumberOfFathers | ( | ) | const [inline, virtual] |
Give the number of father nodes for this node.
Implements bpp::ONode.
Definition at line 104 of file BasicTNode.h.
References father_.
| int bpp::BasicTNode::getNumberOfSons | ( | ) | const [inline, virtual] |
Give the number of son nodes for this node.
Implements bpp::ONode.
Definition at line 131 of file BasicTNode.h.
References sons_.
| const BasicTNode * BasicTNode::getSon | ( | int | pos | ) | const [virtual] |
Get a particular son in const environment.
Implements bpp::TNode.
Definition at line 155 of file BasicTNode.cpp.
References sons_.
| BasicTNode * BasicTNode::getSon | ( | int | pos | ) | [virtual] |
Get a particular son.
Implements bpp::TNode.
Definition at line 162 of file BasicTNode.cpp.
References sons_.
| bool bpp::BasicTNode::hasFather | ( | ) | const [inline] |
| bool bpp::BasicTNode::hasFathers | ( | ) | const [inline, virtual] |
Tell if this node has one or more father nodes.
Implements bpp::ONode.
Definition at line 103 of file BasicTNode.h.
References father_.
Referenced by removeFather().
| bool bpp::BasicTNode::hasSons | ( | ) | const [inline, virtual] |
Tell if this node has one or more son nodes.
Implements bpp::ONode.
Definition at line 130 of file BasicTNode.h.
References sons_.
| bool BasicTNode::isFather | ( | const BasicTNode * | node | ) | const [virtual] |
Tell if the node is a father of this node.
Definition at line 126 of file BasicTNode.cpp.
References father_.
Referenced by addFather(), and addSon().
| bool BasicTNode::isSon | ( | const BasicTNode * | node | ) | const [virtual] |
Tell if a node is son of this node.
Definition at line 169 of file BasicTNode.cpp.
References sons_.
Referenced by addFather(), and addSon().
| BasicTNode & BasicTNode::operator= | ( | const BasicTNode & | node | ) |
| const BasicTNode * BasicTNode::operator[] | ( | int | i | ) | const [virtual] |
Direct access to a neighbor in const context.
No check is done, you have to ensure that you query an existing neighbor.
| i | the position of the neighbor |
Implements bpp::TNode.
Definition at line 86 of file BasicTNode.cpp.
| BasicTNode * BasicTNode::operator[] | ( | int | i | ) | [virtual] |
Direct access to a neighbor.
No check is done, you have to ensure that you query an existing neighbor.
| i | the position of the neighbor |
Implements bpp::TNode.
Definition at line 94 of file BasicTNode.cpp.
| BasicTNode * BasicTNode::removeFather | ( | ) | [virtual] |
Remove the father of this node.
Definition at line 143 of file BasicTNode.cpp.
References father_, hasFathers(), and removeSon().
Referenced by removeSon().
| void BasicTNode::removeSon | ( | BasicTNode * | son | ) | [virtual] |
Remove a son of this node.
Definition at line 186 of file BasicTNode.cpp.
References removeFather(), and sons_.
Referenced by removeFather(), and ~BasicTNode().
| BasicTNode * BasicTNode::removeSon | ( | int | pos | ) | [virtual] |
Remove a son of this node.
Definition at line 197 of file BasicTNode.cpp.
References sons_.
BasicTNode* bpp::BasicTNode::father_ [private] |
Definition at line 57 of file BasicTNode.h.
Referenced by addFather(), degree(), getFather(), getNeighbor(), getNumberOfFathers(), hasFather(), hasFathers(), isFather(), operator=(), operator[](), removeFather(), and ~BasicTNode().
std::vector< BasicTNode * > bpp::BasicTNode::sons_ [private] |
Definition at line 56 of file BasicTNode.h.
Referenced by addSon(), degree(), getNeighbor(), getNumberOfSons(), getSon(), hasSons(), isSon(), operator=(), operator[](), removeSon(), and ~BasicTNode().