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
graph_analysis::Vertex::getClassName
virtual std::string getClassName() const
Definition: Vertex.hpp:40
GraphElement.hpp
graph_analysis::Vertex::toString
virtual std::string toString() const
Definition: Vertex.cpp:33
graph_analysis::Vertex::ConstPtr
shared_ptr< const Vertex > ConstPtr
Definition: Vertex.hpp:23
graph_analysis::GraphElement
GraphElement is the base class for all element in a graph, i.e. for edges and vertices.
Definition: GraphElement.hpp:34
graph_analysis::Vertex::PtrList
std::vector< Ptr > PtrList
Definition: Vertex.hpp:24
graph_analysis::Vertex
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19
graph_analysis::Vertex::getClone
virtual Vertex * getClone() const
Definition: Vertex.hpp:106
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::Vertex::PtrSet
std::set< Ptr > PtrSet
Definition: Vertex.hpp:25
graph_analysis::Vertex::Vertex
Vertex(const std::string &label=std::string())
Definition: Vertex.cpp:7
graph_analysis::Vertex::getSharedPointerFromGraph
Vertex::Ptr getSharedPointerFromGraph(const shared_ptr< BaseGraph > &pGraph) const
Definition: Vertex.cpp:18
graph_analysis::Vertex::Ptr
shared_ptr< Vertex > Ptr
Definition: Vertex.hpp:22
graph_analysis::Vertex::clone
Vertex::Ptr clone() const
Definition: Vertex.cpp:11
graph_analysis::Vertex::~Vertex
virtual ~Vertex()
Definition: Vertex.hpp:27
graph_analysis::VertexTypeManager
Factory for Vertex subclasses.
Definition: VertexTypeManager.hpp:29
graph_analysis::Vertex::getPtr
Vertex::Ptr getPtr()
Definition: Vertex.cpp:23
graph_analysis::Vertex::registerAttributes
virtual void registerAttributes(VertexTypeManager *) const
Definition: Vertex.hpp:96