graph_analysis
AttributeManager.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_ATTRIBUTE_MANAGER_HPP
2 #define GRAPH_ANALYSIS_ATTRIBUTE_MANAGER_HPP
3 
4 #include "io/Serialization.hpp"
5 #include "Attribute.hpp"
6 
7 namespace graph_analysis {
8 
14 {
15 public:
16  typedef std::map<std::string, io::AttributeSerializationCallbacks> AttributeSerializationCallbackMap;
17 
18  void activateAttributedType(const std::string& typeName) { (void) mRegisteredCallbacks[typeName]; }
19 
28  void registerAttribute(const std::string& typeName,
29  const std::string& attributeName,
33 
39  std::vector<std::string> getAttributeNames(const std::string& vertexTypeName) const;
40 
48 
49 private:
50  std::map<std::string, AttributeSerializationCallbackMap > mRegisteredCallbacks;
51 
52 };
53 
54 } // end namespace graph_analysis
55 #endif // GRAPH_ANALYSIS_ATTRIBUTE_MANAGER_HPP
void registerAttribute(const std::string &typeName, const std::string &attributeName, io::AttributeSerializationCallbacks::serialize_func_t sF, io::AttributeSerializationCallbacks::deserialize_func_t dF, io::AttributeSerializationCallbacks::print_func_t pF)
register a new attribute for serialization and deserialization
Definition: AttributeManager.cpp:5
Manage object (vertex/edge) attributes and allow them to be serialized, e.g., using GEXF or GraphML...
Definition: AttributeManager.hpp:13
Definition: Attribute.hpp:8
std::string(graph_analysis::GraphElement::* print_func_t)()
Definition: Serialization.hpp:34
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
std::map< std::string, io::AttributeSerializationCallbacks > AttributeSerializationCallbackMap
Definition: AttributeManager.hpp:16
void(graph_analysis::GraphElement::* deserialize_func_t)(const std::string &)
Definition: Serialization.hpp:33
io::AttributeSerializationCallbacks getAttributeSerializationCallbacks(const Attribute &attribute) const
Definition: AttributeManager.cpp:39
void activateAttributedType(const std::string &typeName)
Definition: AttributeManager.hpp:18
std::string(graph_analysis::GraphElement::* serialize_func_t)()
Definition: Serialization.hpp:32
std::vector< std::string > getAttributeNames(const std::string &vertexTypeName) const
returns all registered members for the given vertex
Definition: AttributeManager.cpp:20