RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf Class Referenceabstract

The base class for all factory objects that are registered in the FactoryRegistry. More...

#include <factoryRegistry.hpp>

Inheritance diagram for rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf:
rtctk::componentFramework::RepositoryFactory< BaseIf, Adapter >

Public Types

using AdapterIdType = typename BaseIf::AdapterIdType
 

Public Member Functions

 FactoryIf ()=default
 
virtual ~FactoryIf ()=default
 
virtual bool CanHandle (const AdapterIdType &id) const =0
 Check if this factory is compatible with the given service identifier.
 
virtual std::unique_ptr< BaseIfCreateInstance (const AdapterIdType &id) const =0
 Create a new adapter instance to access the service specified by the given identifier.
 

Detailed Description

template<class BaseIf>
class rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf

The base class for all factory objects that are registered in the FactoryRegistry.

A factory deriving from this class will create new instances of a specific service adapter in CreateInstance to handle the service identifiers it recognises as compatible in CanHandle.

Member Typedef Documentation

◆ AdapterIdType

template<class BaseIf >
using rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf::AdapterIdType = typename BaseIf::AdapterIdType

Constructor & Destructor Documentation

◆ FactoryIf()

template<class BaseIf >
rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf::FactoryIf ( )
default

◆ ~FactoryIf()

template<class BaseIf >
virtual rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf::~FactoryIf ( )
virtualdefault

Member Function Documentation

◆ CanHandle()

template<class BaseIf >
virtual bool rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf::CanHandle ( const AdapterIdType & id) const
pure virtual

Check if this factory is compatible with the given service identifier.

A compatible factory means that it is able to create new adapter instances for the given service identifier.

Parameters
[in]idThe service identifier to check for compatibility.
Returns
true if the factory supports the identifier and false otherwise.
Thread Safety
thread-safe

◆ CreateInstance()

template<class BaseIf >
virtual std::unique_ptr< BaseIf > rtctk::componentFramework::FactoryRegistry< BaseIf >::FactoryIf::CreateInstance ( const AdapterIdType & id) const
pure virtual

Create a new adapter instance to access the service specified by the given identifier.

Parameters
[in]idThe identifier to the service.
Returns
A unique pointer holding the instance to the adapter used to access the service.
Exceptions
RtctkExceptionAn exception deriving from RtctkException, and possibly nested, will be thrown if this method failed to create a new instance.
Thread Safety
thread-safe

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