41 #ifndef BPP_GRAPH_ASSOCIATIONDAGRAPHIMPLOBSERVER_H
42 #define BPP_GRAPH_ASSOCIATIONDAGRAPHIMPLOBSERVER_H
56 template<
class N,
class E,
class DAGraphImpl>
101 template<
class N2,
class E2>
146 return this->
getGraph()->isRooted();
155 std::vector<std::shared_ptr<N> >
getFathers(
const std::shared_ptr<N> node)
const
170 void rootAt(
const std::shared_ptr<N> root)
178 bool hasFather(
const std::shared_ptr<N> nodeObject)
const
192 std::vector<std::shared_ptr<N> >
getSons(
const std::shared_ptr<N> node)
const
208 std::shared_ptr<N>
getSon(
const std::shared_ptr<E> edge)
const
269 std::vector<std::shared_ptr<N> >
removeFathers(
const std::shared_ptr<N> node)
278 void removeFather(
const std::shared_ptr<N> node,
const std::shared_ptr<N> father)
287 std::vector<std::shared_ptr<N> >
removeSons(
const std::shared_ptr<N> node)
295 void removeSon(
const std::shared_ptr<N> node,
const std::shared_ptr<N> son)
307 void addFather(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> fatherNodeObject,
const std::shared_ptr<E> edgeObject = 0)
316 this->
link(fatherNodeObject, nodeObject, edgeObject);
329 void addSon(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> sonNodeObject,
const std::shared_ptr<E> edgeObject = 0)
338 this->
link(nodeObject, sonNodeObject, edgeObject);
353 std::unique_ptr<typename AssociationDAGraphObserver<N, E>::NodeIterator>
fathersIterator(std::shared_ptr<N> node)
358 std::unique_ptr<typename AssociationDAGraphObserver<N, E>::NodeIterator>
fathersIterator(std::shared_ptr<N> node)
const
367 std::unique_ptr<typename AssociationDAGraphObserver<N, E>::NodeIterator>
sonsIterator(std::shared_ptr<N> node)
372 std::unique_ptr<typename AssociationDAGraphObserver<N, E>::NodeIterator>
sonsIterator(std::shared_ptr<N> node)
const
384 std::vector<std::shared_ptr<N> >
getBelowNodes(
const std::shared_ptr<N> localRoot)
389 std::vector<std::shared_ptr<E> >
getBelowEdges(
const std::shared_ptr<N> localRoot)
397 template<
class N,
class E>
void rootAt(const std::shared_ptr< N > root)
Sets the root and make the DAG directed from root to leaves.
Graph::EdgeId EdgeGraphid
std::unique_ptr< typename AssociationDAGraphObserver< N, E >::NodeIterator > fathersIterator(std::shared_ptr< N > node) const
std::shared_ptr< N > getSon(const std::shared_ptr< E > edge) const
std::unique_ptr< typename AssociationDAGraphObserver< N, E >::NodeIterator > sonsIterator(std::shared_ptr< N > node) const
void removeFather(const std::shared_ptr< N > node, const std::shared_ptr< N > father)
AssociationDAGraphImplObserver< N, E, DAGraphImpl > & operator=(bpp::AssociationDAGraphImplObserver< N, E, DAGraphImpl > const &dAGraphObserver)
AssociationGraphObserver< N, E >::EdgeIndex EdgeIndex
AssociationDAGraphImplObserver(bpp::AssociationDAGraphImplObserver< N, E, DAGraphImpl > const &dAGraphObserver)
~AssociationDAGraphImplObserver()
std::unique_ptr< typename AssociationDAGraphObserver< N, E >::NodeIterator > fathersIterator(std::shared_ptr< N > node)
std::vector< std::shared_ptr< N > > getFathers(const std::shared_ptr< N > node) const
void addSon(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > sonNodeObject, const std::shared_ptr< E > edgeObject=0)
AssociationDAGraphImplObserver(std::shared_ptr< DAGraphImpl > subjectDAGraph)
std::vector< std::shared_ptr< N > > getBelowNodes(const std::shared_ptr< N > localRoot)
Get Below Objects.
std::vector< std::shared_ptr< N > > removeSons(const std::shared_ptr< N > node)
std::vector< std::shared_ptr< N > > removeFathers(const std::shared_ptr< N > node)
std::shared_ptr< N > getFatherOfEdge(const std::shared_ptr< E > edge) const
bool hasFather(const std::shared_ptr< N > nodeObject) const
std::vector< std::shared_ptr< E > > getBelowEdges(const std::shared_ptr< N > localRoot)
void addFather(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > fatherNodeObject, const std::shared_ptr< E > edgeObject=0)
std::vector< NodeIndex > getSons(const NodeIndex node) const
std::vector< std::shared_ptr< N > > getSons(const std::shared_ptr< N > node) const
size_t getNumberOfSons(const std::shared_ptr< N > node) const
std::vector< NodeIndex > getFathers(const NodeIndex node) const
NodeIndex getFatherOfEdge(const EdgeIndex edge) const
AssociationGraphObserver< N, E >::NodeIndex NodeIndex
std::vector< std::shared_ptr< N > > getLeavesUnderNode(std::shared_ptr< N > node) const
std::unique_ptr< typename AssociationDAGraphObserver< N, E >::NodeIterator > sonsIterator(std::shared_ptr< N > node)
NodeIndex getSon(const EdgeIndex edgeId) const
bool hasFather(const NodeIndex node) const
Graph::NodeId NodeGraphid
AssociationDAGraphImplObserver< N, E, DAGraphImpl > * clone() const
size_t getNumberOfFathers(const std::shared_ptr< N > node) const
AssociationDAGraphImplObserver()
AssociationDAGraphImplObserver(bpp::AssociationDAGraphImplObserver< N2, E2, DAGraphImpl > const &dAGraphObserver)
void removeSon(const std::shared_ptr< N > node, const std::shared_ptr< N > son)
Defines a DA Graph Associator. It is a template which follows (subscribed to) a Graph.
void link(Nref nodeObjectA, Nref nodeObjectB, Eref edgeObject=00)
const std::shared_ptr< DAGraphImpl > getGraph() const
Nref getNodeFromGraphid(NodeGraphid node)
EdgeGraphid getEdgeGraphid(const Eref edgeObject) const
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIterator > outgoingNeighborNodesIterator(Nref node)
std::unique_ptr< typename AssociationGraphObserver< N, E >::NodeIterator > incomingNeighborNodesIterator(Nref node)
std::vector< Eref > getEdgesFromGraphid(std::vector< EdgeGraphid > edges) const
std::vector< NodeIndex > getNodeIndexes(std::vector< Nref > nodes) const
std::vector< Nref > getNodesFromGraphid(std::vector< NodeGraphid > nodes) const
Eref getEdge(EdgeIndex edge) const
Nref getNode(NodeIndex node) const
NodeIndex getNodeIndex(const Nref nodeObject) const
AssociationGraphImplObserver< N, E, GraphImpl > & operator=(bpp::AssociationGraphImplObserver< N, E, GraphImpl > const &graphObserver)
NodeGraphid getNodeGraphid(const Nref nodeObject) const
Exception base class. Overload exception constructor (to control the exceptions mechanism)....