OpenTREP Logo  0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
OPENTREP::FacSupervisor Class Reference

#include <opentrep/factory/FacSupervisor.hpp>

Public Types

typedef std::vector< FacBomAbstract * > BomFactoryPool_T
 
typedef std::vector< FacServiceAbstract * > ServiceFactoryPool_T
 

Public Member Functions

void registerBomFactory (FacBomAbstract *)
 
void registerServiceFactory (FacServiceAbstract *)
 
void registerXapianDBFactory (FacXapianDB *)
 
void registerLoggerService (Logger *)
 
void cleanBomLayer ()
 
void cleanServiceLayer ()
 
void cleanFacXapianDB ()
 
void cleanLoggerService ()
 
 ~FacSupervisor ()
 

Static Public Member Functions

static FacSupervisorinstance ()
 
static void cleanFactory ()
 

Protected Member Functions

 FacSupervisor ()
 
 FacSupervisor (const FacSupervisor &)
 

Detailed Description

Singleton class to register and clean all the factories.

Definition at line 21 of file FacSupervisor.hpp.

Member Typedef Documentation

◆ BomFactoryPool_T

Define the pool (list) of factories.

Definition at line 27 of file FacSupervisor.hpp.

◆ ServiceFactoryPool_T

Definition at line 28 of file FacSupervisor.hpp.

Constructor & Destructor Documentation

◆ ~FacSupervisor()

OPENTREP::FacSupervisor::~FacSupervisor ( )

Destructor The static instance is deleted (and reset to NULL) by the static cleanFactory() method.

Definition at line 52 of file FacSupervisor.cpp.

References cleanBomLayer(), cleanFactory(), cleanFacXapianDB(), cleanLoggerService(), and cleanServiceLayer().

◆ FacSupervisor() [1/2]

OPENTREP::FacSupervisor::FacSupervisor ( )
protected

Default Constructor. This constructor is protected to ensure the singleton pattern.

Definition at line 16 of file FacSupervisor.cpp.

Referenced by FacSupervisor(), and instance().

◆ FacSupervisor() [2/2]

OPENTREP::FacSupervisor::FacSupervisor ( const FacSupervisor & )
inlineprotected

Definition at line 120 of file FacSupervisor.hpp.

References FacSupervisor().

Member Function Documentation

◆ instance()

◆ registerBomFactory()

void OPENTREP::FacSupervisor::registerBomFactory ( FacBomAbstract * ioFacBomAbstract_ptr)

Register a newly instantiated concrete factory for the Bom layer. When a concrete Factory is firstly instantiated, this factory has to register itself to the FacSupervisor.

Parameters
FacAbstract&the concrete Factory to register.

Definition at line 30 of file FacSupervisor.cpp.

Referenced by OPENTREP::FacPlace::instance(), OPENTREP::FacPlaceHolder::instance(), OPENTREP::FacResult::instance(), OPENTREP::FacResultCombination::instance(), OPENTREP::FacResultHolder::instance(), and OPENTREP::FacWorld::instance().

◆ registerServiceFactory()

void OPENTREP::FacSupervisor::registerServiceFactory ( FacServiceAbstract * ioFacServiceAbstract_ptr)

Register a newly instantiated concrete factory for the Service layer. When a concrete Factory is firstly instantiated, this factory has to register itself to the FacSupervisor.

Parameters
FacServiceAbstract&the concrete Factory to register.

Definition at line 36 of file FacSupervisor.cpp.

Referenced by OPENTREP::FacOpenTrepServiceContext::instance().

◆ registerXapianDBFactory()

void OPENTREP::FacSupervisor::registerXapianDBFactory ( FacXapianDB * ioFacXapianDB_ptr)

Register a newly instantiated concrete factory for the FacXapianDB object. In fact, as the FacXapianDB object follows the singleton pattern, the concrete factory is the FacXapianDB object itself. When a concrete Factory is firstly instantiated, this factory has to register itself to the FacSupervisor.

Parameters
FacXapianDB*The concrete service/object to register.

Definition at line 42 of file FacSupervisor.cpp.

Referenced by OPENTREP::FacXapianDB::instance().

◆ registerLoggerService()

void OPENTREP::FacSupervisor::registerLoggerService ( Logger * ioLogger_ptr)

Register a newly instantiated concrete factory for the Logger object. In fact, as the Logger object follows the singleton pattern, the concrete factory is the Logger object itself. When a concrete Factory is firstly instantiated, this factory has to register itself to the FacSupervisor.

Parameters
Logger*The concrete service/object to register.

Definition at line 47 of file FacSupervisor.cpp.

◆ cleanBomLayer()

void OPENTREP::FacSupervisor::cleanBomLayer ( )

Clean all created object. Call the clean method of all the instantiated factories for the Bom layer.

Definition at line 64 of file FacSupervisor.cpp.

Referenced by ~FacSupervisor().

◆ cleanServiceLayer()

void OPENTREP::FacSupervisor::cleanServiceLayer ( )

Clean all Service created object. Call the clean method of all the instantiated factories for the Service layer.

Definition at line 78 of file FacSupervisor.cpp.

Referenced by ~FacSupervisor().

◆ cleanFacXapianDB()

void OPENTREP::FacSupervisor::cleanFacXapianDB ( )

Delete the FacXapianDB object.

Definition at line 92 of file FacSupervisor.cpp.

Referenced by ~FacSupervisor().

◆ cleanLoggerService()

void OPENTREP::FacSupervisor::cleanLoggerService ( )

Delete the Logger object.

Definition at line 97 of file FacSupervisor.cpp.

Referenced by ~FacSupervisor().

◆ cleanFactory()

void OPENTREP::FacSupervisor::cleanFactory ( )
static

Clean the static instance. The singleton is deleted.

Definition at line 102 of file FacSupervisor.cpp.

Referenced by ~FacSupervisor().


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