5 #ifndef BPP_GRAPH_ASSOCIATIONTREEGRAPHOBSERVER_H 6 #define BPP_GRAPH_ASSOCIATIONTREEGRAPHOBSERVER_H 26 template<
class N,
class E>
43 virtual bool isValid()
const = 0;
51 virtual std::shared_ptr<E>
getEdgeToFather(
const std::shared_ptr<N> nodeObject)
const = 0;
53 virtual std::shared_ptr<E>
getEdgeToFather(
const NodeIndex nodeIndex)
const = 0;
60 virtual void rootAt(
const std::shared_ptr<N> root) = 0;
75 virtual std::shared_ptr<N>
getFatherOfNode(
const std::shared_ptr<N> nodeObject)
const = 0;
81 virtual bool hasFather(
const std::shared_ptr<N> nodeObject)
const = 0;
82 virtual bool hasFather(
const NodeIndex node)
const = 0;
90 virtual std::vector<std::shared_ptr<N>>
getSons(
const std::shared_ptr<N> node)
const = 0;
92 virtual std::vector<NodeIndex>
getSons(
const NodeIndex node)
const = 0;
100 virtual std::vector<std::shared_ptr<E>>
getBranches(
const std::shared_ptr<N> node)
const = 0;
102 virtual std::vector<EdgeIndex>
getBranches(
const NodeIndex node)
const = 0;
110 virtual std::shared_ptr<N>
getSon(
const std::shared_ptr<E> edge)
const = 0;
111 virtual NodeIndex
getSon(
const EdgeIndex edge)
const = 0;
119 virtual std::shared_ptr<N>
getFatherOfEdge(
const std::shared_ptr<E> edge)
const = 0;
128 virtual size_t getNumberOfSons(
const std::shared_ptr<N> node)
const = 0;
137 virtual std::vector<std::shared_ptr<N>>
getLeavesUnderNode(std::shared_ptr<N> node)
const = 0;
144 virtual std::vector<std::shared_ptr<N>>
removeSons(
const std::shared_ptr<N> node) = 0;
150 virtual void removeSon(
const std::shared_ptr<N> node,
const std::shared_ptr<N> son) = 0;
160 virtual void setFather(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> fatherNodeObject,
const std::shared_ptr<E> edgeObject = 0) = 0;
170 virtual void addSon(
const std::shared_ptr<N> nodeObject,
const std::shared_ptr<N> sonNodeObject,
const std::shared_ptr<E> edgeObject = 0) = 0;
191 virtual std::unique_ptr<NodeIterator>
sonsIterator(std::shared_ptr<N> node) = 0;
193 virtual std::unique_ptr<NodeIterator>
sonsIterator(std::shared_ptr<N> node)
const = 0;
200 virtual std::unique_ptr<EdgeIterator>
branchesIterator(std::shared_ptr<N> node) = 0;
202 virtual std::unique_ptr<EdgeIterator>
branchesIterator(std::shared_ptr<N> node)
const = 0;
214 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;
216 virtual std::vector<std::shared_ptr<E>>
getEdgePathBetweenTwoNodes(
const std::shared_ptr<N> nodeA,
const std::shared_ptr<N> nodeB)
const = 0;
218 virtual std::vector<std::shared_ptr<N>>
getSubtreeNodes(
const std::shared_ptr<N> localRoot)
const = 0;
220 virtual std::vector<std::shared_ptr<E>>
getSubtreeEdges(
const std::shared_ptr<N> localRoot)
const = 0;
223 #endif // BPP_GRAPH_ASSOCIATIONTREEGRAPHOBSERVER_H
AssociationTreeGraphObserver< N, E >::EdgeIndex EdgeIndex
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 std::shared_ptr< E > getEdgeToFather(const std::shared_ptr< N > nodeObject) const =0
Defines a Graph Associator. It is a template which follows (subscribed to) a Graph.
virtual bool isValid() const =0
virtual std::vector< std::shared_ptr< E > > getSubtreeEdges(const std::shared_ptr< N > localRoot) const =0
virtual void setFather(const std::shared_ptr< N > nodeObject, const std::shared_ptr< N > fatherNodeObject, const std::shared_ptr< E > edgeObject=0)=0
AssociationTreeGraphObserver< N, E >::NodeIndex NodeIndex
virtual std::shared_ptr< N > getFatherOfEdge(const std::shared_ptr< E > edge) const =0
virtual std::shared_ptr< N > getSon(const std::shared_ptr< E > edge) const =0
virtual std::vector< std::shared_ptr< N > > getSons(const std::shared_ptr< N > node) const =0
TreeGraph::EdgeId EdgeGraphid
virtual std::unique_ptr< EdgeIterator > branchesIterator(std::shared_ptr< N > node)=0
virtual std::vector< std::shared_ptr< E > > getEdgePathBetweenTwoNodes(const std::shared_ptr< N > nodeA, const std::shared_ptr< N > nodeB) const =0
Defines a Tree Graph Associator. It is a template which follows (subscribed to) a Graph...
virtual std::unique_ptr< NodeIterator > sonsIterator(std::shared_ptr< N > node)=0
virtual bool hasFather(const std::shared_ptr< N > nodeObject) 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 bool isRooted() const =0
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 >::NodeIterator NodeIterator
TreeGraph::NodeId NodeGraphid
AssociationGraphObserver< N, E >::EdgeIterator EdgeIterator
virtual void removeSon(const std::shared_ptr< N > node, const std::shared_ptr< N > son)=0
virtual std::vector< std::shared_ptr< N > > removeSons(const std::shared_ptr< N > node)=0
virtual size_t getNumberOfSons(const std::shared_ptr< N > node) const =0
virtual std::vector< std::shared_ptr< E > > getBranches(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::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