Factory for Vertex subclasses.
More...
#include <VertexTypeManager.hpp>
|
| void | setDefaultType (const std::string &type) |
| |
| const std::string & | getDefaultType () const |
| |
| template<typename T , typename P = graph_analysis::Vertex> |
| void | registerType (bool throwOnAlreadyRegistered=false) |
| |
| void | registerType (const Vertex::Ptr &vertex, const Vertex::PtrList &parents=Vertex::PtrList(), bool throwOnAlreadyRegistered=false) |
| |
| void | registerType (const vertex::Type &type, const Vertex::Ptr &vertex, const Vertex::PtrList &parents=Vertex::PtrList(), bool throwOnAlreadyRegistered=false) |
| |
| Vertex::Ptr | createVertex (const vertex::Type &type, const std::string &label=std::string(), bool throwOnMissing=false) |
| | clones a new vertex of a specified type More...
|
| |
| std::set< std::string > | getSupportedTypes () const |
| |
| std::vector< std::string > | getTypeHierarchy (const vertex::Type &type) const |
| |
| std::vector< Attribute > | getKnownAttributes (const std::set< std::string > &classnames=std::set< std::string >()) const |
| |
| std::vector< Attribute > | getAttributes (const vertex::Type &classname, bool includeLegacySupport=false) const |
| |
| std::vector< std::pair< Attribute::Id, std::string > > | getAttributeValues (const Vertex::Ptr &vertex) const |
| |
| 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 |
| |
Factory for Vertex subclasses.
VertexTypeManager allows to register vertex classes by type
- which is a given string. When loading a serialized graph via GraphIO::read the VertexTypeManager allows to instanciate vertices corresponding to the given class type – which has to match the type string. Instanciation is done via cloning the corresponding vertex instance.
◆ TypeMap
◆ VertexTypeManager()
| graph_analysis::VertexTypeManager::VertexTypeManager |
( |
| ) |
|
|
protected |
◆ createVertex()
| Vertex::Ptr graph_analysis::VertexTypeManager::createVertex |
( |
const vertex::Type & |
type, |
|
|
const std::string & |
label = std::string(), |
|
|
bool |
throwOnMissing = false |
|
) |
| |
clones a new vertex of a specified type
- Parameters
-
| type | the requested vertex type |
| label | the requested vertex label |
| throwOnMissing | Throw exception when the vertex type is unknown, otherwise a default vertex will be created |
- Returns
- smart pointer to the newly created vertex instance
◆ getAttributes()
| std::vector< Attribute > graph_analysis::VertexTypeManager::getAttributes |
( |
const vertex::Type & |
classname, |
|
|
bool |
includeLegacySupport = false |
|
) |
| const |
Get all attributes that are associated with a registered type
- Parameters
-
| classname | retrieve attributes only for the given classname |
- See also
- AttributeManager::getAttributeName to retrieve information for an individual attribute
◆ getAttributeValues()
| std::vector< std::pair< Attribute::Id, std::string > > graph_analysis::VertexTypeManager::getAttributeValues |
( |
const Vertex::Ptr & |
vertex | ) |
const |
Retrieve the attribute data for a particular vertex
- Returns
- value assignments for the attributes of a vertex
◆ getDefaultType()
| const std::string& graph_analysis::VertexTypeManager::getDefaultType |
( |
| ) |
const |
|
inline |
Get the default vertex type
◆ getKnownAttributes()
| std::vector< Attribute > graph_analysis::VertexTypeManager::getKnownAttributes |
( |
const std::set< std::string > & |
classnames = std::set<std::string>() | ) |
const |
Get all attributes that are associated with the registered types
- Parameters
-
| classnames | generate the known attributes only for the given classnames |
- See also
- AttributeManager::getAttributes to retrieve information for an individual attribute
◆ getSupportedTypes()
| std::set< std::string > graph_analysis::VertexTypeManager::getSupportedTypes |
( |
| ) |
const |
Lists the registered types
- Returns
- list of registered types
◆ getTypeHierarchy()
| std::vector< std::string > graph_analysis::VertexTypeManager::getTypeHierarchy |
( |
const vertex::Type & |
type | ) |
const |
Compute the class hierarchy for a given vertex type, note that the type itself will also be part of the returned list
- Parameters
-
| type | Vertex type for which the hierarchy should be retrieved |
- Returns
- class hierarchy
◆ registerType() [1/3]
template<typename T , typename P = graph_analysis::Vertex>
| void graph_analysis::VertexTypeManager::registerType |
( |
bool |
throwOnAlreadyRegistered = false | ) |
|
|
inline |
◆ registerType() [2/3]
Register vertex class
- Parameters
-
| vertex | Instance of the registered type |
| parents | Instances of the parent types |
| throwOnAlreadyRegistered | If true, then this function will throw std::runtime_error upon double registration |
◆ registerType() [3/3]
◆ setDefaultType()
| void graph_analysis::VertexTypeManager::setDefaultType |
( |
const std::string & |
type | ) |
|
Select the default vertex type from the list of registered types
◆ base::Singleton< VertexTypeManager >
The documentation for this class was generated from the following files: