LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::ObjectManager< Object > Class Template Referenceabstract

Manager for objects. More...

#include <common/AbstractFactoryPattern/ObjectManager.h>

Inheritance diagram for Lima::ObjectManager< Object >:
Lima::InitializableObjectManager< Object, InitializationParameters >

Public Member Functions

virtual ~ObjectManager ()
 ObjectManager destructor.
 
virtual std::shared_ptr< Object > getObject (const std::string &id)
 If object doesn't exists, call the create method.
 

Protected Member Functions

virtual std::shared_ptr< Object > createObject (const std::string &id)=0
 create the required object.
 

Detailed Description

template<typename Object>
class Lima::ObjectManager< Object >

Manager for objects.

The manager create object when necessary, store them, avoiding to create same object twice.

Manager for Objects

Parameters
Objectsto manage

Definition at line 29 of file ObjectManager.h.

Constructor & Destructor Documentation

◆ ~ObjectManager()

template<typename Object >
Lima::ObjectManager< Object >::~ObjectManager ( )
virtual

ObjectManager destructor.

Definition at line 65 of file ObjectManager.h.

Member Function Documentation

◆ createObject()

template<typename Object >
virtual std::shared_ptr< Object > Lima::ObjectManager< Object >::createObject ( const std::string &  id)
protectedpure virtual

create the required object.

Parameters
idId of the object to return
Returns
pointer to object corresponding to id
Exceptions
InvalidConfigurationif failed to create object from given configuration

Implemented in Lima::InitializableObjectManager< Object, InitializationParameters >.

◆ getObject()

template<typename Object >
std::shared_ptr< Object > Lima::ObjectManager< Object >::getObject ( const std::string &  id)
virtual

If object doesn't exists, call the create method.

get object of the given id

Parameters
idId of the object to return
Returns
pointer to object corresponding to id
Exceptions
InvalidConfigurationif failed to create object from given configuration

Definition at line 78 of file ObjectManager.h.


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