Karlsruhe Institute of Technology (KIT) Logo

Master Motor Map

Whole-body human reference model and tools for unifying representations of whole-body human motion

Public Member Functions
MMM::ConverterFactory Class Referenceabstract

#include <ConverterFactory.h>

Inheritance diagram for MMM::ConverterFactory:
[legend]

Public Member Functions

virtual ConverterPtr createConverter ()=0
 
- Public Member Functions inherited from MMM::AbstractFactoryMethod< ConverterFactory, void * >
bool checkBase ()
 Checks if the Plugin is valid base class.
 
std::string getDescription () const
 Return the description of the current instance.
 
std::string getPath () const
 Return the path of the current instance.
 
void setDescription (const std::string &newDescription)
 Set a description on the instance it is called on.
 
void setPath (const std::string &path)
 Set a path on the instance it is called on.
 

Additional Inherited Members

- Public Types inherited from MMM::AbstractFactoryMethod< ConverterFactory, void * >
typedef std::shared_ptr< ConverterFactory >(* initialisationFunction) (void *)
 The function pointer type of subclass initialisation functions. More...
 
- Static Public Member Functions inherited from MMM::AbstractFactoryMethod< ConverterFactory, void * >
static std::shared_ptr< ConverterFactorycreateInstance (void *)
 Initialisation function which needs to be provided by every subclass. More...
 
static std::shared_ptr< ConverterFactoryfirst (void * params)
 Function which can be used to retrieve the first registered object.
 
static std::shared_ptr< ConverterFactoryfromName (const std::string &name, void * params)
 Function which can be used to retrieve an object specified by string name.
 
static std::string getName ()
 Returns the class's name. More...
 
static std::vector< std::string > getSubclassList ()
 Return a list of all registered subclasses.
 
static void registerClass (const std::string &name, initialisationFunction init)
 Statically called by subclasses to register their name and initialisation function so they can be found by fromName.
 

Detailed Description

This Factory is used to make custom converters accessible by the MMM framework. An exemplary implementation may look like this

// The header MyCustomConverterFactory.h
namespace MMM
{
class MMM_IMPORT_EXPORT MyCustomConverterFactory : public ConverterFactory
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
MyConverterFactory() ;
virtual ~MyConverterFactory();
virtual ConverterPtr createConverter();
static std::string getName() {return "MyCustomConverterFactory"};
static std::shared_ptr<ConverterFactory> createInstance(void*);
private:
static SubClassRegistry registry;
};
typedef std::shared_ptr<MyCustomConverterFactory> MyCustomConverterFactoryPtr;
}
// The source MyCustomConverterFactory.cpp
#include "MyCustomConverterFactory.h"
#include <boost/extension/shared_library.hpp>
#include <boost/function.hpp>
namespace MMM
{
// register this factory, so that is accessible within the API
ConverterFactory::SubClassRegistry MyCustomConverterFactory::registry(MyCustomConverterFactory::getName(), &MyCustomConverterFactory::createInstance);
MyConverterFactory::MyConverterFactory()
{
// some init code
}
MyConverterFactory::~MyConverterFactory()
{
// some exit code
}
ConverterPtr MyConverterFactory::createConverter()
{
ConverterPtr converter(new MyCustomConverter());
return converter;
}
std::shared_ptr<ConverterFactory> MyConverterFactory::createInstance(void*)
{
std::shared_ptr<ConverterFactory> converterFactory(new MyCustomConverterFactory());
return converterFactory;
}
}
// Enable Plugin mechanism, that allows the MMMConverter tool to load this converter
// The MMMConverter expects a getFactory method which is used to initialize the custom converter factory
extern "C"
BOOST_EXTENSION_EXPORT_DECL ConverterFactoryPtr getFactory() {
MyConverterFactoryPtr f(new MyConverterFactory());
return f;
}

The documentation for this class was generated from the following file:
MMM::AbstractFactoryMethod< ConverterFactory, void * >::createInstance
static std::shared_ptr< ConverterFactory > createInstance(void *)
Initialisation function which needs to be provided by every subclass.
Definition: AbstractFactoryMethod.h:88
MMM
A template that can be used as a superclass of a class hierarchy that wants to provide a factory meth...
Definition: AbstractFactoryMethod.h:28
MMM::AbstractFactoryMethod< ConverterFactory, void * >::getName
static std::string getName()
Returns the class's name.
Definition: AbstractFactoryMethod.h:78
KoroiBot Logo WALK-MAN Logo Xperience Logo SecondHands Logo TimeStorm Logo I-SUPPORT Logo
PACO-PLUS Logo SFB-588 Logo SPP1527 Logo