|
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. More... | |
| virtual | ~BasicTNode () |
| Destructor. More... | |
| BasicTNode (const BasicTNode &node) | |
| Copy constructor. More... | |
| BasicTNode & | operator= (const BasicTNode &node) |
| Assignation operator. More... | |
| BasicTNode * | clone () const |
| Create a copy of this object and send a pointer to it. More... | |
| const BasicTNode * | getNeighbor (int pos) const |
| Get a neighbor of this node in const context. More... | |
| BasicTNode * | getNeighbor (int pos) |
| Get a neighbor of this node. More... | |
| int | degree () const |
| Get the degree i.e. the number of neighbors of this node. More... | |
| const BasicTNode * | operator[] (int i) const |
| Direct access to a neighbor in const context. More... | |
| BasicTNode * | operator[] (int i) |
| Direct access to a neighbor. More... | |
| bool | hasFather () const |
| Tell if the node has a father. More... | |
| bool | hasFathers () const |
| Tell if this node has one or more father nodes. More... | |
| int | getNumberOfFathers () const |
| Give the number of father nodes for this node. More... | |
| const BasicTNode * | getFather (int pos) const |
| Get a particular father in const environment. More... | |
| BasicTNode * | getFather (int pos) |
| Get a particular father. More... | |
| const BasicTNode * | getFather () const |
| Get the father in const environment. More... | |
| BasicTNode * | getFather () |
| Get the father. More... | |
| virtual bool | isFather (const BasicTNode *node) const |
| Tell if the node is a father of this node. More... | |
| virtual void | addFather (BasicTNode *node) |
| Add a father to this node. More... | |
| virtual BasicTNode * | removeFather () |
| Remove the father of this node. More... | |
| bool | hasSons () const |
| Tell if this node has one or more son nodes. More... | |
| int | getNumberOfSons () const |
| Give the number of son nodes for this node. More... | |
| const BasicTNode * | getSon (int pos) const |
| Get a particular son in const environment. More... | |
| BasicTNode * | getSon (int pos) |
| Get a particular son. More... | |
| virtual bool | isSon (const BasicTNode *node) const |
| Tell if a node is son of this node. More... | |
| virtual void | addSon (BasicTNode *node) |
| Add a son to this node. More... | |
| virtual void | removeSon (BasicTNode *son) |
| Remove a son of this node. More... | |
| virtual BasicTNode * | removeSon (int pos) |
| Remove a son of this node. More... | |
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.
|
inline |
|
virtual |
| BasicTNode::BasicTNode | ( | const BasicTNode & | node | ) |
Copy constructor.
Definition at line 53 of file BasicTNode.cpp.
|
virtual |
Add a father to this node.
Definition at line 132 of file BasicTNode.cpp.
References addSon(), father_, father_, isFather(), and isSon().
Referenced by addSon().
|
virtual |
Add a son to this node.
Definition at line 177 of file BasicTNode.cpp.
References addFather(), isFather(), isSon(), and sons_.
Referenced by addFather().
|
inlinevirtual |
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().
|
inlinevirtual |
Get the degree i.e. the number of neighbors of this node.
Implements bpp::UNode.
Definition at line 92 of file BasicTNode.h.
|
virtual |
Get a particular father in const environment.
Implements bpp::TNode.
Definition at line 104 of file BasicTNode.cpp.
References getFather().
|
virtual |
Get a particular father.
Implements bpp::TNode.
Definition at line 111 of file BasicTNode.cpp.
References getFather().
|
virtual |
Get the father in const environment.
Implements bpp::TNode.
Definition at line 118 of file BasicTNode.cpp.
References father_.
Referenced by getFather(), and getFather().
|
virtual |
Get the father.
Implements bpp::TNode.
Definition at line 122 of file BasicTNode.cpp.
References father_.
|
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.
|
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.
|
inlinevirtual |
Give the number of father nodes for this node.
Implements bpp::ONode.
Definition at line 104 of file BasicTNode.h.
References father_.
|
inlinevirtual |
Give the number of son nodes for this node.
Implements bpp::ONode.
Definition at line 131 of file BasicTNode.h.
References sons_.
|
virtual |
Get a particular son in const environment.
Implements bpp::TNode.
Definition at line 155 of file BasicTNode.cpp.
|
virtual |
|
inline |
|
inlinevirtual |
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().
|
inlinevirtual |
Tell if this node has one or more son nodes.
Implements bpp::ONode.
Definition at line 130 of file BasicTNode.h.
References sons_.
|
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().
|
virtual |
Tell if a node is son of this node.
Definition at line 169 of file BasicTNode.cpp.
Referenced by addFather(), and addSon().
| BasicTNode & BasicTNode::operator= | ( | const BasicTNode & | node | ) |
|
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.
|
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.
|
virtual |
Remove the father of this node.
Definition at line 143 of file BasicTNode.cpp.
References father_, father_, hasFathers(), and removeSon().
Referenced by removeSon().
|
virtual |
Remove a son of this node.
Definition at line 186 of file BasicTNode.cpp.
References removeFather(), sons_, sons_, and sons_.
Referenced by removeFather(), and ~BasicTNode().
|
virtual |
|
private |
Definition at line 57 of file BasicTNode.h.
Referenced by addFather(), addFather(), degree(), getFather(), getFather(), getNeighbor(), getNeighbor(), getNumberOfFathers(), hasFather(), hasFathers(), isFather(), operator=(), operator=(), operator[](), operator[](), removeFather(), removeFather(), ~BasicTNode(), and ~BasicTNode().
|
private |
Definition at line 56 of file BasicTNode.h.
Referenced by addSon(), degree(), getNeighbor(), getNeighbor(), getNeighbor(), getNeighbor(), getNeighbor(), getNeighbor(), getNumberOfSons(), getSon(), getSon(), getSon(), getSon(), getSon(), getSon(), hasSons(), isSon(), isSon(), operator=(), operator=(), operator[](), operator[](), removeSon(), removeSon(), removeSon(), removeSon(), removeSon(), removeSon(), removeSon(), ~BasicTNode(), and ~BasicTNode().