graph_analysis
NWeightedVertex.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_NWEIGHTED_VERTEX_HPP
2 #define GRAPH_ANALYSIS_NWEIGHTED_VERTEX_HPP
3 
4 #include <iostream>
5 #include "NWeighted.hpp"
6 #include "Vertex.hpp"
7 #include "VertexRegistration.hpp"
8 
9 namespace graph_analysis {
10 
15 template<typename T, size_t Dim = 2>
16 class NWeightedVertex : public NWeighted<T,Dim,Vertex>
17 {
18 public:
19  typedef shared_ptr< NWeightedVertex > Ptr;
20 
21  NWeightedVertex(const T& weight = T())
22  : NWeighted<T,Dim,Vertex>(weight)
23  {}
24 
25  virtual ~NWeightedVertex() {}
26 
27  // Get class name
28  // \return class name
29  virtual std::string getClassName() const { return
30  "graph_analysis::NWeightedVertex_" + std::string(typeid(T).name()) + "_" + std::to_string(Dim); }
31 
32 protected:
33  virtual Vertex* getClone() const { return new NWeightedVertex<T,Dim>(*this); }
34 
36 };
37 
38 } // end namespace graph_analysis
39 #endif // GRAPH_ANALYSIS_NWEIGHTED_VERTEX_HPP
static const VertexRegistration< NWeightedVertex< T, Dim > > __attribute__((used)) msRegistration
virtual ~NWeightedVertex()
Definition: NWeightedVertex.hpp:25
const VertexRegistration< MultiCommodityVertex > msRegistration
Definition: MultiCommodityVertex.cpp:13
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< NWeightedVertex > Ptr
Definition: NWeightedVertex.hpp:19
NWeighted is a template to associate N-weights with either a vertex or an edge, i.e., adds a vector of weights.
Definition: NWeighted.hpp:26
Definition: VertexRegistration.hpp:14
NWeightedVertex is an Vertex which can be associated with N-weights, i.e., a vector of weights...
Definition: NWeightedVertex.hpp:16
NWeightedVertex(const T &weight=T())
Definition: NWeightedVertex.hpp:21
virtual Vertex * getClone() const
Definition: NWeightedVertex.hpp:33
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19
virtual std::string getClassName() const
Definition: NWeightedVertex.hpp:29