1.00.0
C++ Standard Airline IT Object Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
STDAIR_Service.hpp
Go to the documentation of this file.
1
12
#ifndef __STDAIR_STDAIR_HPP
13
#define __STDAIR_STDAIR_HPP
14
15
// //////////////////////////////////////////////////////////////////////
16
// Import section
17
// //////////////////////////////////////////////////////////////////////
18
// STL
19
#include <string>
20
// StdAir
21
#include <
stdair/stdair_inventory_types.hpp
>
22
#include <
stdair/stdair_service_types.hpp
>
23
#include <
stdair/stdair_file.hpp
>
24
#include <
stdair/basic/BasLogParams.hpp
>
25
#include <
stdair/basic/BasDBParams.hpp
>
26
#include <
stdair/basic/ServiceInitialisationType.hpp
>
27
#include <
stdair/bom/TravelSolutionTypes.hpp
>
28
#include <
stdair/bom/ConfigHolderStruct.hpp
>
29
#include <
stdair/service/STDAIR_ServiceContext.hpp
>
30
31
namespace
stdair {
32
34
class
BomRoot;
35
struct
EventStruct;
36
struct
ProgressStatusSet;
37
struct
BookingRequestStruct;
38
class
JSONString;
39
40
44
class
STDAIR_Service
{
45
public
:
46
// ////////// Constructors and destructors //////////
50
STDAIR_Service
();
51
63
STDAIR_Service
(
const
BasLogParams
&);
64
80
STDAIR_Service
(
const
BasLogParams
&,
const
BasDBParams
&);
81
85
~STDAIR_Service
();
86
87
88
public
:
89
// ////////////////// Business support methods //////////////////
109
void
buildSampleBom
();
110
132
void
buildDummyInventory
(
const
CabinCapacity_T
& iCabinCapacity);
133
146
void
buildDummyLegSegmentAccesses
(
BomRoot
&);
147
162
void
buildSampleTravelSolutionForPricing
(
TravelSolutionList_T
&);
163
181
void
buildSampleTravelSolutions
(
TravelSolutionList_T
&);
182
211
BookingRequestStruct
buildSampleBookingRequest
(
const
bool
isForCRS =
false
);
212
216
void
clonePersistentBom
();
217
218
public
:
219
220
// //////////////// Export support methods /////////////////
233
std::string
jsonExportFlightDateList
(
const
AirlineCode_T
& iAirlineCode =
"all"
,
234
const
FlightNumber_T
& iFlightNumber = 0)
const
;
235
246
std::string
jsonExportFlightDateObjects
(
const
AirlineCode_T
&,
247
const
FlightNumber_T
&,
248
const
Date_T
& iDepartureDate)
const
;
249
256
std::string
jsonExportEventObject
(
const
EventStruct
&)
const
;
257
264
std::string
jsonExportConfiguration
()
const
;
265
266
public
:
267
268
// //////////////// Import support methods /////////////////
276
bool
jsonImportConfiguration
(
const
JSONString
&)
const
;
277
278
public
:
279
// //////////////// Display support methods /////////////////
293
std::string
list
(
const
AirlineCode_T
& iAirlineCode =
"all"
,
294
const
FlightNumber_T
& iFlightNumber = 0)
const
;
295
302
std::string
listAirportPairDateRange
()
const
;
303
313
bool
check
(
const
AirlineCode_T
&,
const
FlightNumber_T
&,
314
const
Date_T
& iDepartureDate)
const
;
315
328
bool
check
(
const
AirportCode_T
&,
const
AirportCode_T
&,
329
const
Date_T
& iDepartureDate)
const
;
330
337
std::string
configDisplay
()
const
;
338
346
std::string
csvDisplay
()
const
;
347
356
std::string
csvDisplay
(
const
BomRoot
&)
const
;
357
367
std::string
csvDisplay
(
const
AirlineCode_T
&,
const
FlightNumber_T
&,
368
const
Date_T
& iDepartureDate)
const
;
369
377
std::string
csvDisplay
(
const
TravelSolutionList_T
&)
const
;
378
389
std::string
csvDisplay
(
const
AirportCode_T
&,
const
AirportCode_T
&,
390
const
Date_T
& iDepartureDate)
const
;
391
392
393
public
:
394
// ///////////////// Getters ///////////////////
403
BomRoot
&
getBomRoot
()
const
;
404
413
BomRoot
&
getPersistentBomRoot
()
const
;
414
420
BasLogParams
getLogParams
()
const
;
421
428
const
BasDBParams
&
getDBParams
()
const
;
429
438
const
ServiceInitialisationType
&
getServiceInitialisationType
()
const
;
439
440
441
private
:
442
// /////// Construction and Destruction helper methods ///////
449
STDAIR_Service
(
const
STDAIR_Service
&);
450
455
void
initServiceContext();
456
474
void
logInit (
const
BasLogParams
&);
475
481
void
dbInit (
const
BasDBParams
&);
482
498
void
init();
499
503
void
finalise();
504
505
public
:
506
512
void
importINIConfig
(
const
ConfigINIFile
&);
513
522
void
importConfigValue
(
const
std::string& iValue,
523
const
std::string& iPath);
524
533
template
<
typename
ValueType>
534
bool
exportConfigValue
(ValueType& ioValue,
const
std::string& iPath);
535
540
void
updateAirlineFeatures
();
541
542
private
:
543
// ///////// Service Context /////////
547
STDAIR_ServiceContext
* _stdairServiceContext;
548
};
549
550
// ////////////////////////////////////////////////////////////////////
551
template
<
typename
ValueType>
552
bool
STDAIR_Service::exportConfigValue
(ValueType& ioValue,
553
const
std::string& iPath) {
554
555
// Retrieve the StdAir service context
556
assert (_stdairServiceContext != NULL);
557
const
STDAIR_ServiceContext
& lSTDAIR_ServiceContext =
558
*_stdairServiceContext;
559
560
// Retrieve the BOM tree root
561
const
ConfigHolderStruct
& lConfigHolder =
562
lSTDAIR_ServiceContext.getConfigHolder();
563
564
// Call the dedicated configuration holder method.
565
return
lConfigHolder.
exportValue
<ValueType> (ioValue, iPath);
566
}
567
// ////////////////////////////////////////////////////////////////////
568
569
}
570
#endif // __STDAIR_STDAIR_HPP
Generated on Sat Dec 22 2012 16:51:54 for StdAir by
1.8.1.1