7#include <stdair/service/Logger.hpp>
8#include <stdair/stdair_exceptions.hpp>
15namespace bsc = boost::spirit::classic;
51 const stdair::AirlineCode_T lAirlineCode (iStr, iStrEnd);
64 _flightDate._itSegmentCabin._itFareFamily._classList.clear();
98 const std::string lFlightTypeCodeStr (iStr, iStrEnd);
113 const std::string lFlightVisibilityCodeStr (iStr, iStrEnd);
128 stdair::AirportCode_T lBoardingPoint (iStr, iStrEnd);
133 if (
_flightDate._itLeg._cabinList.empty() ==
false) {
152 _flightDate._itLeg._boardingPoint = lBoardingPoint;
167 stdair::AirportCode_T lOffPoint (iStr, iStrEnd);
183 const stdair::AirlineCode_T lAirlineCode (iStr, iStrEnd);
184 if (lAirlineCode.size() == 2) {
266 if (
_flightDate._itLegCabin._bucketList.empty() ==
false) {
380 if (
_flightDate._itBucket._yieldRangeUpperValue != 0.0) {
386 _flightDate._itBucket._yieldRangeUpperValue = iReal;
422 stdair::AirportCode_T lBoardingPoint (iStr, iStrEnd);
427 if (
_flightDate._itLeg._cabinList.empty() ==
false) {
443 if (
_flightDate._itSegment._cabinList.empty() ==
false) {
453 _flightDate._itSegmentCabin._itFareFamily._classList.clear();
459 _flightDate._itSegment._boardingPoint = lBoardingPoint;
471 stdair::AirportCode_T lOffPoint (iStr, iStrEnd);
491 if (
_flightDate._itSegmentCabin._itFareFamily._classList.empty() ==
false){
492 _flightDate._itSegmentCabin._itFareFamily._classList.
495 push_back (
_flightDate._itSegmentCabin._itFareFamily);
502 _flightDate._itSegmentCabin._itFareFamily._classList.clear();
532 if (
_flightDate._itBookingClass._classCode !=
"") {
533 _flightDate._itSegmentCabin._itFareFamily._classList.
549 _flightDate._itBookingClass._subclassCode = iNumber;
561 _flightDate._itBookingClass._parentClassCode = iChar;
573 _flightDate._itBookingClass._parentSubclassCode = iNumber;
585 _flightDate._itBookingClass._cumulatedProtection = iReal;
618 _flightDate._itBookingClass._noShowPercentage = iReal;
629 _flightDate._itBookingClass._overbookingPercentage = iReal;
651 _flightDate._itBookingClass._nbOfGroupBookings = iReal;
663 _flightDate._itBookingClass._nbOfPendingGroupBookings = iReal;
674 _flightDate._itBookingClass._nbOfStaffBookings = iReal;
685 _flightDate._itBookingClass._nbOfWLBookings = iReal;
708 _flightDate._itBookingClass._netClassAvailability = iReal;
720 _flightDate._itBookingClass._segmentAvailability = iReal;
732 _flightDate._itBookingClass._netRevenueAvailability = iReal;
743 std::ostringstream ostr;
745 _flightDate._itSegmentCabin._itFareFamily._familyCode = ostr.str();
756 std::string lClasses (iStr, iStrEnd);
757 _flightDate._itSegmentCabin._itFareFamily._classes = lClasses;
764 _flightDate._itSegmentCabin._itFareFamily._classList.
767 push_back (
_flightDate._itSegmentCabin._itFareFamily);
772 _flightDate._itSegmentCabin._itFareFamily._classList.clear();
780 unsigned int& ioNbOfFlights)
793 if (
_flightDate._itSegment._cabinList.empty() ==
false) {
896 unsigned int& ioNbOfFlights)
902 template<
typename ScannerT>
910 bsc::lexeme_d[ bsc::comment_p(
"//") | bsc::comment_p(
"/*",
"*/")
947 ( bsc::chseq_p(
"INT") | bsc::chseq_p(
"DOM") | bsc::chseq_p(
"GRD") )
951 ( bsc::chseq_p(
"HID") | bsc::chseq_p(
"PSD") )
1087 BOOST_SPIRIT_DEBUG_NODE (
date);
1088 BOOST_SPIRIT_DEBUG_NODE (
leg_list);
1089 BOOST_SPIRIT_DEBUG_NODE (
leg);
1091 BOOST_SPIRIT_DEBUG_NODE (
leg_key);
1097 BOOST_SPIRIT_DEBUG_NODE (
time);
1099 BOOST_SPIRIT_DEBUG_NODE (
segment);
1116 template<
typename ScannerT>
1117 bsc::rule<ScannerT>
const&
1133 : _filename (iFilename), _bomRoot (ioBomRoot),
1139 void InventoryFileParser::init() {
1144 if (!_startIterator) {
1145 std::ostringstream oMessage;
1146 oMessage <<
"The file " << _filename <<
" can not be open.";
1147 STDAIR_LOG_ERROR (oMessage.str());
1152 _endIterator = _startIterator.make_end();
1157 bool oResult =
false;
1159 STDAIR_LOG_DEBUG (
"Parsing inventory input file: " << _filename);
1169 bsc::parse_info<iterator_t> info = bsc::parse (_startIterator, _endIterator,
1171 bsc::space_p - bsc::eol_p);
1176 const std::string hasBeenFullyReadStr = (info.full ==
true)?
"":
"not ";
1177 if (oResult ==
true) {
1178 STDAIR_LOG_DEBUG (
"Parsing of inventory input file: " << _filename
1179 <<
" succeeded: read " << info.length
1180 <<
" characters. The input file has "
1181 << hasBeenFullyReadStr
1182 <<
"been fully read. Stop point: " << info.stop);
1185 STDAIR_LOG_ERROR (
"Parsing of inventory input file: " << _filename
1186 <<
" failed: read " << info.length
1187 <<
" characters. The input file has "
1188 << hasBeenFullyReadStr
1189 <<
"been fully read. Stop point: " << info.stop);
1191 ": " + _filename +
" failed");
InventoryFileParser(stdair::BomRoot &, const stdair::Filename_T &iInventoryInputFilename)
bounded2_p_t year_p(uint2_p.derived(), 0u, 99u)
chset_t passenger_type_p("A-Z")
bounded1_2_p_t hours_p(uint1_2_p.derived(), 0u, 24u)
bounded2_p_t month_p(uint2_p.derived(), 1u, 12u)
chset_t cabin_code_p("A-Z")
repeat_p_t dow_p(chset_t("0-1").derived().derived(), 7, 7)
bounded1_3_p_t stay_duration_p(uint1_3_p.derived(), 0u, 999u)
repeat_p_t class_code_list_p(chset_t("A-Z").derived(), 1, 26)
chset_t class_code_p("A-Z")
bounded1_4_p_t flight_number_p(uint1_4_p.derived(), 0u, 9999u)
bounded2_p_t minutes_p(uint2_p.derived(), 0u, 59u)
repeat_p_t airport_p(chset_t("0-9A-Z").derived(), 3, 3)
bounded2_p_t seconds_p(uint2_p.derived(), 0u, 59u)
bounded2_p_t day_p(uint2_p.derived(), 1u, 31u)
repeat_p_t airline_code_p(chset_t("0-9A-Z").derived(), 2, 3)
boost::spirit::classic::impl::loop_traits< chset_t, unsignedint, unsignedint >::type repeat_p_t
boost::spirit::classic::uint_parser< unsigned int, 10, 1, 3 > uint1_3_p_t
boost::spirit::classic::int_parser< unsigned int, 10, 1, 1 > int1_p_t
boost::spirit::classic::uint_parser< unsigned int, 10, 2, 2 > uint2_p_t
boost::spirit::classic::bounded< uint1_4_p_t, unsigned int > bounded1_4_p_t
boost::spirit::classic::bounded< uint2_p_t, unsigned int > bounded2_p_t
boost::spirit::classic::chset< char_t > chset_t
boost::spirit::classic::uint_parser< unsigned int, 10, 1, 2 > uint1_2_p_t
boost::spirit::classic::file_iterator< char_t > iterator_t
boost::spirit::classic::bounded< uint1_3_p_t, unsigned int > bounded1_3_p_t
boost::spirit::classic::uint_parser< unsigned int, 10, 1, 4 > uint1_4_p_t
boost::spirit::classic::bounded< uint1_2_p_t, unsigned int > bounded1_2_p_t
boost::spirit::classic::uint_parser< unsigned int, 10, 4, 4 > uint4_p_t
EN_FlightTypeCode getCode() const
EN_FlightVisibilityCode getCode() const
boost::spirit::classic::rule< ScannerT > segment_key
boost::spirit::classic::rule< ScannerT > full_segment_cabin_details
boost::spirit::classic::rule< ScannerT > segment_cabin_key
boost::spirit::classic::rule< ScannerT > class_details
boost::spirit::classic::rule< ScannerT > flight_number
boost::spirit::classic::rule< ScannerT > segment_cabin_list
boost::spirit::classic::rule< ScannerT > flight_date_end
boost::spirit::classic::rule< ScannerT > flight_date
boost::spirit::classic::rule< ScannerT > leg_details
boost::spirit::classic::rule< ScannerT > bucket_list
boost::spirit::classic::rule< ScannerT > segment
boost::spirit::classic::rule< ScannerT > leg_list
boost::spirit::classic::rule< ScannerT > class_list
boost::spirit::classic::rule< ScannerT > date
boost::spirit::classic::rule< ScannerT > flight_type_code
boost::spirit::classic::rule< ScannerT > flight_visibility_code
definition(InventoryParser const &self)
boost::spirit::classic::rule< ScannerT > not_to_be_parsed
boost::spirit::classic::rule< ScannerT > operating_leg_details
boost::spirit::classic::rule< ScannerT > segment_list
boost::spirit::classic::rule< ScannerT > time
boost::spirit::classic::rule< ScannerT > flight_date_list
boost::spirit::classic::rule< ScannerT > leg_key
boost::spirit::classic::rule< ScannerT > flight_key
boost::spirit::classic::rule< ScannerT > const & start() const
boost::spirit::classic::rule< ScannerT > leg
boost::spirit::classic::rule< ScannerT > class_protection
boost::spirit::classic::rule< ScannerT > leg_cabin_details
boost::spirit::classic::rule< ScannerT > class_key
boost::spirit::classic::rule< ScannerT > class_nego
boost::spirit::classic::rule< ScannerT > segment_cabin_details
boost::spirit::classic::rule< ScannerT > airline_code
boost::spirit::classic::rule< ScannerT > family_cabin_details
boost::spirit::classic::rule< ScannerT > leg_cabin_list
boost::spirit::classic::rule< ScannerT > family_cabin_list
boost::spirit::classic::rule< ScannerT > bucket_details
boost::spirit::classic::rule< ScannerT > parent_subclass_code
stdair::BomRoot & _bomRoot
unsigned int & _nbOfFlights
InventoryParser(stdair::BomRoot &, FlightDateStruct &, unsigned int &)
FlightDateStruct & _flightDate
ParserSemanticAction(FlightDateStruct &)
FlightDateStruct & _flightDate
stdair::BomRoot & _bomRoot
doEndFlightDate(stdair::BomRoot &, FlightDateStruct &, unsigned int &)
unsigned int & _nbOfFlights
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeACP(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeAU(FlightDateStruct &)
storeAirlineCode(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeBoardingDate(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeBoardingTime(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(double iReal) const
storeBookingCounter(FlightDateStruct &)
storeBucketAvaibality(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeClassAvailability(FlightDateStruct &)
void operator()(char iChar) const
storeClassCode(FlightDateStruct &)
void operator()(double iReal) const
storeClassETB(FlightDateStruct &)
storeCumulatedProtection(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeETB(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeFClasses(FlightDateStruct &)
void operator()(int iCode) const
storeFamilyCode(FlightDateStruct &)
storeFlightDate(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeFlightNumber(FlightDateStruct &)
void operator()(unsigned int iNumber) const
storeFlightTypeCode(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeFlightVisibilityCode(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeGAV(FlightDateStruct &)
void operator()(double iReal) const
storeLegBoardingPoint(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(char iChar) const
storeLegCabinCode(FlightDateStruct &)
storeLegOffPoint(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeNAV(FlightDateStruct &)
void operator()(double iReal) const
storeNbOfBkgs(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeNbOfGroupBkgs(FlightDateStruct &)
storeNbOfPendingGroupBkgs(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeNbOfStaffBkgs(FlightDateStruct &)
storeNbOfWLBkgs(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeNego(FlightDateStruct &)
storeNoShow(FlightDateStruct &)
void operator()(double iReal) const
storeOffDate(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeOffTime(FlightDateStruct &)
storeOperatingAirlineCode(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(unsigned int iNumber) const
storeOperatingFlightNumber(FlightDateStruct &)
void operator()(double iReal) const
storeOverbooking(FlightDateStruct &)
void operator()(char iChar) const
storeParentClassCode(FlightDateStruct &)
storeParentSubclassCode(FlightDateStruct &)
void operator()(unsigned int iNumber) const
storeProtection(FlightDateStruct &)
void operator()(double iReal) const
void operator()(double iReal) const
storeRevenueAvailability(FlightDateStruct &)
void operator()(double iReal) const
storeSaleableCapacity(FlightDateStruct &)
void operator()(double iReal) const
storeSeatIndex(FlightDateStruct &)
void operator()(double iReal) const
storeSegmentAvailability(FlightDateStruct &)
storeSegmentBoardingPoint(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeSegmentCabinBookingCounter(FlightDateStruct &)
void operator()(double iReal) const
void operator()(char iChar) const
storeSegmentCabinCode(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
storeSegmentOffPoint(FlightDateStruct &)
storeSnapshotDate(FlightDateStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(unsigned int iNumber) const
storeSubclassCode(FlightDateStruct &)
storeUPR(FlightDateStruct &)
void operator()(double iReal) const
storeYieldUpperRange(FlightDateStruct &)
void operator()(double iReal) const