30 #include "g2o/config.h" 44 class AbstractHyperGraphElementCreator;
57 static void destroy();
67 void unregisterType(
const std::string& tag);
83 bool knowsTag(
const std::string& tag,
int* elementType = 0)
const;
91 void fillKnownTypes(std::vector<std::string>&
types)
const;
96 void printRegisteredTypes(std::ostream& os,
bool comment =
false)
const;
112 std::cout <<
"Deleting " << (
void*) creator << std::endl;
118 typedef std::map<std::string, CreatorInformation*>
CreatorMap;
136 #ifdef G2O_DEBUG_FACTORY 137 std::cout << __FUNCTION__ <<
": Registering " << _name <<
" of type " <<
typeid(T).name() << std::endl;
144 #ifdef G2O_DEBUG_FACTORY 145 std::cout << __FUNCTION__ <<
": Unregistering " << _name <<
" of type " <<
typeid(T).name() << std::endl;
154 #if defined _MSC_VER && defined G2O_SHARED_LIBS 155 # define G2O_FACTORY_EXPORT __declspec(dllexport) 156 # define G2O_FACTORY_IMPORT __declspec(dllimport) 158 # define G2O_FACTORY_EXPORT 159 # define G2O_FACTORY_IMPORT 163 #define G2O_REGISTER_TYPE(name, classname) \ 164 extern "C" void G2O_FACTORY_EXPORT g2o_type_##classname(void) {} \ 165 static g2o::RegisterTypeProxy<classname> g_type_proxy_##classname(#name); 167 #define G2O_USE_TYPE_BY_CLASS_NAME(classname) \ 168 extern "C" void G2O_FACTORY_IMPORT g2o_type_##classname(void); \ 169 static g2o::ForceLinker proxy_##classname(g2o_type_##classname); 171 #define G2O_REGISTER_TYPE_GROUP(typeGroupName) \ 172 extern "C" void G2O_FACTORY_EXPORT g2o_type_group_##typeGroupName(void) {} 174 #define G2O_USE_TYPE_GROUP(typeGroupName) \ 175 extern "C" void G2O_FACTORY_IMPORT g2o_type_group_##typeGroupName(void); \ 176 static g2o::ForceLinker g2o_force_type_link_##typeGroupName(g2o_type_group_##typeGroupName); stuff to open files and other unsorted components ProjectiveCamera types
static Factory * instance()
return the instance
some general case utility functions
TagLookup _tagLookup
reverse look-up, class name to tag
std::bitset< HyperGraph::HGET_NUM_ELEMS > GraphElemBitset
templatized creator class which creates graph elements
static Factory * factoryInstance
create vertices and edges based on TAGs in, for example, a file
CreatorMap _creator
look-up map for the existing creators
RegisterTypeProxy(const std::string &name)
void unregisterType(const std::string &tag)
std::map< std::string, CreatorInformation * > CreatorMap
void registerType(const std::string &tag, AbstractHyperGraphElementCreator *c)
Abstract interface for allocating HyperGraphElement.
std::map< std::string, std::string > TagLookup