graph_analysis
src
VertexRegistration.hpp
Go to the documentation of this file.
1
#ifndef GRAPH_ANALYSIS_VERTEX_REGISTRATION_HPP
2
#define GRAPH_ANALYSIS_VERTEX_REGISTRATION_HPP
3
4
#include "
VertexTypeManager.hpp
"
5
6
namespace
graph_analysis
{
7
8
template
<
typename
T>
9
class
VertexRegistration
10
{
11
public
:
12
VertexRegistration
()
13
{
14
using namespace
graph_analysis
;
15
VertexTypeManager
* vManager = VertexTypeManager::getInstance();
16
17
Vertex::Ptr
vertex(
new
T());
18
vManager->
registerType
(vertex->getClassName(), vertex,
true
);
19
vertex->registerAttributes(vManager);
20
}
21
};
22
23
}
// end namespace graph_analysis
24
#endif // GRAPH_ANALYSIS_VERTEX_REGISTRATION_HPP
graph_analysis::VertexTypeManager::registerType
void registerType(const Vertex::Ptr &vertex, bool throwOnAlreadyRegistered=false)
Definition:
VertexTypeManager.cpp:18
graph_analysis
Main namespace of the graph analysis library.
Definition:
BFS.cpp:3
graph_analysis::Vertex::Ptr
shared_ptr< Vertex > Ptr
Definition:
Vertex.hpp:22
VertexTypeManager.hpp
graph_analysis::VertexRegistration
Definition:
VertexRegistration.hpp:9
graph_analysis::VertexTypeManager
Factory for Vertex subclasses.
Definition:
VertexTypeManager.hpp:28
graph_analysis::VertexRegistration::VertexRegistration
VertexRegistration()
Definition:
VertexRegistration.hpp:12
Generated by
1.8.13