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 
8 namespace graph_analysis {
9 
14 template<typename T, size_t Dim = 2>
15 class NWeightedVertex : public NWeighted<T,Dim,Vertex>
16 {
17 public:
18  typedef shared_ptr< NWeightedVertex > Ptr;
19 
20  NWeightedVertex(const T& weight)
21  : NWeighted<T,Dim,Vertex>(weight)
22  {}
23 
24  virtual ~NWeightedVertex() {}
25 
26  // Get class name
27  // \return class name
28  virtual std::string getClassName() const { return "graph_analysis::NWeightedVertex"; }
29 
30 protected:
31  virtual Vertex* getClone() const { return new NWeightedVertex<T,Dim>(*this); }
32 };
33 
34 } // end namespace graph_analysis
35 #endif // GRAPH_ANALYSIS_NWEIGHTED_VERTEX_HPP
virtual ~NWeightedVertex()
Definition: NWeightedVertex.hpp:24
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
shared_ptr< NWeightedVertex > Ptr
Definition: NWeightedVertex.hpp:18
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
NWeightedVertex(const T &weight)
Definition: NWeightedVertex.hpp:20
NWeightedVertex is an Vertex which can be associated with N-weights, i.e., a vector of weights...
Definition: NWeightedVertex.hpp:15
virtual Vertex * getClone() const
Definition: NWeightedVertex.hpp:31
A vertex inherited to allow storing data of any type.
Definition: Vertex.hpp:19
virtual std::string getClassName() const
Definition: NWeightedVertex.hpp:28