graph_analysis
DirectedHyperEdge.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_DIRECTED_HYPER_EDGE_HPP
2 #define GRAPH_ANALYSIS_DIRECTED_HYPER_EDGE_HPP
3 
4 #include <string>
5 #include "HyperEdge.hpp"
6 
7 namespace graph_analysis
8 {
9 
10 class BaseGraph;
11 
18 {
19 public:
20  typedef shared_ptr< DirectedHyperEdge > Ptr;
21 
22  DirectedHyperEdge(const std::string& label = std::string());
23 
24  DirectedHyperEdge(const Vertex::PtrList& fromVertices,
25  const Vertex::PtrList& toVertices,
26  const std::string& label = std::string());
27 
28  virtual ~DirectedHyperEdge() {}
29 
30  // Get class name
31  // \return class name
32  virtual std::string getClassName() const;
33 
38  virtual std::string toString() const;
39 
44  virtual std::string toString(uint32_t indent) const;
45 
49  const Vertex::PtrList& getSourceVertices() const { return mSourceVertices; }
50 
54  const Vertex::PtrList& getTargetVertices() const { return mTargetVertices; }
55 
59  void setSourceVertices(const Vertex::PtrList& vertices) { mSourceVertices = vertices; }
60 
64  void setTargetVertices(const Vertex::PtrList& vertices) { mTargetVertices = vertices; }
65 protected:
69  virtual Vertex* getClone() const { return new DirectedHyperEdge(*this); }
70 
71 private:
72  Vertex::PtrList mSourceVertices;
73  Vertex::PtrList mTargetVertices;
74 };
75 
76 } // end namespace graph_analysis
77 #endif // GRAPH_ANALYSIS_DIRECTED_HYPER_EDGE_HPP
virtual ~DirectedHyperEdge()
Definition: DirectedHyperEdge.hpp:28
A DirectedHyperEdge represents a set of source vertices and target vertices.
Definition: DirectedHyperEdge.hpp:17
const Vertex::PtrList & getSourceVertices() const
Definition: DirectedHyperEdge.hpp:49
virtual std::string getClassName() const
Definition: DirectedHyperEdge.cpp:22
virtual Vertex * getClone() const
Definition: DirectedHyperEdge.hpp:69
std::vector< Ptr > PtrList
Definition: Vertex.hpp:24
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
A HyperEdge represents a set of vertices.
Definition: HyperEdge.hpp:17
void setSourceVertices(const Vertex::PtrList &vertices)
Definition: DirectedHyperEdge.hpp:59
virtual std::string toString() const
Definition: DirectedHyperEdge.cpp:27
const Vertex::PtrList & getTargetVertices() const
Definition: DirectedHyperEdge.hpp:54
void setTargetVertices(const Vertex::PtrList &vertices)
Definition: DirectedHyperEdge.hpp:64
DirectedHyperEdge(const std::string &label=std::string())
Definition: DirectedHyperEdge.cpp:7
shared_ptr< DirectedHyperEdge > Ptr
Definition: DirectedHyperEdge.hpp:20
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19