Factory for Vertex subclasses.
More...
#include <VertexTypeManager.hpp>
|
| void | setDefaultType (const std::string &type) |
| |
| const std::string & | getDefaultType () const |
| |
| void | registerType (const Vertex::Ptr &vertex, bool throwOnAlreadyRegistered=false) |
| |
| void | registerType (const vertex::Type &type, const Vertex::Ptr &vertex, 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< Attribute > | getKnownAttributes (const std::set< std::string > &classnames=std::set< std::string >()) 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 > | getAttributes (const std::string &vertexTypeName) const |
| | returns all registered members for the given vertex More...
|
| |
| io::AttributeSerializationCallbacks | getAttributeSerializationCallbacks (const std::string &typeName, const std::string &attributeName) 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
◆ 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
◆ registerType() [1/2]
| void graph_analysis::VertexTypeManager::registerType |
( |
const Vertex::Ptr & |
vertex, |
|
|
bool |
throwOnAlreadyRegistered = false |
|
) |
| |
◆ registerType() [2/2]
| void graph_analysis::VertexTypeManager::registerType |
( |
const vertex::Type & |
type, |
|
|
const Vertex::Ptr & |
vertex, |
|
|
bool |
throwOnAlreadyRegistered = false |
|
) |
| |
◆ 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: