LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::RegistrableFactory< Factory > Class Template Reference

Defines a Factory that automatically register to a MainFactory singleton. More...

#include <common/AbstractFactoryPattern/RegistrableFactory.h>

Inheritance diagram for Lima::RegistrableFactory< Factory >:
Lima::InitializableObjectFactory< MediaProcessUnit > Lima::InitializableObjectFactory< Base > Lima::LinguisticProcessing::PosTagger::DynamicSvmToolPosTaggerFactory Lima::LinguisticProcessing::PosTagger::SvmToolPosTaggerFactory Lima::LinguisticProcessing::PosTagger::ViterbiPosTaggerFactory Lima::SimpleFactory< Base, Object >

Public Member Functions

virtual ~RegistrableFactory ()=default
 

Static Public Member Functions

static std::shared_ptr< Factory > getFactory (const std::string &id)
 get the factory corresponding to the given id
 
static std::deque< std::string > getRegisteredFactories ()
 get the list of factories registered
 

Protected Member Functions

 RegistrableFactory (const std::string &id)
 Constructor is protected, and must be redefined by subclass.
 

Detailed Description

template<typename Factory>
class Lima::RegistrableFactory< Factory >

Defines a Factory that automatically register to a MainFactory singleton.

Defines a template for a factory that automatically register to a MainFactory. The registered factories can be retreived by the static method getFactory

Author
Benoit Mathieu mathi.nosp@m.eub@.nosp@m.zoe.c.nosp@m.ea.f.nosp@m.r
Parameters
Factoryis the kind of Factory to register

Definition at line 31 of file RegistrableFactory.h.

Constructor & Destructor Documentation

◆ ~RegistrableFactory()

template<typename Factory >
virtual Lima::RegistrableFactory< Factory >::~RegistrableFactory ( )
virtualdefault

◆ RegistrableFactory()

template<typename Factory >
Lima::RegistrableFactory< Factory >::RegistrableFactory ( const std::string &  id)
protected

Constructor is protected, and must be redefined by subclass.

Parameters
idId to use to register

Definition at line 60 of file RegistrableFactory.h.

Member Function Documentation

◆ getFactory()

template<typename Factory >
std::shared_ptr< Factory > Lima::RegistrableFactory< Factory >::getFactory ( const std::string &  id)
static

get the factory corresponding to the given id

Parameters
idId of Factory to get
Returns
Factory*

Definition at line 67 of file RegistrableFactory.h.

◆ getRegisteredFactories()

template<typename Factory >
std::deque< std::string > Lima::RegistrableFactory< Factory >::getRegisteredFactories ( )
static

get the list of factories registered

Returns
deque of all ids of registered factories

Definition at line 80 of file RegistrableFactory.h.


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