Visual Servoing Platform  version 3.6.1 under development (2025-02-14)
vpDynamicFactory< T > Class Template Reference

#include <visp3/rbt/vpDynamicFactory.h>

Public Member Functions

void registerType (const std::string &key, const std::function< std::shared_ptr< T >(const nlohmann::json &)> &function)
 
void registerTypeRaw (const std::string &key, const std::function< std::shared_ptr< T >(const std::string &)> function)
 
std::shared_ptr< T > buildFromJson (const nlohmann::json &j)
 
void setJsonKeyFinder (const std::function< std::string(const nlohmann::json &)> &finderFn)
 
virtual ~vpDynamicFactory ()
 

Protected Member Functions

 vpDynamicFactory ()=default
 

Protected Attributes

std::map< std::string, std::function< std::shared_ptr< T >const nlohmann::json &)> > m_jsonBuilders
 
std::map< std::string, std::function< std::shared_ptr< T >const std::string &)> > m_jsonRawBuilders
 
std::function< std::string(const nlohmann::json &)> m_keyFinder
 

Detailed Description

template<typename T>
class vpDynamicFactory< T >

Definition at line 50 of file vpDynamicFactory.h.

Constructor & Destructor Documentation

◆ ~vpDynamicFactory()

template<typename T >
virtual vpDynamicFactory< T >::~vpDynamicFactory ( )
inlinevirtual

Definition at line 96 of file vpDynamicFactory.h.

◆ vpDynamicFactory()

template<typename T >
vpDynamicFactory< T >::vpDynamicFactory ( )
protecteddefault

Member Function Documentation

◆ buildFromJson()

template<typename T >
std::shared_ptr<T> vpDynamicFactory< T >::buildFromJson ( const nlohmann::json &  j)
inline

Definition at line 73 of file vpDynamicFactory.h.

Referenced by vpRBTracker::loadConfiguration().

◆ registerType()

template<typename T >
void vpDynamicFactory< T >::registerType ( const std::string &  key,
const std::function< std::shared_ptr< T >(const nlohmann::json &)> &  function 
)
inline

Definition at line 54 of file vpDynamicFactory.h.

References vpException::badValue.

◆ registerTypeRaw()

template<typename T >
void vpDynamicFactory< T >::registerTypeRaw ( const std::string &  key,
const std::function< std::shared_ptr< T >(const std::string &)>  function 
)
inline

Definition at line 62 of file vpDynamicFactory.h.

References vpException::badValue.

◆ setJsonKeyFinder()

template<typename T >
void vpDynamicFactory< T >::setJsonKeyFinder ( const std::function< std::string(const nlohmann::json &)> &  finderFn)
inline

Definition at line 90 of file vpDynamicFactory.h.

Member Data Documentation

◆ m_jsonBuilders

template<typename T >
std::map<std::string, std::function<std::shared_ptr<T>const nlohmann::json &)> > vpDynamicFactory< T >::m_jsonBuilders
protected

Definition at line 102 of file vpDynamicFactory.h.

◆ m_jsonRawBuilders

template<typename T >
std::map<std::string, std::function<std::shared_ptr<T>const std::string &)> > vpDynamicFactory< T >::m_jsonRawBuilders
protected

Definition at line 103 of file vpDynamicFactory.h.

◆ m_keyFinder

template<typename T >
std::function<std::string(const nlohmann::json &)> vpDynamicFactory< T >::m_keyFinder
protected

Definition at line 105 of file vpDynamicFactory.h.