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

Factory for an OPENTREP_ServiceContext object. More...

#include <opentrep/factory/FacOpenTrepServiceContext.hpp>

+ Inheritance diagram for OPENTREP::FacOpenTrepServiceContext:

Public Types

typedef std::vector< ServiceAbstract * > ServicePool_T
 

Public Member Functions

 ~FacOpenTrepServiceContext ()
 
OPENTREP_ServiceContextcreate (const TravelDBFilePath_T &, const DBType &, const SQLDBConnectionString_T &, const DeploymentNumber_T &)
 
OPENTREP_ServiceContextcreate (const PORFilePath_T &, const TravelDBFilePath_T &, const DBType &, const SQLDBConnectionString_T &, const DeploymentNumber_T &, const shouldIndexNonIATAPOR_T &, const shouldIndexPORInXapian_T &, const shouldAddPORInSQLDB_T &)
 
void clean ()
 

Static Public Member Functions

static FacOpenTrepServiceContextinstance ()
 

Protected Member Functions

 FacOpenTrepServiceContext ()
 

Protected Attributes

ServicePool_T _pool
 

Detailed Description

Factory for an OPENTREP_ServiceContext object.

Definition at line 20 of file FacOpenTrepServiceContext.hpp.

Member Typedef Documentation

◆ ServicePool_T

Define the list (pool) of Service objects.

Definition at line 20 of file FacServiceAbstract.hpp.

Constructor & Destructor Documentation

◆ ~FacOpenTrepServiceContext()

OPENTREP::FacOpenTrepServiceContext::~FacOpenTrepServiceContext ( )

Destructor.

The Destruction put the _instance to NULL in order to be clean for the next FacOpentrepServiceContext::instance()

Definition at line 17 of file FacOpenTrepServiceContext.cpp.

◆ FacOpenTrepServiceContext()

OPENTREP::FacOpenTrepServiceContext::FacOpenTrepServiceContext ( )
inlineprotected

Default Constructor.

This constructor is protected in order to ensure the singleton pattern.

Definition at line 88 of file FacOpenTrepServiceContext.hpp.

Referenced by instance().

Member Function Documentation

◆ instance()

FacOpenTrepServiceContext & OPENTREP::FacOpenTrepServiceContext::instance ( )
static

Provide the unique instance.

The singleton is instantiated when first used

Returns
FacOpentrepServiceContext&

Definition at line 22 of file FacOpenTrepServiceContext.cpp.

References FacOpenTrepServiceContext(), OPENTREP::FacSupervisor::instance(), and OPENTREP::FacSupervisor::registerServiceFactory().

◆ create() [1/2]

OPENTREP_ServiceContext & OPENTREP::FacOpenTrepServiceContext::create ( const TravelDBFilePath_T & iTravelDBFilePath,
const DBType & iSQLDBType,
const SQLDBConnectionString_T & iSQLDBConnStr,
const DeploymentNumber_T & iDeploymentNumber )

Create a new OPENTREP_ServiceContext object for search-related services.

This new object is added to the list of instantiated objects.

Parameters
constTravelDBFilePath_T& File-path of the Xapian database.
constDBType& SQL database type (can be no database at all).
constSQLDBConnectionString_T& SQL DB connection string.
constDeploymentNumber_T& Deployment number.
Returns
OPENTREP_ServiceContext& The newly created object.

Definition at line 34 of file FacOpenTrepServiceContext.cpp.

References OPENTREP::FacServiceAbstract::_pool.

◆ create() [2/2]

OPENTREP_ServiceContext & OPENTREP::FacOpenTrepServiceContext::create ( const PORFilePath_T & iPORFilePath,
const TravelDBFilePath_T & iTravelDBFilePath,
const DBType & iSQLDBType,
const SQLDBConnectionString_T & iSQLDBConnStr,
const DeploymentNumber_T & iDeploymentNumber,
const shouldIndexNonIATAPOR_T & iShouldIndexNonIATAPOR,
const shouldIndexPORInXapian_T & iShouldIndexPORInXapian,
const shouldAddPORInSQLDB_T & iShouldAddPORInSQLDB )

Create a new OPENTREP_ServiceContext object for indexing-related services.

This new object is added to the list of instantiated objects.

Parameters
constPORFilePath_T& File-path of the POR file.
constTravelDBFilePath_T& File-path of the Xapian database.
constDBType& SQL database type (can be no database at all).
constSQLDBConnectionString_T& SQL DB connection string.
constDeploymentNumber_T& Deployment number.
constshouldIndexNonIATAPOR_T& Whether to include non-IATA POR.
constDeploymentNumber_T& Deployment number/version.
constshouldIndexNonIATAPOR_T& Whether to include non-IATA POR.
Returns
OPENTREP_ServiceContext& The newly created object.

Definition at line 52 of file FacOpenTrepServiceContext.cpp.

References OPENTREP::FacServiceAbstract::_pool.

◆ clean()

void OPENTREP::FacServiceAbstract::clean ( )
inherited

Destroyed all the object instantiated by this factory.

Definition at line 18 of file FacServiceAbstract.cpp.

References _pool.

Referenced by ~FacServiceAbstract().

Member Data Documentation

◆ _pool

ServicePool_T OPENTREP::FacServiceAbstract::_pool
protectedinherited

List of instantiated Business Objects

Definition at line 34 of file FacServiceAbstract.hpp.

Referenced by clean(), OPENTREP::FacOpenTrepServiceContext::create(), and OPENTREP::FacOpenTrepServiceContext::create().


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