OpenTREP Logo  0.07.7
C++ Open Travel Request Parsing Library
FacOpenTrepServiceContext.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // OpenTrep
11 
12 namespace OPENTREP {
13 
14  FacOpenTrepServiceContext* FacOpenTrepServiceContext::_instance = NULL;
15 
16  // //////////////////////////////////////////////////////////////////////
18  _instance = NULL;
19  }
20 
21  // //////////////////////////////////////////////////////////////////////
23 
24  if (_instance == NULL) {
25  _instance = new FacOpenTrepServiceContext();
26  assert (_instance != NULL);
27 
29  }
30  return *_instance;
31  }
32 
33  // //////////////////////////////////////////////////////////////////////
35  create (const TravelDBFilePath_T& iTravelDBFilePath, const DBType& iSQLDBType,
36  const SQLDBConnectionString_T& iSQLDBConnStr,
37  const DeploymentNumber_T& iDeploymentNumber) {
38  OPENTREP_ServiceContext* aOPENTREP_ServiceContext_ptr = NULL;
39 
40  aOPENTREP_ServiceContext_ptr =
41  new OPENTREP_ServiceContext (iTravelDBFilePath, iSQLDBType, iSQLDBConnStr,
42  iDeploymentNumber);
43  assert (aOPENTREP_ServiceContext_ptr != NULL);
44 
45  // The new object is added to the Bom pool
46  _pool.push_back (aOPENTREP_ServiceContext_ptr);
47 
48  return *aOPENTREP_ServiceContext_ptr;
49  }
50 
51  // //////////////////////////////////////////////////////////////////////
53  create (const PORFilePath_T& iPORFilePath,
54  const TravelDBFilePath_T& iTravelDBFilePath, const DBType& iSQLDBType,
55  const SQLDBConnectionString_T& iSQLDBConnStr,
56  const DeploymentNumber_T& iDeploymentNumber,
57  const shouldIndexNonIATAPOR_T& iShouldIndexNonIATAPOR,
58  const shouldIndexPORInXapian_T& iShouldIndexPORInXapian,
59  const shouldAddPORInSQLDB_T& iShouldAddPORInSQLDB) {
60  OPENTREP_ServiceContext* aOPENTREP_ServiceContext_ptr = NULL;
61 
62  aOPENTREP_ServiceContext_ptr =
63  new OPENTREP_ServiceContext (iPORFilePath, iTravelDBFilePath, iSQLDBType,
64  iSQLDBConnStr, iDeploymentNumber,
65  iShouldIndexNonIATAPOR,
66  iShouldIndexPORInXapian,
67  iShouldAddPORInSQLDB);
68  assert (aOPENTREP_ServiceContext_ptr != NULL);
69 
70  // The new object is added to the Service pool
71  _pool.push_back (aOPENTREP_ServiceContext_ptr);
72 
73  return *aOPENTREP_ServiceContext_ptr;
74  }
75 
76 }
OPENTREP::shouldIndexNonIATAPOR_T
bool shouldIndexNonIATAPOR_T
Definition: OPENTREP_Types.hpp:136
FacOpenTrepServiceContext.hpp
OPENTREP::PORFilePath_T
Definition: OPENTREP_Types.hpp:37
OPENTREP::SQLDBConnectionString_T
Definition: OPENTREP_Types.hpp:56
OPENTREP::FacOpenTrepServiceContext::instance
static FacOpenTrepServiceContext & instance()
Definition: FacOpenTrepServiceContext.cpp:22
OPENTREP::shouldAddPORInSQLDB_T
bool shouldAddPORInSQLDB_T
Definition: OPENTREP_Types.hpp:146
OPENTREP
Definition: BasChronometer.cpp:10
OPENTREP::FacOpenTrepServiceContext
Factory for an OPENTREP_ServiceContext object.
Definition: FacOpenTrepServiceContext.hpp:20
OPENTREP_ServiceContext.hpp
OPENTREP::OPENTREP_ServiceContext
Class holding the context of the OpenTrep services.
Definition: OPENTREP_ServiceContext.hpp:28
OPENTREP::FacOpenTrepServiceContext::FacOpenTrepServiceContext
FacOpenTrepServiceContext()
Definition: FacOpenTrepServiceContext.hpp:88
OPENTREP::FacOpenTrepServiceContext::~FacOpenTrepServiceContext
~FacOpenTrepServiceContext()
Definition: FacOpenTrepServiceContext.cpp:17
OPENTREP::FacSupervisor::instance
static FacSupervisor & instance()
Definition: FacSupervisor.cpp:21
OPENTREP::DeploymentNumber_T
unsigned short DeploymentNumber_T
Definition: OPENTREP_Types.hpp:108
OPENTREP::FacSupervisor::registerServiceFactory
void registerServiceFactory(FacServiceAbstract *)
Definition: FacSupervisor.cpp:37
OPENTREP::TravelDBFilePath_T
Definition: OPENTREP_Types.hpp:46
FacSupervisor.hpp
OPENTREP::shouldIndexPORInXapian_T
bool shouldIndexPORInXapian_T
Definition: OPENTREP_Types.hpp:141
OPENTREP::DBType
Enumeration of database types.
Definition: DBType.hpp:17
OPENTREP_Types.hpp
OPENTREP::FacServiceAbstract::_pool
ServicePool_T _pool
Definition: FacServiceAbstract.hpp:34
OPENTREP::FacOpenTrepServiceContext::create
OPENTREP_ServiceContext & create(const TravelDBFilePath_T &, const DBType &, const SQLDBConnectionString_T &, const DeploymentNumber_T &)
Definition: FacOpenTrepServiceContext.cpp:35