graph_analysis
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
graph_analysis::EdgeTypeManager Class Reference

Factory for Edge subclasses. More...

#include <EdgeTypeManager.hpp>

Inheritance diagram for graph_analysis::EdgeTypeManager:
Inheritance graph
[legend]
Collaboration diagram for graph_analysis::EdgeTypeManager:
Collaboration graph
[legend]

Public Types

typedef std::map< edge::Type, Edge::Ptr > TypeMap
 
- Public Types inherited from graph_analysis::AttributeManager
typedef std::map< std::string, io::AttributeSerializationCallbacks > AttributeSerializationCallbackMap
 

Public Member Functions

template<typename T , typename P = graph_analysis::Edge>
void registerType (bool throwOnAlreadyRegistered=false)
 
void registerType (const Edge::Ptr &edge, const Edge::PtrList &parents=Edge::PtrList(), bool throwOnAlreadyRegistered=false)
 
void registerType (const edge::Type &type, const Edge::Ptr &edge, const Edge::PtrList &parents=Edge::PtrList(), bool throwOnAlreadyRegistered=false)
 
void setDefaultType (const std::string &type)
 
const std::string & getDefaultType () const
 
Edge::Ptr createEdge (const edge::Type &type, const std::string &label="", bool throwOnMissing=false)
 clones a new edge of a specified type More...
 
Edge::Ptr createEdge (const edge::Type &type, const Vertex::Ptr &source, const Vertex::Ptr &target, const std::string &label="", bool throwOnMissing=false)
 
std::set< std::string > getSupportedTypes () const
 lists the registered types More...
 
std::vector< std::string > getTypeHierarchy (const edge::Type &type) const
 
std::vector< Attribute > getKnownAttributes (const std::set< std::string > &classnames=std::set< std::string >()) const
 
std::vector< Attribute > getAttributes (const edge::Type &type, bool includeLegacySupport=false) const
 
std::vector< std::pair< Attribute::Id, std::string > > getAttributeValues (const Edge::Ptr &edge) const
 
- Public Member Functions inherited from graph_analysis::AttributeManager
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
 

Protected Member Functions

 EdgeTypeManager ()
 constructor More...
 

Friends

class base::Singleton< EdgeTypeManager >
 

Detailed Description

Factory for Edge subclasses.

EdgeTypeManager allows to register edge classes by type

Member Typedef Documentation

◆ TypeMap

Constructor & Destructor Documentation

◆ EdgeTypeManager()

graph_analysis::EdgeTypeManager::EdgeTypeManager ( )
protected

constructor

Member Function Documentation

◆ createEdge() [1/2]

Edge::Ptr graph_analysis::EdgeTypeManager::createEdge ( const edge::Type &  type,
const std::string &  label = "",
bool  throwOnMissing = false 
)

clones a new edge of a specified type

Parameters
typethe requested edge type
labelthe requested edge label
throwOnMissingthrow when edge type is missing
Returns
smart pointer to the newly created edge instance

◆ createEdge() [2/2]

Edge::Ptr graph_analysis::EdgeTypeManager::createEdge ( const edge::Type &  type,
const Vertex::Ptr &  source,
const Vertex::Ptr &  target,
const std::string &  label = "",
bool  throwOnMissing = false 
)

◆ getAttributes()

std::vector< Attribute > graph_analysis::EdgeTypeManager::getAttributes ( const edge::Type &  type,
bool  includeLegacySupport = false 
) const

Compute the attributes of a given edge type

Parameters
typeEdge type
Returns
attribute list

◆ getAttributeValues()

std::vector< std::pair< Attribute::Id, std::string > > graph_analysis::EdgeTypeManager::getAttributeValues ( const Edge::Ptr &  edge) const

Get the value assignments for the attributes of an edge

◆ getDefaultType()

const std::string& graph_analysis::EdgeTypeManager::getDefaultType ( ) const
inline

Get the current default edge type

◆ getKnownAttributes()

std::vector< Attribute > graph_analysis::EdgeTypeManager::getKnownAttributes ( const std::set< std::string > &  classnames = std::set<std::string>()) const

◆ getSupportedTypes()

std::set< std::string > graph_analysis::EdgeTypeManager::getSupportedTypes ( ) const

lists the registered types

◆ getTypeHierarchy()

std::vector< std::string > graph_analysis::EdgeTypeManager::getTypeHierarchy ( const edge::Type &  type) const

Compute the class hierarchy for a given edge type, note that the type itself will also be part of the returned list

Parameters
typeEdge type for which the hierarchy should be retrieved
Returns
class hierarchy

◆ registerType() [1/3]

template<typename T , typename P = graph_analysis::Edge>
void graph_analysis::EdgeTypeManager::registerType ( bool  throwOnAlreadyRegistered = false)
inline

◆ registerType() [2/3]

void graph_analysis::EdgeTypeManager::registerType ( const Edge::Ptr &  edge,
const Edge::PtrList &  parents = Edge::PtrList(),
bool  throwOnAlreadyRegistered = false 
)

Register edge class

Parameters
edgeInstance of the registered type
parentsInstances of the parent types
throwOnAlreadyRegisteredIf true, then this function will throw std::runtime_error upon double registration

◆ registerType() [3/3]

void graph_analysis::EdgeTypeManager::registerType ( const edge::Type &  type,
const Edge::Ptr &  edge,
const Edge::PtrList &  parents = Edge::PtrList(),
bool  throwOnAlreadyRegistered = false 
)

◆ setDefaultType()

void graph_analysis::EdgeTypeManager::setDefaultType ( const std::string &  type)

Select the default edge type from the list of registered types

Friends And Related Function Documentation

◆ base::Singleton< EdgeTypeManager >

friend class base::Singleton< EdgeTypeManager >
friend

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