graph_analysis
Vertex.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_VERTEX_HPP
2 #define GRAPH_ANALYSIS_VERTEX_HPP
3 
4 #include <vector>
5 #include <set>
6 #include "GraphElement.hpp"
7 
8 namespace graph_analysis
9 {
10 
11 class BaseGraph;
12 class VertexTypeManager;
13 
19 class Vertex : public GraphElement
20 {
21 public:
22  typedef shared_ptr< Vertex > Ptr;
23  typedef shared_ptr< const Vertex > ConstPtr;
24  typedef std::vector< Ptr > PtrList;
25  typedef std::set< Ptr > PtrSet;
26 
27  virtual ~Vertex() {}
28 
29  Vertex(const std::string& label = std::string());
30 
35  Vertex::Ptr clone() const;
36 
40  virtual std::string getClassName() const { return "graph_analysis::Vertex"; }
41 
45  virtual std::string toString() const;
46 
51  virtual std::string toString(uint32_t indentation) const;
52 
62  Vertex::Ptr getSharedPointerFromGraph(const shared_ptr<BaseGraph>& pGraph) const;
63 
69 
74  Vertex::ConstPtr getPtr() const;
75 
96  virtual void registerAttributes(VertexTypeManager*) const {}
97 
98 protected:
106  virtual Vertex* getClone() const { return new Vertex(*this); }
107 
108 };
109 
110 } // end namespace graph_analysis
111 #endif // GRAPH_ANALYSIS_VERTEX_HPP
virtual std::string toString() const
Definition: Vertex.cpp:33
GraphElement is the base class for all element in a graph, i.e. for edges and vertices.
Definition: GraphElement.hpp:34
Vertex::Ptr getPtr()
Definition: Vertex.cpp:23
virtual Vertex * getClone() const
Definition: Vertex.hpp:106
shared_ptr< const Vertex > ConstPtr
Definition: Vertex.hpp:23
std::set< Ptr > PtrSet
Definition: Vertex.hpp:25
virtual ~Vertex()
Definition: Vertex.hpp:27
virtual std::string getClassName() const
Definition: Vertex.hpp:40
std::vector< Ptr > PtrList
Definition: Vertex.hpp:24
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
virtual void registerAttributes(VertexTypeManager *) const
Definition: Vertex.hpp:96
Factory for Vertex subclasses.
Definition: VertexTypeManager.hpp:28
Vertex(const std::string &label=std::string())
Definition: Vertex.cpp:7
Vertex::Ptr getSharedPointerFromGraph(const shared_ptr< BaseGraph > &pGraph) const
Definition: Vertex.cpp:18
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19
Vertex::Ptr clone() const
Definition: Vertex.cpp:11