RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtctk::componentFramework::RegisterFactory< BaseIf, Factory > Class Template Referencefinal

A helper class used to perform registration and deregistration of a factory. More...

#include <factoryRegistry.hpp>

Public Member Functions

 RegisterFactory ()
 
 ~RegisterFactory ()
 
 RegisterFactory (const RegisterFactory &)=delete
 
RegisterFactoryoperator= (const RegisterFactory &)=delete
 
 RegisterFactory (RegisterFactory &&)=delete
 
RegisterFactoryoperator= (RegisterFactory &&)=delete
 

Public Attributes

std::shared_ptr< FactoryRegistry< BaseIf > > m_registry
 
Factory m_factory
 

Detailed Description

template<class BaseIf, class Factory>
class rtctk::componentFramework::RegisterFactory< BaseIf, Factory >

A helper class used to perform registration and deregistration of a factory.

This class should be instantiated as a global variable, but only once for each template combination. Doing so will register the given factory when the library in which the global was instantiated is loaded, and deregister it when the library is unloaded or the process terminates.

The following is an example of the code that should be placed inside a source file of a module to register a new factory:

namespace {
class MyFactory : public FactoryRegistry<RuntimeRepoIf>::FactoryIf {
public:
...
};
} // namespace
A simple registry of various factory objects.
Definition factoryRegistry.hpp:46
A helper class used to perform registration and deregistration of a factory.
Definition factoryRegistry.hpp:186
Template Parameters
BaseIfThe abstract/base interface class of the service for which the factory will create instances.
FactoryThe class of the new factory being registered.

Constructor & Destructor Documentation

◆ RegisterFactory() [1/3]

template<class BaseIf, class Factory>
rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::RegisterFactory ( )

◆ ~RegisterFactory()

template<class BaseIf, class Factory>
rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::~RegisterFactory ( )

◆ RegisterFactory() [2/3]

template<class BaseIf, class Factory>
rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::RegisterFactory ( const RegisterFactory< BaseIf, Factory > & )
delete

◆ RegisterFactory() [3/3]

template<class BaseIf, class Factory>
rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::RegisterFactory ( RegisterFactory< BaseIf, Factory > && )
delete

Member Function Documentation

◆ operator=() [1/2]

template<class BaseIf, class Factory>
RegisterFactory & rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::operator= ( const RegisterFactory< BaseIf, Factory > & )
delete

◆ operator=() [2/2]

template<class BaseIf, class Factory>
RegisterFactory & rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::operator= ( RegisterFactory< BaseIf, Factory > && )
delete

Member Data Documentation

◆ m_factory

template<class BaseIf, class Factory>
Factory rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::m_factory

◆ m_registry

template<class BaseIf, class Factory>
std::shared_ptr<FactoryRegistry<BaseIf> > rtctk::componentFramework::RegisterFactory< BaseIf, Factory >::m_registry

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