27#ifndef G2O_ROBUST_KERNEL_FACTORY_H
28#define G2O_ROBUST_KERNEL_FACTORY_H
53 using Ptr = std::shared_ptr<AbstractRobustKernelCreator>;
106 typedef std::map<std::string, AbstractRobustKernelCreator::Ptr>
CreatorMap;
129#if defined _MSC_VER && defined G2O_SHARED_LIBS
130#define G2O_ROBUST_KERNEL_FACTORY_EXPORT __declspec(dllexport)
131#define G2O_ROBUST_KERNEL_FACTORY_IMPORT __declspec(dllimport)
133#define G2O_ROBUST_KERNEL_FACTORY_EXPORT
134#define G2O_ROBUST_KERNEL_FACTORY_IMPORT
139#define G2O_REGISTER_ROBUST_KERNEL(name, classname) \
140 extern "C" void G2O_ROBUST_KERNEL_FACTORY_EXPORT \
141 g2o_robust_kernel_##classname(void) {} \
142 static g2o::RegisterRobustKernelProxy<classname> \
143 g_robust_kernel_proxy_##classname(#name);
145#define G2O_USE_ROBUST_KERNEL(classname) \
146 extern "C" void G2O_ROBUST_KERNEL_FACTORY_IMPORT \
147 g2o_robust_kernel_##classname(void); \
148 static g2o::ForceLinker g2o_force_robust_kernel_link_##classname( \
149 g2o_robust_kernel_##classname);
Abstract interface for allocating a robust kernel.
std::shared_ptr< AbstractRobustKernelCreator > Ptr
virtual RobustKernel * construct()=0
virtual ~AbstractRobustKernelCreator()
RegisterRobustKernelProxy(const std::string &name)
templatized creator class which creates graph elements
RobustKernel * construct()
RobustKernel * construct(const std::string &tag) const
void fillKnownKernels(std::vector< std::string > &types) const
void registerRobustKernel(const std::string &tag, const AbstractRobustKernelCreator::Ptr &c)
AbstractRobustKernelCreator * creator(const std::string &tag) const
RobustKernelFactory & operator=(RobustKernelFactory const &)=delete
RobustKernelFactory()=default
std::map< std::string, AbstractRobustKernelCreator::Ptr > CreatorMap
static void destroy()
free the instance
static RobustKernelFactory * instance()
return the instance
RobustKernelFactory(RobustKernelFactory const &)=delete
static std::unique_ptr< RobustKernelFactory > factoryInstance
void unregisterType(const std::string &tag)
CreatorMap _creator
look-up map for the existing creators
base for all robust cost functions
some general case utility functions