g2o
|
create vertices and edges based on TAGs in, for example, a file More...
#include <factory.h>
Classes | |
class | CreatorInformation |
Public Member Functions | |
void | registerType (const std::string &tag, AbstractHyperGraphElementCreator *c) |
void | unregisterType (const std::string &tag) |
HyperGraph::HyperGraphElement * | construct (const std::string &tag) const |
HyperGraph::HyperGraphElement * | construct (const std::string &tag, const HyperGraph::GraphElemBitset &elemsToConstruct) const |
bool | knowsTag (const std::string &tag, int *elementType=0) const |
const std::string & | tag (const HyperGraph::HyperGraphElement *v) const |
return the TAG given a vertex More... | |
void | fillKnownTypes (std::vector< std::string > &types) const |
void | printRegisteredTypes (std::ostream &os, bool comment=false) const |
Static Public Member Functions | |
static Factory * | instance () |
return the instance More... | |
static void | destroy () |
free the instance More... | |
Protected Types | |
typedef std::map< std::string, CreatorInformation * > | CreatorMap |
typedef std::map< std::string, std::string > | TagLookup |
Protected Member Functions | |
Factory () | |
~Factory () | |
Protected Attributes | |
CreatorMap | _creator |
look-up map for the existing creators More... | |
TagLookup | _tagLookup |
reverse look-up, class name to tag More... | |
Static Private Attributes | |
static Factory * | factoryInstance = 0 |
create vertices and edges based on TAGs in, for example, a file
|
protected |
|
protected |
|
protected |
Definition at line 45 of file factory.cpp.
|
protected |
Definition at line 49 of file factory.cpp.
HyperGraph::HyperGraphElement * g2o::Factory::construct | ( | const std::string & | tag | ) | const |
construct a graph element based on its tag
Definition at line 147 of file factory.cpp.
Referenced by g2o::CacheContainer::createCache(), g2o::EdgeCreator::createEdge(), g2o::ParameterContainer::read(), and g2o::OptimizableGraph::setFixed().
HyperGraph::HyperGraphElement * g2o::Factory::construct | ( | const std::string & | tag, |
const HyperGraph::GraphElemBitset & | elemsToConstruct | ||
) | const |
construct a graph element based on its tag, but only if it's type (a bitmask) matches. A bitmask without any bit set will construct any item. Otherwise a bit has to be set to allow construction of a graph element.
Definition at line 204 of file factory.cpp.
|
static |
void g2o::Factory::fillKnownTypes | ( | std::vector< std::string > & | types | ) | const |
get a list of all known types
Definition at line 166 of file factory.cpp.
|
static |
return the instance
Definition at line 61 of file factory.cpp.
Referenced by g2o::assignHierarchicalEdges(), g2o::BackBoneTreeAction::BackBoneTreeAction(), g2o::CacheContainer::createCache(), g2o::EdgeCreator::createEdge(), g2o::G2O_ATTRIBUTE_CONSTRUCTOR(), g2o::Cache::key(), g2o::ParameterContainer::read(), g2o::RegisterTypeProxy< T >::RegisterTypeProxy(), g2o::OptimizableGraph::saveEdge(), g2o::OptimizableGraph::saveParameter(), g2o::OptimizableGraph::saveUserData(), g2o::OptimizableGraph::saveVertex(), g2o::OptimizableGraph::setFixed(), g2o::OptimizableGraph::setRenamedTypesFromString(), g2o::ParameterContainer::write(), and g2o::RegisterTypeProxy< T >::~RegisterTypeProxy().
bool g2o::Factory::knowsTag | ( | const std::string & | tag, |
int * | elementType = 0 |
||
) | const |
return whether the factory knows this tag or not
Definition at line 173 of file factory.cpp.
Referenced by g2o::OptimizableGraph::setFixed(), and g2o::OptimizableGraph::setRenamedTypesFromString().
void g2o::Factory::printRegisteredTypes | ( | std::ostream & | os, |
bool | comment = false |
||
) | const |
print a list of the known registered types to the given stream
Definition at line 192 of file factory.cpp.
void g2o::Factory::registerType | ( | const std::string & | tag, |
AbstractHyperGraphElementCreator * | c | ||
) |
register a tag for a specific creator
Definition at line 73 of file factory.cpp.
References g2o::AbstractHyperGraphElementCreator::construct(), g2o::Factory::CreatorInformation::creator, g2o::Factory::CreatorInformation::elementTypeBit, HGET_CACHE, HGET_DATA, HGET_EDGE, HGET_PARAMETER, HGET_VERTEX, and g2o::AbstractHyperGraphElementCreator::name().
Referenced by g2o::G2O_ATTRIBUTE_CONSTRUCTOR(), and g2o::RegisterTypeProxy< T >::RegisterTypeProxy().
const std::string & g2o::Factory::tag | ( | const HyperGraph::HyperGraphElement * | v | ) | const |
return the TAG given a vertex
Definition at line 157 of file factory.cpp.
Referenced by g2o::EdgeCreator::createEdge(), g2o::Cache::key(), g2o::EdgeTypesCostFunction::operator()(), g2o::BackBoneTreeAction::perform(), g2o::OptimizableGraph::saveEdge(), g2o::OptimizableGraph::saveParameter(), g2o::OptimizableGraph::saveUserData(), g2o::OptimizableGraph::saveVertex(), g2o::ParameterContainer::write(), and g2o::Gm2dlIO::writeGm2dl().
void g2o::Factory::unregisterType | ( | const std::string & | tag | ) |
unregister a tag for a specific creator
Definition at line 128 of file factory.cpp.
References g2o::AbstractHyperGraphElementCreator::name().
Referenced by g2o::RegisterTypeProxy< T >::~RegisterTypeProxy().
|
protected |
|
protected |