create vertices and edges based on TAGs in, for example, a file More...
#include <factory.h>
Classes | |
class | CreatorInformation |
Public Member Functions | |
HyperGraph::HyperGraphElement * | construct (const std::string &tag) const |
HyperGraph::HyperGraphElement * | construct (const std::string &tag, const HyperGraph::GraphElemBitset &elemsToConstruct) const |
void | fillKnownTypes (std::vector< std::string > &types) const |
bool | knowsTag (const std::string &tag, int *elementType=0) const |
void | printRegisteredTypes (std::ostream &os, bool comment=false) const |
void | registerType (const std::string &tag, AbstractHyperGraphElementCreator *c) |
const std::string & | tag (const HyperGraph::HyperGraphElement *v) const |
return the TAG given a vertex More... | |
void | unregisterType (const std::string &tag) |
Static Public Member Functions | |
static void | destroy () |
free the instance More... | |
static Factory * | instance () |
return 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.
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 |
free the instance
Definition at line 186 of file factory.cpp.
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.
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.
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.
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.
void g2o::Factory::unregisterType | ( | const std::string & | tag | ) |
unregister a tag for a specific creator
Definition at line 128 of file factory.cpp.
|
protected |
|
protected |