41 #ifndef BPP_GRAPH_ASSOCIATIONTREEGRAPHOBSERVER_H
42 #define BPP_GRAPH_ASSOCIATIONTREEGRAPHOBSERVER_H
62 template<
class N,
class E>
87 virtual std::shared_ptr<E>
getEdgeToFather(
const std::shared_ptr<N> nodeObject)
const = 0;
96 virtual void rootAt(
const std::shared_ptr<N> root) = 0;
111 virtual std::shared_ptr<N>
getFatherOfNode(
const std::shared_ptr<N> nodeObject)
const = 0;
117 virtual bool hasFather(
const std::shared_ptr<N> nodeObject)
const = 0;
126 virtual std::vector<std::shared_ptr<N> >
getSons(
const std::shared_ptr<N> node)
const = 0;
136 virtual std::vector<std::shared_ptr<E> >
getBranches(
const std::shared_ptr<N> node)
const = 0;
146 virtual std::shared_ptr<N>
getSon(
const std::shared_ptr<E> edge)
const = 0;
180 virtual std::vector<std::shared_ptr<N> >
removeSons(
const std::shared_ptr<N> node) = 0;
186 virtual void removeSon(
const std::shared_ptr<N> node,
const std::shared_ptr<N> son) = 0;
196 virtual void setFather(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> fatherNodeObject,
const std::shared_ptr<E> edgeObject = 0) = 0;
206 virtual void addSon(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> sonNodeObject,
const std::shared_ptr<E> edgeObject = 0) = 0;
227 virtual std::unique_ptr<NodeIterator>
sonsIterator(std::shared_ptr<N> node) = 0;
229 virtual std::unique_ptr<NodeIterator>
sonsIterator(std::shared_ptr<N> node)
const = 0;
250 virtual std::vector<std::shared_ptr<N> >
getNodePathBetweenTwoNodes(
const std::shared_ptr<N> nodeA,
const std::shared_ptr<N> nodeB,
bool includeAncestor =
true)
const = 0;
252 virtual std::vector<std::shared_ptr<E> >
getEdgePathBetweenTwoNodes(
const std::shared_ptr<N> nodeA,
const std::shared_ptr<N> nodeB)
const = 0;
254 virtual std::vector<std::shared_ptr<N> >
getSubtreeNodes(
const std::shared_ptr<N> localRoot)
const = 0;
256 virtual std::vector<std::shared_ptr<E> >
getSubtreeEdges(
const std::shared_ptr<N> localRoot)
const = 0;
Defines a Graph Associator. It is a template which follows (subscribed to) a Graph.
Defines a Tree Graph Associator. It is a template which follows (subscribed to) a Graph.
virtual bool hasFather(const NodeIndex node) const =0
virtual std::vector< NodeIndex > getSons(const NodeIndex node) const =0
virtual std::vector< std::shared_ptr< E > > getEdgePathBetweenTwoNodes(const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB) const =0
virtual size_t getNumberOfSons(const std::shared_ptr< N > node) const =0
virtual std::vector< std::shared_ptr< N > > getLeavesUnderNode(std::shared_ptr< N > node) const =0
virtual std::vector< std::shared_ptr< N > > getSons(const std::shared_ptr< N > node) const =0
virtual std::unique_ptr< EdgeIterator > branchesIterator(std::shared_ptr< N > node) const =0
virtual std::vector< std::shared_ptr< E > > getBranches(const std::shared_ptr< N > node) const =0
AssociationTreeGraphObserver< N, E >::NodeIndex NodeIndex
virtual void addSon(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > sonNodeObject, const std::shared_ptr< E > edgeObject=0)=0
AssociationGraphObserver< N, E >::EdgeIterator EdgeIterator
AssociationTreeGraphObserver< N, E >::EdgeIndex EdgeIndex
virtual bool hasFather(const std::shared_ptr< N > nodeObject) const =0
TreeGraph::NodeId NodeGraphid
virtual std::shared_ptr< N > getSon(const std::shared_ptr< E > edge) const =0
virtual std::shared_ptr< N > getFatherOfEdge(const std::shared_ptr< E > edge) const =0
virtual std::vector< std::shared_ptr< N > > getNodePathBetweenTwoNodes(const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB, bool includeAncestor=true) const =0
Get a vector of ancestor nodes between to nodes.
virtual void removeSon(const std::shared_ptr< N > node, const std::shared_ptr< N > son)=0
AssociationGraphObserver< N, E >::NodeIterator NodeIterator
virtual std::vector< std::shared_ptr< E > > getSubtreeEdges(const std::shared_ptr< N > localRoot) const =0
virtual NodeIndex getSon(const EdgeIndex edge) const =0
virtual bool isValid() const =0
virtual std::shared_ptr< E > getEdgeToFather(const std::shared_ptr< N > nodeObject) const =0
virtual std::shared_ptr< E > getEdgeToFather(const NodeIndex nodeIndex) const =0
virtual std::vector< std::shared_ptr< N > > removeSons(const std::shared_ptr< N > node)=0
virtual void setFather(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > fatherNodeObject, const std::shared_ptr< E > edgeObject=0)=0
virtual std::vector< EdgeIndex > getBranches(const NodeIndex node) const =0
virtual std::unique_ptr< NodeIterator > sonsIterator(std::shared_ptr< N > node)=0
virtual std::shared_ptr< N > getFatherOfNode(const std::shared_ptr< N > nodeObject) const =0
virtual std::vector< std::shared_ptr< N > > getSubtreeNodes(const std::shared_ptr< N > localRoot) const =0
virtual void rootAt(const std::shared_ptr< N > root)=0
Sets the root and make the tree directed from root to leaves.
virtual std::unique_ptr< NodeIterator > sonsIterator(std::shared_ptr< N > node) const =0
TreeGraph::EdgeId EdgeGraphid
virtual bool isRooted() const =0
virtual std::unique_ptr< EdgeIterator > branchesIterator(std::shared_ptr< N > node)=0
virtual NodeIndex getFatherOfEdge(const EdgeIndex edge) const =0