bpp-phyl3
3.0.0
|
A node class aware of its neighbours. More...
#include <Bpp/Phyl/Legacy/Tree/AwareNode.h>
Public Member Functions | |
AwareNode () | |
Build a new void Node object. More... | |
AwareNode (unsigned int id) | |
Build a new Node with specified id. More... | |
AwareNode (const AwareNode &node) | |
Copy constructor. More... | |
AwareNode & | operator= (const AwareNode &node) |
Assignation operator. More... | |
AwareNode * | clone () const |
virtual | ~AwareNode () |
template<class N , class E , class I > | |
void | updateTree (AssociationTreeGraphImplObserver< N, E, I > *tree, unsigned int index) |
update information from TreeObserver More... | |
virtual bool | hasNoSon () const |
Identity | |
virtual unsigned int | getId () const |
Get the node's id. More... | |
virtual void | setId (unsigned int id) |
Set this node's id. More... | |
virtual std::vector< unsigned int > | getSonsId () const |
Distances: | |
virtual double | getDistanceToFather () const |
Get the distance to the father node is there is one, otherwise throw a NodeException. More... | |
virtual void | setDistanceToFather (double distance) |
Set or update the distance toward the father node. More... | |
Father: | |
virtual const AwareNode * | getFather () const |
Get the father of this node is there is one. More... | |
virtual AwareNode * | getFather () |
Get the father of this node is there is one. More... | |
virtual void | setFather (AwareNode *node) |
Set the father node of this node. More... | |
virtual void | removeFather () |
Remove the father of this node. More... | |
virtual bool | hasFather () const |
Tell if this node has a father node. More... | |
Sons: | |
virtual size_t | getNumberOfSons () const |
bool | isLeaf () const |
virtual std::vector< AwareNode * > & | getSons () |
virtual const AwareNode * | getSon (size_t pos) const |
virtual AwareNode * | getSon (size_t pos) |
virtual void | addSon (size_t pos, AwareNode *node) |
virtual void | addSon (AwareNode *node) |
virtual void | setSon (size_t pos, AwareNode *node) |
virtual void | removeSon (size_t pos) |
virtual void | removeSon (AwareNode *node) |
virtual void | removeSons () |
virtual void | swap (size_t branch1, size_t branch2) |
virtual size_t | getSonPosition (const AwareNode *son) const |
Operators: | |
| |
AwareNode * | operator[] (int i) |
const AwareNode * | operator[] (int i) const |
Protected Attributes | |
unsigned int | id_ |
std::vector< AwareNode * > | sons_ |
AwareNode * | father_ |
double | distanceToFather_ |
A node class aware of its neighbours.
This class is made the more general as possible, while keeping it very simple. It contains:
Definition at line 41 of file AwareNode.h.
|
inline |
|
inline |
Build a new Node with specified id.
Definition at line 64 of file AwareNode.h.
AwareNode::AwareNode | ( | const AwareNode & | node | ) |
Copy constructor.
Need the call of updateTree after whole Tree is built.
node | The node to copy. |
Copy constructor:
Definition at line 15 of file AwareNode.cpp.
|
inlinevirtual |
Definition at line 98 of file AwareNode.h.
|
inlinevirtual |
Definition at line 261 of file AwareNode.h.
References sons_.
|
inlinevirtual |
|
inline |
Definition at line 96 of file AwareNode.h.
References AwareNode().
|
inlinevirtual |
Get the distance to the father node is there is one, otherwise throw a NodeException.
Definition at line 154 of file AwareNode.h.
References distanceToFather_.
|
inlinevirtual |
Get the father of this node is there is one.
Definition at line 193 of file AwareNode.h.
References father_.
|
inlinevirtual |
Get the father of this node is there is one.
Definition at line 186 of file AwareNode.h.
References father_.
|
inlinevirtual |
Get the node's id.
Definition at line 121 of file AwareNode.h.
References id_.
Referenced by getSonPosition(), and removeSon().
|
inlinevirtual |
Definition at line 227 of file AwareNode.h.
References sons_.
Referenced by hasNoSon(), and isLeaf().
|
inlinevirtual |
Definition at line 245 of file AwareNode.h.
References sons_.
|
inlinevirtual |
|
virtual |
Definition at line 51 of file AwareNode.cpp.
References getId(), sons_, and bpp::TextTools::toString().
|
inlinevirtual |
Definition at line 234 of file AwareNode.h.
References sons_.
|
inlinevirtual |
Definition at line 130 of file AwareNode.h.
References sons_.
|
inlinevirtual |
Tell if this node has a father node.
Definition at line 218 of file AwareNode.h.
References father_.
|
inlinevirtual |
Definition at line 331 of file AwareNode.h.
References getNumberOfSons().
|
inline |
Definition at line 229 of file AwareNode.h.
References getNumberOfSons().
Assignation operator.
Need the call of updateTree after whole Tree is built.
node | the node to copy. |
Assignation operator:
Definition at line 23 of file AwareNode.cpp.
References distanceToFather_, father_, id_, and sons_.
|
inline |
Definition at line 325 of file AwareNode.h.
|
inline |
Definition at line 327 of file AwareNode.h.
|
inlinevirtual |
|
inlinevirtual |
Definition at line 291 of file AwareNode.h.
References getId(), sons_, and bpp::TextTools::toString().
|
inlinevirtual |
|
inlinevirtual |
Definition at line 306 of file AwareNode.h.
References sons_.
|
inlinevirtual |
Set or update the distance toward the father node.
Warning: a distance to the father node may be set even if no father node is specified. This is used by several tree reconstruction methods. It may also be useful for manipulating subtrees.
distance | The new distance to the father node. |
Definition at line 168 of file AwareNode.h.
References distanceToFather_.
|
inlinevirtual |
Set the father node of this node.
node | The father node. |
Definition at line 202 of file AwareNode.h.
References father_.
|
inlinevirtual |
Set this node's id.
id | The new identity tag. |
Definition at line 128 of file AwareNode.h.
References id_.
|
inlinevirtual |
Definition at line 271 of file AwareNode.h.
References sons_.
|
virtual |
void bpp::AwareNode::updateTree | ( | AssociationTreeGraphImplObserver< N, E, I > * | tree, |
unsigned int | index | ||
) |
update information from TreeObserver
Definition at line 335 of file AwareNode.h.
References father_, bpp::AssociationTreeGraphImplObserver< class, class, class >::getFatherOfNode(), bpp::AssociationTreeGraphImplObserver< class, class, class >::getNode(), bpp::AssociationTreeGraphImplObserver< class, class, class >::getSons(), bpp::AssociationTreeGraphImplObserver< class, class, class >::hasFather(), id_, and sons_.
|
protected |
Definition at line 48 of file AwareNode.h.
Referenced by getDistanceToFather(), operator=(), and setDistanceToFather().
|
protected |
Definition at line 47 of file AwareNode.h.
Referenced by getFather(), hasFather(), operator=(), operator[](), removeFather(), setFather(), and updateTree().
|
protected |
Definition at line 45 of file AwareNode.h.
Referenced by getId(), operator=(), setId(), and updateTree().
|
protected |
Definition at line 46 of file AwareNode.h.
Referenced by addSon(), getNumberOfSons(), getSon(), getSonPosition(), getSons(), getSonsId(), operator=(), operator[](), removeSon(), removeSons(), setSon(), and updateTree().