graph_analysis
Public Types | Public Member Functions | List of all members
graph_analysis::AttributeManager Class Reference

Manage object (vertex/edge) attributes and allow them to be serialized, e.g., using GEXF or GraphML. More...

#include <AttributeManager.hpp>

Inheritance diagram for graph_analysis::AttributeManager:
Inheritance graph
[legend]

Public Types

typedef std::map< std::string, io::AttributeSerializationCallbacks > AttributeSerializationCallbackMap
 

Public Member Functions

void activateAttributedType (const std::string &typeName)
 
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 More...
 
std::vector< std::string > getAttributeNames (const std::string &vertexTypeName) const
 returns all registered members for the given vertex More...
 
io::AttributeSerializationCallbacks getAttributeSerializationCallbacks (const Attribute &attribute) const
 

Detailed Description

Manage object (vertex/edge) attributes and allow them to be serialized, e.g., using GEXF or GraphML.

Member Typedef Documentation

◆ AttributeSerializationCallbackMap

Member Function Documentation

◆ activateAttributedType()

void graph_analysis::AttributeManager::activateAttributedType ( const std::string &  typeName)
inline

◆ getAttributeNames()

std::vector< std::string > graph_analysis::AttributeManager::getAttributeNames ( const std::string &  vertexTypeName) const

returns all registered members for the given vertex

Parameters
vertexTypeNamethe class Name (normally equals Vertex::getClassName()
Returns
a list of members that are registered

◆ getAttributeSerializationCallbacks()

io::AttributeSerializationCallbacks graph_analysis::AttributeManager::getAttributeSerializationCallbacks ( const Attribute &  attribute) const
Parameters
typeNamethe class Name (normally equals Vertex::getClassName()
attributeNamearbitrary unique name for the attribute that should be rerieved
Returns
the struct with all required callback functions
Exceptions
std::invalid_argumentif type or callback is not known

◆ registerAttribute()

void graph_analysis::AttributeManager::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

Parameters
typeNamethe class Name (normally equals Vertex::getClassName()
attributeNamearbitrary unique name for the attribute that should added
sFSerialization function
dFDeSerialization function
pFPrintFunction

The documentation for this class was generated from the following files: