g2o
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
g2o::RobustKernelFactory Class Reference

create robust kernels based on their human readable name More...

#include <robust_kernel_factory.h>

Collaboration diagram for g2o::RobustKernelFactory:
Collaboration graph
[legend]

Public Member Functions

void registerRobustKernel (const std::string &tag, AbstractRobustKernelCreator *c)
 
void unregisterType (const std::string &tag)
 
RobustKernelconstruct (const std::string &tag) const
 
AbstractRobustKernelCreatorcreator (const std::string &tag) const
 
void fillKnownKernels (std::vector< std::string > &types) const
 

Static Public Member Functions

static RobustKernelFactoryinstance ()
 return the instance More...
 
static void destroy ()
 free the instance More...
 

Protected Types

typedef std::map< std::string, AbstractRobustKernelCreator * > CreatorMap
 

Protected Member Functions

 RobustKernelFactory ()
 
 ~RobustKernelFactory ()
 

Protected Attributes

CreatorMap _creator
 look-up map for the existing creators More...
 

Static Private Attributes

static RobustKernelFactoryfactoryInstance = 0
 

Detailed Description

create robust kernels based on their human readable name

Definition at line 68 of file robust_kernel_factory.h.

Member Typedef Documentation

typedef std::map<std::string, AbstractRobustKernelCreator*> g2o::RobustKernelFactory::CreatorMap
protected

Definition at line 105 of file robust_kernel_factory.h.

Constructor & Destructor Documentation

g2o::RobustKernelFactory::RobustKernelFactory ( )
protected

Definition at line 38 of file robust_kernel_factory.cpp.

39 {
40 }
g2o::RobustKernelFactory::~RobustKernelFactory ( )
protected

Definition at line 42 of file robust_kernel_factory.cpp.

43 {
44  for (CreatorMap::iterator it = _creator.begin(); it != _creator.end(); ++it) {
45  delete it->second;
46  }
47  _creator.clear();
48 }
CreatorMap _creator
look-up map for the existing creators

Member Function Documentation

RobustKernel * g2o::RobustKernelFactory::construct ( const std::string &  tag) const

construct a robust kernel based on its tag

Definition at line 80 of file robust_kernel_factory.cpp.

81 {
82  CreatorMap::const_iterator foundIt = _creator.find(tag);
83  if (foundIt != _creator.end()) {
84  return foundIt->second->construct();
85  }
86  return 0;
87 }
CreatorMap _creator
look-up map for the existing creators
AbstractRobustKernelCreator * g2o::RobustKernelFactory::creator ( const std::string &  tag) const

return the creator for a specific tag

Definition at line 89 of file robust_kernel_factory.cpp.

90 {
91  CreatorMap::const_iterator foundIt = _creator.find(tag);
92  if (foundIt != _creator.end()) {
93  return foundIt->second;
94  }
95  return 0;
96 }
CreatorMap _creator
look-up map for the existing creators
void g2o::RobustKernelFactory::destroy ( )
static

free the instance

Definition at line 105 of file robust_kernel_factory.cpp.

106 {
107  delete factoryInstance;
108  factoryInstance = 0;
109 }
static RobustKernelFactory * factoryInstance
void g2o::RobustKernelFactory::fillKnownKernels ( std::vector< std::string > &  types) const

get a list of all known robust kernels

Definition at line 98 of file robust_kernel_factory.cpp.

99 {
100  types.clear();
101  for (CreatorMap::const_iterator it = _creator.begin(); it != _creator.end(); ++it)
102  types.push_back(it->first);
103 }
stuff to open files and other unsorted components ProjectiveCamera types
CreatorMap _creator
look-up map for the existing creators
RobustKernelFactory * g2o::RobustKernelFactory::instance ( )
static
void g2o::RobustKernelFactory::registerRobustKernel ( const std::string &  tag,
AbstractRobustKernelCreator c 
)

register a tag for a specific creator

Definition at line 59 of file robust_kernel_factory.cpp.

Referenced by g2o::RegisterRobustKernelProxy< T >::RegisterRobustKernelProxy().

60 {
61  CreatorMap::const_iterator foundIt = _creator.find(tag);
62  if (foundIt != _creator.end()) {
63  cerr << "RobustKernelFactory WARNING: Overwriting robust kernel tag " << tag << endl;
64  assert(0);
65  }
66 
67  _creator[tag] = c;
68 }
CreatorMap _creator
look-up map for the existing creators
void g2o::RobustKernelFactory::unregisterType ( const std::string &  tag)

unregister a tag for a specific creator

Definition at line 70 of file robust_kernel_factory.cpp.

Referenced by g2o::RegisterRobustKernelProxy< T >::~RegisterRobustKernelProxy().

71 {
72  CreatorMap::iterator tagPosition = _creator.find(tag);
73  if (tagPosition != _creator.end()) {
74  AbstractRobustKernelCreator* c = tagPosition->second;
75  delete c;
76  _creator.erase(tagPosition);
77  }
78 }
CreatorMap _creator
look-up map for the existing creators

Member Data Documentation

CreatorMap g2o::RobustKernelFactory::_creator
protected

look-up map for the existing creators

Definition at line 109 of file robust_kernel_factory.h.

RobustKernelFactory * g2o::RobustKernelFactory::factoryInstance = 0
staticprivate

Definition at line 112 of file robust_kernel_factory.h.


The documentation for this class was generated from the following files: