|
From: <qua...@us...> - 2009-10-15 15:11:33
|
Revision: 47
http://stdair.svn.sourceforge.net/stdair/?rev=47&view=rev
Author: quannaus
Date: 2009-10-15 15:11:19 +0000 (Thu, 15 Oct 2009)
Log Message:
-----------
[Dev] Transformed BomRoot from a template class to a normal class.
Modified Paths:
--------------
trunk/stdair/stdair/STDAIR_Types.hpp
trunk/stdair/stdair/basic/BasTypes.hpp
trunk/stdair/stdair/bom/BomRootTypes.hpp
trunk/stdair/stdair/bom/BomStructureDummy.hpp
trunk/stdair/stdair/bom/BookingClass.hpp
trunk/stdair/stdair/bom/BookingClassStructure.hpp
trunk/stdair/stdair/bom/FlightDate.cpp
trunk/stdair/stdair/bom/FlightDate.hpp
trunk/stdair/stdair/bom/FlightDateStructure.hpp
trunk/stdair/stdair/bom/Inventory.cpp
trunk/stdair/stdair/bom/Inventory.hpp
trunk/stdair/stdair/bom/InventoryContent.hpp
trunk/stdair/stdair/bom/InventoryStructure.hpp
trunk/stdair/stdair/bom/LegCabin.hpp
trunk/stdair/stdair/bom/LegCabinStructure.hpp
trunk/stdair/stdair/bom/LegDate.hpp
trunk/stdair/stdair/bom/LegDateStructure.hpp
trunk/stdair/stdair/bom/SegmentCabin.hpp
trunk/stdair/stdair/bom/SegmentCabinStructure.hpp
trunk/stdair/stdair/bom/SegmentDate.hpp
trunk/stdair/stdair/bom/SegmentDateStructure.hpp
trunk/stdair/stdair/bom/sources.mk
trunk/stdair/stdair/factory/FacBomContent.cpp
trunk/stdair/stdair/factory/FacBomContent.hpp
trunk/stdair/stdair/factory/FacBomStructure.hpp
Added Paths:
-----------
trunk/stdair/stdair/bom/BomRoot.cpp
trunk/stdair/stdair/bom/BomRoot.hpp
trunk/stdair/stdair/bom/BomRootContent.cpp
trunk/stdair/stdair/bom/BomRootContent.hpp
trunk/stdair/stdair/bom/BomRootKey.hpp
trunk/stdair/stdair/bom/BomRootStructure.hpp
Removed Paths:
-------------
trunk/stdair/stdair/bom/BomContentRoot.hpp
trunk/stdair/stdair/bom/BomStructureRoot.hpp
trunk/stdair/stdair/bom/BomStructureRootKey.hpp
Modified: trunk/stdair/stdair/STDAIR_Types.hpp
===================================================================
--- trunk/stdair/stdair/STDAIR_Types.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/STDAIR_Types.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -11,6 +11,7 @@
// Boost (Extended STL)
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/tuple/tuple.hpp>
namespace stdair {
@@ -48,18 +49,6 @@
}
// //////// Type definitions /////////
- /** Define the type for airline codes. */
- typedef std::string AirlineCode_T;
-
- /** Define the type for flight numbers. */
- typedef unsigned int FlightNumber_T;
-
- /** Define the type for cabin codes. */
- typedef std::string CabinCode_T;
-
- /** Define the type for class codes. */
- typedef std::string ClassCode_T;
-
/** Define the type for durations (e.g., elapsed in-flight time). */
typedef boost::posix_time::time_duration Duration_T;
@@ -68,6 +57,291 @@
/** Define the type for airport codes. */
typedef std::string AirportCode_T;
+
+ /** Define the type for flight numbers. */
+ typedef unsigned short FlightNumber_T;
+
+ /** Define the file address type (e.g. "a_directory/a_filename")*/
+ typedef std::string FileAddress_T;
+
+ /** Define the replication number. */
+ typedef unsigned int ReplicationNumber_T;
+
+ /** Define the seed type of an Exponential function. */
+ typedef unsigned long int ExponentialSeed_T;
+
+ /** Define the seed type of an Uniform function. */
+ typedef unsigned long int UniformSeed_T;
+
+ /** Define the Airline Code type (2-letter-code, e.g., BA). */
+ typedef std::string AirlineCode_T;
+
+ /** Define the Airport Code type (3-letter-code, e.g., LHR). */
+ typedef std::string AirportCode_T;
+
+ /** Define the Request status for booking (1-letter-code, e.g.,
+ B: booked, C: cancelled, R: Rejected). */
+ typedef std::string RequestStatus_T;
+
+ /** Define the Date (e.g., flight-date departure date). */
+ typedef boost::gregorian::date Date_T;
+
+ /** Define the Duration (e.g., elapsed in-flight time). */
+ typedef boost::posix_time::time_duration Duration_T;
+
+ /** Define an accurate time (date +time). */
+ typedef boost::posix_time::ptime DateTime_T;
+
+ /** Define a distance (kilometers). */
+ typedef long int Distance_T;
+
+ /** Define the Period (e.g., period during which flights depart). */
+ typedef boost::gregorian::date_period DatePeriod_T;
+
+ /** Define the Day-Of-the-Week as a string. */
+ typedef std::string DOW_String_T;
+
+ /** Define the Date Off-Set (e.g., -1 ). */
+ typedef boost::gregorian::date_duration DateOffSet_T;
+
+ /** Define a duration in number of days. */
+ typedef long DayDuration_T;
+
+ /** Define the Saturday stay status of a travel. */
+ typedef bool SaturdayStay_T;
+
+ /** Define the availability option allowing the ticket change. */
+ typedef bool ChangeFees_T;
+
+ /** Define the refundable availability of a tickets. */
+ typedef bool NonRefundable_T;
+
+ /** Define the average ratio (between 0 and 100) of demand with
+ a saturday stay status equal to TRUE. */
+ typedef unsigned int SaturdayStayRatio_T;
+
+ /** Define the average ratio of demand with change fee
+ availability. */
+ typedef unsigned int ChangeFeesRatio_T;
+
+ /** Define the average ratio of demand with non-refundable
+ availability. */
+ typedef unsigned int NonRefundableRatio_T;
+
+ /** Define the passenger characteristics, leisure or business
+ for instance (1-letter-code, e.g., L or B). */
+ typedef std::string PassengerType_T;
+
+ /** Define the identifier of a distribution pattern (e.g., 1). */
+ typedef std::string DistributionPatternId_T;
+
+ /** Define the identifier of a cancellation rate curve (e.g., C1). */
+ typedef std::string CancellationRateCurveId_T;
+
+ /** Define the identifier of an airline preference set list (e.g., AP1). */
+ typedef std::string AirlinePreferenceId_T;
+
+ /** Define a percentage value (between 0 and 100%). */
+ typedef double Percentage_T;
+
+ /** Define a cancellation & and no-show rate pair. */
+ typedef std::pair<Percentage_T, Percentage_T> CancellationNoShowRatePair_T;
+
+ /** Define the identifier of a demand characteristics pattern
+ (e.g. Ch12); for a customer choice model */
+ typedef std::string CharacteristicsPatternId_T;
+
+ /** Define characteristics component index (e.g. W for WTP) */
+ typedef std::string CharacteristicsIndex_T;
+
+ /** Define the cabin code (class of service, e.g., first, business,
+ economy). */
+ typedef std::string CabinCode_T;
+
+ /** Define a price value (e.g., 1000.0 Euros). */
+ typedef double PriceValue_T;
+
+ /** Define a price currency (e.g., EUR for Euros). */
+ typedef std::string PriceCurrency_T;
+
+ /** Define the number of seats required by a demand. */
+ typedef unsigned short NbOfSeats_T;
+
+ /** Define a mean value (e.g., 20.2). */
+ typedef double MeanValue_T;
+
+ /** Define a standard deviation value (e.g., 1.5). */
+ typedef double StandardDeviationValue_T;
+
+ /** Define the cabin capacity (resource, e.g., 200 seats).
+ <br>The capacity is expressed as a double to cope with overbooking. */
+ typedef double CabinCapacity_T;
+
+ /** Define the number of seat which could not be used for the booking. */
+ typedef double BlockSpace_T;
+
+ /** Define the code of the fare family (e.g., 1, 2, 3, etc.). */
+ typedef std::string FamilyCode_T;
+
+ /** Define the booking class code (product segment class, e.g., H,
+ B, K, etc.). */
+ typedef std::string ClassCode_T;
+
+ /** Define the flight path code (code made by a suite of flight numbers). */
+ typedef std::string FlightPathCode_T;
+
+ /** Define an availability. */
+ typedef double Availability_T;
+
+ /** Define an availability. */
+ typedef bool AvailabilityStatus_T;
+
+ /** Define a list of availabilities. */
+ typedef std::vector<Availability_T> BucketAvailabilities_T;
+
+ /** Define a identity number. */
+ typedef unsigned long Identity_T;
+
+ /** Define a map between a BookingID and a TravelSolutionID. */
+ typedef std::map<Identity_T, Identity_T> BookingTSIDMap_T;
+
+ /** Define a number of requests. */
+ typedef double NbOfRequests_T;
+
+ /** Define a number of bookings. */
+ typedef NbOfRequests_T NbOfBookings_T;
+
+ /** Define a number of cancellations (travellers). */
+ typedef NbOfRequests_T NbOfCancellations_T;
+
+ /** Define a number of no-shows. */
+ typedef NbOfRequests_T NbOfNoShows_T;
+
+ /** Define a number of fare rules. */
+ typedef double NbOfFareRules_T;
+
+ /** Define a number of yields. */
+ typedef double NbOfYields_T;
+
+ /** Define a number of InventoryControlRules. */
+ typedef double NbOfInventoryControlRules_T;
+
+ /** Define a number of flight dates. */
+ typedef double NbOfFlightDates_T;
+
+ /** Define a number of commited spaces in a cabin. */
+ typedef double CommitedSpace_T;
+
+ /** Define availibility of booking limit. */
+ typedef bool CensorshipFlag_T;
+
+ /** Define the list of censorship flags (une list per booking
+ class, one censorship flag per DCP). */
+ typedef std::vector<bool> CensorshipFlagList_T;
+
+ /** Define the value of the booking limit. */
+ typedef double BookingLimit_T;
+
+ /** Define the value of the authorization level. */
+ typedef double AuthorizationLevel_T;
+
+ /** Define the rate of overbooking */
+ typedef double OverbookingRate_T;
+
+ /** Define the bookingRatio (for instance OnD bookings
+ over whole class bookings). */
+ typedef double BookingRatio_T;
+
+ /** Define the list of class codes as a string. */
+ typedef std::string ClassList_String_T;
+
+ /** Define a number of segment-dates (in a path). */
+ typedef unsigned short NbOfSegments_T;
+
+ /** Define a number of airlines (in a path). */
+ typedef unsigned short NbOfAirlines_T;
+
+ /** Define the fare of a travel solution. */
+ typedef double Fare_T;
+
+ /** Define the yield of a virtual class. */
+ typedef double Yield_T;
+
+ /** Define the Bid-Price. */
+ typedef double BidPrice_T;
+
+ /** Define a Bid-Price Vector. */
+ typedef std::vector<BidPrice_T> BidPriceVector_T;
+
+ /** Define a number of travel solutions
+ (in a travel solution block). */
+ typedef unsigned short NbOfTravelSolutions_T;
+
+ /** Define a indicator of demand to class matching. */
+ typedef double MatchingIndicator_T;
+
+ /** Define an amount of revenue. */
+ typedef double Revenue_T;
+
+ /** Define the name of an event. */
+ typedef std::string EventName_T;
+
+ /** Define the name of an database connection. */
+ typedef std::string DBConnectionName_T;
+
+ /** Define a number of events. */
+ typedef double NbOfEvents_T;
+
+ /** Frequency of the Data Collection Point description (daily, monthly or
+ detailed). */
+ typedef std::string DCPModeFrequency_T;
+
+ /** Mode of the Data Collection Point description (Forecaster only,
+ Optimizer only or both of them). */
+ typedef std::string DCPMode_T;
+
+ /** Mode of the forecaster. */
+ typedef std::string ForecasterMode_T;
+
+ /** Limit of similar flight-dates used in the forecaster. */
+ typedef short HistoricalDataLimit_T;
+
+ /** Mode of the forecaster. */
+ typedef std::string OptimizerMode_T;
+
+ /** Mode of the forecaster. */
+ typedef std::string DicoOptimizerMode_T;
+
+ /** Mode of inventory control. */
+ typedef std::string ControlMode_T;
+
+ /** Analysis status (true or false). */
+ typedef bool AnalysisStatus_T;
+
+ /** Define the name of a multiplier. */
+ typedef double Multiplier_T;
+
+ /** Define the name of a WTP-component of characteristics pattern. */
+ typedef boost::tuples::tuple<double, double> CharacteristicsWTP_tuple_T;
+
+ /** Define the name of sell-up probability flag for RMS optimizer. */
+ typedef bool SellupFlagForOptimizer_T;
+
+ /** Define the name of sell-up probability for RMS optimizer. */
+ typedef double SellupProbabilityForOptimizer_T;
+
+ /** Define the name of sell-up probability vector for RMS optimizer. */
+ typedef std::vector<SellupProbabilityForOptimizer_T>
+ SellupProbabilityVector_T;
+
+ /** Define the demand for a policy. */
+ typedef NbOfBookings_T PolicyDemand_T;
+
+ /** Define the total revenue of an unconstrained policy. */
+ typedef double PolicyRevenue_T;
+
+ /** Define the total revenue of an unconstrained policy. */
+ typedef double PolicyRevenue_T;
}
#endif // __STDAIR_STDAIR_TYPES_HPP
Modified: trunk/stdair/stdair/basic/BasTypes.hpp
===================================================================
--- trunk/stdair/stdair/basic/BasTypes.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/basic/BasTypes.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -12,6 +12,5 @@
/** Key of a STL map. */
typedef std::string MapKey_T;
-
}
#endif // __STDAIR_BAS_BASTYPES_HPP
Deleted: trunk/stdair/stdair/bom/BomContentRoot.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomContentRoot.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BomContentRoot.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -1,122 +0,0 @@
-#ifndef __STDAIR_BOM_BOMCONTENTROOT_HPP
-#define __STDAIR_BOM_BOMCONTENTROOT_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STDAIR
-#include <stdair/bom/BomContent.hpp>
-
-namespace stdair {
- // Forward declarations.
- template <typename BOM_CONTENT> class BomStructureRoot;
- template <typename BOM_CONTENT> class BomStructureRootKey;
-
- /** Class representing the actual functional/business content
- for the Bom root.
- <br>That class is just an utility tool to mark the root
- of the Bom tree. */
- template <typename BOM_CHILD>
- class BomContentRoot : public BomContent {
- friend class FacBomContent;
-
- // /////////////////////////////////////////////////////////////////////////
- // Type definitions, compulsary for the STDAIR library to work correctly
- // /////////////////////////////////////////////////////////////////////////
- /** The following types must be defined:
- <ul>
- <li>ParentBomContent_T: Type corresponding to the parent BOM
- class within that namespace (e.g., AIRSCHED here)</li>
- <li>BomStructure_T: Type of the corresponding BOM class within
- the stdair namespace</li>
- <li>BomKey_T: Type of the corresponding BOM Key structure within
- the stdair namespace</li>
- <li>ContentChild_T: Type corresponding to the child BOM
- class within that namespace (e.g., AIRSCHED here)</li>
- </ul>
- <br><br>
- Note that the BomContentRoot has no parent. So, there is no need for
- that class to define a ParentBomContent_T type.
- <br><br>
- Note that when there is a second type of children (for instance,
- the FlightDate object contains two types of children, namely LegDate
- and SegmentDate), an additional type definition must be given, namely
- SecondContentChild_T. As, by default, there is a single type of
- children, there is no need to specify "First" in the ContentChild_T
- type.
- */
-
- public:
- // /////////////////////////////////////////////////////////////////////////
- /** Definition allowing to retrieve the associated BOM structure type. */
- typedef BomStructureRoot<BomContentRoot> BomStructure_T;
-
- /** Definition allowing to retrieve the associated BOM key type. */
- typedef BomStructureRootKey<BomContentRoot> BomKey_T;
-
- /** Definition allowing to retrieve the associated
- BOM content child type. */
- typedef BOM_CHILD ContentChild_T;
- // /////////////////////////////////////////////////////////////////////////
-
-
- // /////////////////////////////////////////////////////////////////////////
- // In order to enable STL-iterator-like browsing of children objects,
- // extra type definitions may be specified, such as the ones commented
- // below. Hence, although those type definitions may appear not so simple
- // (some will say "idiomatic"), they allow for a very simple use.
- // /////////////////////////////////////////////////////////////////////////
- /** Define the const iterator on the list of children objects . */
- // typedef stdair::BomIterator_T<BomContent,
- // BomStructureList_T::const_iterator> const_iterator;
- // where BomStructureList_T is defined as std::vector<BomStructure_T*>
- // /////////////////////////////////////////////////////////////////////////
-
-
- public:
- // /////////// Display support methods /////////
- /** Dump a Business Object into an output stream.
- @param ostream& the output stream. */
- void toStream (std::ostream& ioOut) const { ioOut << toString(); }
-
- /** Read a Business Object from an input stream.
- @param istream& the input stream. */
- void fromStream (std::istream& ioIn) { }
-
- /** Get the serialised version of the Business Object. */
- std::string toString() const { return describeKey(); }
-
- /** Get a string describing the whole key (differentiating two objects
- at any level). */
- const std::string describeKey() const { return std::string (""); }
-
- /** Get a string describing the short key (differentiating two objects
- at the same level). */
- const std::string describeShortKey() const { return std::string (""); }
-
- private:
- /** Retrieve the BOM structure object. */
- BomStructure_T& getBomStructure () {
- return _bomStructure;
- }
-
- private:
- /** Constructors are private so as to force the usage of the Factory
- layer. */
- /** Default constructors. */
- BomContentRoot ();
- BomContentRoot (const BomContentRoot&);
- BomContentRoot (BomStructure_T& ioBomStructure)
- : _bomStructure (ioBomStructure) { }
-
- /** Destructor. */
- virtual ~BomContentRoot() { }
-
- private:
- // Attributes
- /** Reference structure. */
- BomStructure_T& _bomStructure;
- };
-
-}
-#endif // __STDAIR_BOM_BOMCONTENTROOT_HPP
Added: trunk/stdair/stdair/bom/BomRoot.cpp
===================================================================
--- trunk/stdair/stdair/bom/BomRoot.cpp (rev 0)
+++ trunk/stdair/stdair/bom/BomRoot.cpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -0,0 +1,39 @@
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STL
+#include <cassert>
+// STDAIR
+#include <stdair/bom/BomRootStructure.hpp>
+#include <stdair/bom/BomRoot.hpp>
+#include <stdair/bom/Inventory.hpp>
+#include <stdair/bom/InventoryList.hpp>
+#include <stdair/bom/InventoryMap.hpp>
+#include <stdair/bom/FlightDate.hpp>
+#include <stdair/bom/SegmentDate.hpp>
+#include <stdair/bom/LegDate.hpp>
+#include <stdair/bom/SegmentCabin.hpp>
+#include <stdair/bom/LegCabin.hpp>
+#include <stdair/bom/BookingClass.hpp>
+
+namespace stdair {
+
+ // ////////////////////////////////////////////////////////////////////
+ BomRoot::BomRoot (BomStructure_T& ioBomRootStructure)
+ : _bomRootStructure (ioBomRootStructure) {
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ BomRoot::~BomRoot () {
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ InventoryList_T BomRoot::getInventoryList () const {
+ return _bomRootStructure.getChildrenList();
+ }
+
+ // //////////////////////////////////////////////////////////////////////
+ InventoryMap_T BomRoot::getInventoryMap () const {
+ return _bomRootStructure.getChildrenList();
+ }
+}
Copied: trunk/stdair/stdair/bom/BomRoot.hpp (from rev 45, trunk/stdair/stdair/bom/BomContentRoot.hpp)
===================================================================
--- trunk/stdair/stdair/bom/BomRoot.hpp (rev 0)
+++ trunk/stdair/stdair/bom/BomRoot.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -0,0 +1,129 @@
+#ifndef __STDAIR_BOM_BOMROOT_HPP
+#define __STDAIR_BOM_BOMROOT_HPP
+
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STDAIR
+#include <stdair/bom/BomRootContent.hpp>
+#include <stdair/bom/BomRootTypes.hpp>
+#include <stdair/bom/InventoryTypes.hpp>
+
+namespace stdair {
+ // Forward declarations.
+ class FacBomContent;
+ class Inventory;
+ struct InventoryList_T;
+ struct InventoryMap_T;
+
+ /** Class representing the actual functional/business content
+ for the Bom root. */
+ class BomRoot : public BomRootContent {
+ friend class FacBomContent;
+
+ // /////////////////////////////////////////////////////////////////////////
+ // Type definitions, compulsary for the STDAIR library to work correctly
+ // /////////////////////////////////////////////////////////////////////////
+ /** The following types must be defined:
+ <ul>
+ <li>Parent_T: Type corresponding to the parent BOM
+ class within that namespace (e.g., AIRSCHED here)</li>
+ <li>BomStructure_T: Type of the corresponding BOM class within
+ the stdair namespace</li>
+ <li>BomKey_T: Type of the corresponding BOM Key structure within
+ the stdair namespace</li>
+ <li>ContentChild_T: Type corresponding to the child BOM
+ class within that namespace (e.g., AIRSCHED here)</li>
+ </ul>
+ <br><br>
+ Note that the BomRoot has no parent. So, there is no need for
+ that class to define a Parent_T type.
+ <br><br>
+ Note that when there is a second type of children (for instance,
+ the FlightDate object contains two types of children, namely LegDate
+ and SegmentDate), an additional type definition must be given, namely
+ SecondContentChild_T. As, by default, there is a single type of
+ children, there is no need to specify "First" in the ContentChild_T
+ type.
+ */
+
+ public:
+ // /////////////////////////////////////////////////////////////////////////
+ /** Definition allowing to retrieve the associated BOM structure type. */
+ typedef BomRootStructure_T BomStructure_T;
+
+ /** Definition allowing to retrieve the associated BOM key type. */
+ typedef BomRootKey_T BomKey_T;
+
+ /** Definition allowing to retrieve the associated
+ BOM content child type. */
+ typedef Inventory ContentChild_T;
+ // /////////////////////////////////////////////////////////////////////////
+
+
+ // /////////////////////////////////////////////////////////////////////////
+ // In order to enable STL-iterator-like browsing of children objects,
+ // extra type definitions may be specified, such as the ones commented
+ // below. Hence, although those type definitions may appear not so simple
+ // (some will say "idiomatic"), they allow for a very simple use.
+ // /////////////////////////////////////////////////////////////////////////
+ /** Define the const iterator on the list of children objects . */
+ // typedef stdair::BomIterator_T<BomContent,
+ // BomStructureList_T::const_iterator> const_iterator;
+ // where BomStructureList_T is defined as std::vector<BomStructure_T*>
+ // /////////////////////////////////////////////////////////////////////////
+
+
+ public:
+ // /////////// Display support methods /////////
+ /** Dump a Business Object into an output stream.
+ @param ostream& the output stream. */
+ void toStream (std::ostream& ioOut) const { ioOut << toString(); }
+
+ /** Read a Business Object from an input stream.
+ @param istream& the input stream. */
+ void fromStream (std::istream& ioIn) { }
+
+ /** Get the serialised version of the Business Object. */
+ std::string toString() const { return describeKey(); }
+
+ /** Get a string describing the whole key (differentiating two objects
+ at any level). */
+ const std::string describeKey() const { return std::string (""); }
+
+ /** Get a string describing the short key (differentiating two objects
+ at the same level). */
+ const std::string describeShortKey() const { return std::string (""); }
+
+ public:
+ // /////////// Getters /////////////
+ /** Get a InventoryList_T for iteration methods. */
+ InventoryList_T getInventoryList () const;
+
+ /** Get a InventoryMap_T for iteration methods. */
+ InventoryMap_T getInventoryMap () const;
+
+ private:
+ /** Retrieve the BOM structure object. */
+ BomStructure_T& getBomStructure () {
+ return _bomRootStructure;
+ }
+
+ private:
+ /** Constructors are private so as to force the usage of the Factory
+ layer. */
+ /** Default constructors. */
+ BomRoot ();
+ BomRoot (const BomRoot&);
+ BomRoot (BomStructure_T&);
+ /** Destructor. */
+ virtual ~BomRoot();
+
+ private:
+ // Attributes
+ /** Reference structure. */
+ BomStructure_T& _bomRootStructure;
+ };
+
+}
+#endif // __STDAIR_BOM_BOMROOT_HPP
Added: trunk/stdair/stdair/bom/BomRootContent.cpp
===================================================================
--- trunk/stdair/stdair/bom/BomRootContent.cpp (rev 0)
+++ trunk/stdair/stdair/bom/BomRootContent.cpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -0,0 +1,19 @@
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STL
+#include <cassert>
+// STDAIR
+#include <stdair/bom/BomRootContent.hpp>
+
+namespace stdair {
+
+ // ////////////////////////////////////////////////////////////////////
+ BomRootContent::BomRootContent () {
+ }
+
+ // ////////////////////////////////////////////////////////////////////
+ BomRootContent::~BomRootContent () {
+ }
+
+}
Copied: trunk/stdair/stdair/bom/BomRootContent.hpp (from rev 45, trunk/stdair/stdair/bom/BomContentRoot.hpp)
===================================================================
--- trunk/stdair/stdair/bom/BomRootContent.hpp (rev 0)
+++ trunk/stdair/stdair/bom/BomRootContent.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -0,0 +1,49 @@
+#ifndef __STDAIR_BOM_BOMROOTCONTENT_HPP
+#define __STDAIR_BOM_BOMROOTCONTENT_HPP
+
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STDAIR
+#include <stdair/bom/BomContent.hpp>
+
+namespace stdair {
+ /** Class representing the actual attributes for the Bom root. */
+ class BomRootContent : public BomContent {
+
+ public:
+ // /////////// Display support methods /////////
+ /** Dump a Business Object into an output stream.
+ @param ostream& the output stream. */
+ virtual void toStream (std::ostream& ioOut) const = 0;
+
+ /** Read a Business Object from an input stream.
+ @param istream& the input stream. */
+ virtual void fromStream (std::istream& ioIn) = 0;
+
+ /** Get the serialised version of the Business Object. */
+ virtual std::string toString() const = 0;
+
+ /** Get a string describing the whole key (differentiating two objects
+ at any level). */
+ virtual const std::string describeKey() const = 0;
+
+ /** Get a string describing the short key (differentiating two objects
+ at the same level). */
+ virtual const std::string describeShortKey() const = 0;
+
+ protected:
+ /** Default constructors. */
+ BomRootContent ();
+ BomRootContent (const BomRootContent&);
+
+ /** Destructor. */
+ virtual ~BomRootContent();
+
+ protected:
+ // Attributes
+
+ };
+
+}
+#endif // __STDAIR_BOM_BOMROOTCONTENT_HPP
Copied: trunk/stdair/stdair/bom/BomRootKey.hpp (from rev 45, trunk/stdair/stdair/bom/BomStructureRootKey.hpp)
===================================================================
--- trunk/stdair/stdair/bom/BomRootKey.hpp (rev 0)
+++ trunk/stdair/stdair/bom/BomRootKey.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -0,0 +1,66 @@
+#ifndef __STDAIR_BOM_BOMROOTKEY_HPP
+#define __STDAIR_BOM_BOMROOTKEY_HPP
+
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STDAIR
+#include <stdair/STDAIR_Types.hpp>
+#include <stdair/bom/BomKey.hpp>
+
+namespace stdair {
+
+ // Forward declarations
+ template <typename BOM_CONTENT>
+ class BomRootStructure;
+
+ /** Key of the BOM structure root. */
+ template <typename BOM_CONTENT>
+ class BomRootKey : public BomKey {
+ friend class FacBomStructure;
+ friend class FacBomContent;
+
+ private:
+ // Type definitions
+ /** Definition allowing to retrieve the associated BOM structure type. */
+ typedef BomRootStructure<BOM_CONTENT> BomStructure_T;
+
+ public:
+ // /////////// Construction ///////////
+ /** Constructor. */
+ BomRootKey () {}
+
+ /** Destructor. */
+ ~BomRootKey () {}
+
+
+ // /////////// Display support methods /////////
+ /** Dump a Business Object Key into an output stream.
+ @param ostream& the output stream. */
+ void toStream (std::ostream& ioOut) const {
+ ioOut << "BomRootStructureKey: " << toString() << std::endl;
+ }
+
+ /** Read a Business Object Key from an input stream.
+ @param istream& the input stream. */
+ void fromStream (std::istream& ioIn) { }
+
+ /** Get the serialised version of the Business Object Key.
+ <br>That string is unique, at the level of a given Business Object,
+ when among children of a given parent Business Object.
+ <br>For instance, "H" and "K" allow to differentiate among two
+ marketing classes for the same segment-date. */
+ std::string toString() const {
+ std::ostringstream oStr;
+ oStr << " -- ROOT -- ";
+ return oStr.str();
+ }
+
+
+ private:
+ // Attributes
+ // No attributes, as that class corresponds to the root of Bom structure.
+ };
+
+}
+#endif // __STDAIR_BOM_BOMROOTKEY_HPP
Copied: trunk/stdair/stdair/bom/BomRootStructure.hpp (from rev 46, trunk/stdair/stdair/bom/BomStructureRoot.hpp)
===================================================================
--- trunk/stdair/stdair/bom/BomRootStructure.hpp (rev 0)
+++ trunk/stdair/stdair/bom/BomRootStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -0,0 +1,129 @@
+#ifndef __STDAIR_BOM_BOMROOTSTRUCTURE_HPP
+#define __STDAIR_BOM_BOMROOTSTRUCTURE_HPP
+
+// //////////////////////////////////////////////////////////////////////
+// Import section
+// //////////////////////////////////////////////////////////////////////
+// STL
+#include <cassert>
+// MPL
+#include <boost/mpl/vector.hpp>
+// STDAIR
+#include <stdair/bom/BomStructure.hpp>
+#include <stdair/bom/BomRootKey.hpp>
+#include <stdair/bom/BomChildrenHolderImp.hpp>
+#include <stdair/bom/InventoryStructure.hpp>
+
+namespace stdair {
+ // Forward declarations.
+ class BomStructureDummy;
+ class BomContentDummy;
+
+ /** Wrapper class aimed at holding the actual content, modeled
+ by a specific BomContentRoot class. */
+ template <typename BOM_CONTENT>
+ class BomRootStructure : public BomStructure {
+ friend class FacBomStructure;
+ friend class FacBomContent;
+ friend class BomStructure;
+
+ public:
+ // Type definitions
+ /** Definition allowing to retrieve the associated BOM content type. */
+ typedef BOM_CONTENT Content_T;
+
+ /** Definition allowing to retrieve the children type of the
+ BOM_CONTENT. */
+ typedef typename BOM_CONTENT::ContentChild_T ContentChild_T;
+
+ private:
+ // Type definitions
+ /** Definition allowing to retrieve the associated BOM key type. */
+ typedef BomRootKey<BOM_CONTENT> BomKey_T;
+
+ /** Definition allowing to retrieve the associated children type. */
+ typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T;
+
+ /** Definition allowing to retrive the default children bom holder type. */
+ typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T;
+
+ /** Definition allowing to retrive the children bom holder type. */
+ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T;
+
+ public:
+ // /////////// Getters /////////////
+ /** Get the BomRootStructure key. */
+ const BomKey_T& getKey() const {
+ return _key;
+ }
+
+ /** Get the list of inventories. */
+ const ChildrenBomHolder_T& getChildrenList() const {
+ assert (_childrenList != NULL);
+ return *_childrenList;
+ }
+
+ /** Get the list of inventories. */
+ void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) {
+ ioChildrenList = _childrenList;
+ }
+
+ private:
+ /////////////// Setters ////////////////
+ /** Default children list setter. */
+ void setChildrenList (DefaultChildrenBomHolder_T&) { }
+
+ /** Set the children list. */
+ void setChildrenList (ChildrenBomHolder_T& ioChildrenList) {
+ _childrenList = &ioChildrenList;
+ }
+
+ public:
+ // /////////// Display support methods /////////
+ /** Dump a Business Object into an output stream.
+ @param ostream& the output stream. */
+ void toStream (std::ostream& ioOut) const {
+ ioOut << toString() << std::endl;
+ }
+
+ /** Read a Business Object from an input stream.
+ @param istream& the input stream. */
+ void fromStream (std::istream& ioIn) { }
+
+ /** Get the serialised version of the Business Object. */
+ std::string toString() const { return describeKey(); }
+
+ /** Get a string describing the whole key (differentiating two objects
+ at any level). */
+ const std::string describeKey() const { return _key.toString(); }
+
+ /** Get a string describing the short key (differentiating two objects
+ at the same level). */
+ const std::string describeShortKey() const { return _key.toString(); }
+
+ private:
+ /** Constructors are private so as to force the usage of the Factory
+ layer. */
+ /** Default constructors. */
+ BomRootStructure ();
+ BomRootStructure (const BomRootStructure&);
+ BomRootStructure (const BomKey_T& iKey) { _key = iKey; }
+
+ /** Destructor. */
+ ~BomRootStructure () { }
+
+ private:
+ // Attributes
+ /** The key of both the structure and content objects. */
+ BomKey_T _key;
+
+ /** The actual functional (Business Object) content. */
+ BOM_CONTENT* _content;
+
+ /** List of inventories. */
+ ChildrenBomHolder_T* _childrenList;
+ };
+
+}
+#endif // __STDAIR_BOM_BOMROOTSTRUCTURE_HPP
+
Modified: trunk/stdair/stdair/bom/BomRootTypes.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomRootTypes.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BomRootTypes.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -8,20 +8,16 @@
namespace stdair {
// Forward declarations.
- template <typename BOM_CONTENT> class BomStructureRoot;
- template <typename BOM_CONTENT> class BomStructureRootKey;
- template <typename BOM_CHILD> class BomContentRoot;
- class Inventory;
+ template <typename BOM_CONTENT> class BomRootStructure;
+ template <typename BOM_CONTENT> class BomRootKey;
+ class BomRoot;
+
+ /** Define the BomRootStructure. */
+ typedef BomRootStructure<BomRoot> BomRootStructure_T;
- /** Define the BomContentRoot. */
- typedef BomContentRoot<Inventory> BomContentRoot_T;
+ /** Define the BomRootStructureKey. */
+ typedef BomRootKey<BomRoot> BomRootKey_T;
- /** Define the BomStructureRoot. */
- typedef BomStructureRoot<BomContentRoot_T> BomStructureRoot_T;
-
- /** Define the BomStructureRootKey. */
- typedef BomStructureRootKey<BomContentRoot_T> BomStructureRootKey_T;
-
}
#endif // __STDAIR_BOM_BOMROOTTYPES_HPP
Modified: trunk/stdair/stdair/bom/BomStructureDummy.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomStructureDummy.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BomStructureDummy.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -6,6 +6,7 @@
// //////////////////////////////////////////////////////////////////////
// STDAIR
#include <stdair/bom/BomStructure.hpp>
+#include <stdair/bom/BomKey.hpp>
#include <stdair/bom/BomChildrenHolderImp.hpp>
// MPL
#include <boost/mpl/vector.hpp>
@@ -13,7 +14,6 @@
namespace stdair {
// Forward declarations.
class BomContentDummy;
- class BomKey;
/** Wrapper class aimed at holding the actual content, modeled
by a specific BomContentDummy class. */
Deleted: trunk/stdair/stdair/bom/BomStructureRoot.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomStructureRoot.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BomStructureRoot.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -1,125 +0,0 @@
-#ifndef __STDAIR_BOM_BOMSTRUCTUREROOT_HPP
-#define __STDAIR_BOM_BOMSTRUCTUREROOT_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STDAIR
-#include <stdair/bom/BomStructure.hpp>
-#include <stdair/bom/BomStructureRootKey.hpp>
-#include <stdair/bom/BomChildrenHolderImp.hpp>
-// MPL
-#include <boost/mpl/vector.hpp>
-
-namespace stdair {
- // Forward declarations.
- template <typename BOM_CONTENT> class InventoryStructure;
- class BomStructureDummy;
- class BomContentDummy;
-
- /** Wrapper class aimed at holding the actual content, modeled
- by a specific BomContentRoot class. */
- template <typename BOM_CONTENT>
- class BomStructureRoot : public BomStructure {
- friend class FacBomStructure;
- friend class FacBomContent;
-
- // Type definitions
- /** Definition allowing to retrieve the associated BOM content type. */
- typedef BOM_CONTENT Content_T;
-
- /** Definition allowing to retrieve the children type of the
- BOM_CONTENT. */
- typedef typename BOM_CONTENT::ContentChild_T ContentChild_T;
-
- private:
- // Type definitions
- /** Definition allowing to retrieve the associated BOM key type. */
- typedef BomStructureRootKey<BOM_CONTENT> BomKey_T;
-
- /** Definition allowing to retrieve the associated children type. */
- typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T;
-
- /** Definition allowing to retrive the default children bom holder type. */
- typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T;
-
- /** Definition allowing to retrive the children bom holder type. */
- typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T;
-
- public:
-
- // /////////// Getters /////////////
- /** Get the BomStructureRoot key. */
- const BomKey_T& getKey() const {
- return _key;
- }
-
- /** Get the list of inventories. */
- const ChildrenBomHolder_T& getChildrenList() const {
- return *_childrenList;
- }
-
- /** Get the list of inventories. */
- void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) {
- ioChildrenList = _childrenList;
- }
-
- private:
- /////////////// Setters ////////////////
- /** Default children list setter. */
- void setChildrenList (DefaultChildrenBomHolder_T&) { }
-
- /** Set the children list. */
- void setChildrenList (ChildrenBomHolder_T& ioChildrenList) {
- _childrenList = &ioChildrenList;
- }
-
- public:
- // /////////// Display support methods /////////
- /** Dump a Business Object into an output stream.
- @param ostream& the output stream. */
- void toStream (std::ostream& ioOut) const {
- ioOut << toString() << std::endl;
- }
-
- /** Read a Business Object from an input stream.
- @param istream& the input stream. */
- void fromStream (std::istream& ioIn) { }
-
- /** Get the serialised version of the Business Object. */
- std::string toString() const { return describeKey(); }
-
- /** Get a string describing the whole key (differentiating two objects
- at any level). */
- const std::string describeKey() const { return _key.toString(); }
-
- /** Get a string describing the short key (differentiating two objects
- at the same level). */
- const std::string describeShortKey() const { return _key.toString(); }
-
- private:
- /** Constructors are private so as to force the usage of the Factory
- layer. */
- /** Default constructors. */
- BomStructureRoot ();
- BomStructureRoot (const BomStructureRoot&);
- BomStructureRoot (const BomKey_T& iKey) { _key = iKey; }
-
- /** Destructor. */
- ~BomStructureRoot () { }
-
- private:
- // Attributes
- /** The key of both the structure and content objects. */
- BomKey_T _key;
-
- /** The actual functional (Business Object) content. */
- BOM_CONTENT* _content;
-
- /** List of inventories. */
- ChildrenBomHolder_T* _childrenList;
- };
-
-}
-#endif // __STDAIR_BOM_BOMSTRUCTUREROOT_HPP
-
Deleted: trunk/stdair/stdair/bom/BomStructureRootKey.hpp
===================================================================
--- trunk/stdair/stdair/bom/BomStructureRootKey.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BomStructureRootKey.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -1,66 +0,0 @@
-#ifndef __STDAIR_BOM_BOMSTRUCTUREROOTKEY_HPP
-#define __STDAIR_BOM_BOMSTRUCTUREROOTKEY_HPP
-
-// //////////////////////////////////////////////////////////////////////
-// Import section
-// //////////////////////////////////////////////////////////////////////
-// STDAIR
-#include <stdair/STDAIR_Types.hpp>
-#include <stdair/bom/BomKey.hpp>
-
-namespace stdair {
-
- // Forward declarations
- template <typename BOM_CONTENT>
- class BomStructureRoot;
-
- /** Key of the BOM structure root. */
- template <typename BOM_CONTENT>
- class BomStructureRootKey : public BomKey {
- friend class FacBomStructure;
- friend class FacBomContent;
-
- private:
- // Type definitions
- /** Definition allowing to retrieve the associated BOM structure type. */
- typedef BomStructureRoot<BOM_CONTENT> BomStructure_T;
-
- public:
- // /////////// Construction ///////////
- /** Constructor. */
- BomStructureRootKey () {}
-
- /** Destructor. */
- ~BomStructureRootKey () {}
-
-
- // /////////// Display support methods /////////
- /** Dump a Business Object Key into an output stream.
- @param ostream& the output stream. */
- void toStream (std::ostream& ioOut) const {
- ioOut << "BomStructureRootKey: " << toString() << std::endl;
- }
-
- /** Read a Business Object Key from an input stream.
- @param istream& the input stream. */
- void fromStream (std::istream& ioIn) { }
-
- /** Get the serialised version of the Business Object Key.
- <br>That string is unique, at the level of a given Business Object,
- when among children of a given parent Business Object.
- <br>For instance, "H" and "K" allow to differentiate among two
- marketing classes for the same segment-date. */
- std::string toString() const {
- std::ostringstream oStr;
- oStr << " -- ROOT -- ";
- return oStr.str();
- }
-
-
- private:
- // Attributes
- // No attributes, as that class corresponds to the root of Bom structure.
- };
-
-}
-#endif // __STDAIR_BOM_BOMSTRUCTUREROOTKEY_HPP
Modified: trunk/stdair/stdair/bom/BookingClass.hpp
===================================================================
--- trunk/stdair/stdair/bom/BookingClass.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BookingClass.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -25,7 +25,7 @@
// Type definitions
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef SegmentCabin ParentBomContent_T;
+ typedef SegmentCabin Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef BookingClassStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/BookingClassStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -37,7 +37,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the associated children type. */
typedef boost::mpl::vector <BomStructureDummy,
Modified: trunk/stdair/stdair/bom/FlightDate.cpp
===================================================================
--- trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -7,8 +7,9 @@
#include <iostream>
#include <algorithm>
// STDAIR
+#include <stdair/bom/FlightDateStructure.hpp>
+#include <stdair/bom/BomRoot.hpp>
#include <stdair/bom/Inventory.hpp>
-#include <stdair/bom/FlightDateStructure.hpp>
#include <stdair/bom/FlightDate.hpp>
#include <stdair/bom/SegmentDate.hpp>
#include <stdair/bom/SegmentDateList.hpp>
Modified: trunk/stdair/stdair/bom/FlightDate.hpp
===================================================================
--- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -28,12 +28,12 @@
public:
// Type definitions
// /////////////////////////////////////////////////////////////////////////
- // See the explanations, within the BomContentRoot class, for all
+ // See the explanations, within the BomRoot class, for all
// the types which require to be specified below
// /////////////////////////////////////////////////////////////////////////
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef Inventory ParentBomContent_T;
+ typedef Inventory Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef FlightDateStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/FlightDateStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -16,7 +16,6 @@
namespace stdair {
// Forward declaration
- template <typename BOM_CONTENT> class InventoryStructure;
class BomContentDummy;
/** Wrapper class aimed at holding the actual content, modeled
@@ -38,7 +37,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the children type of the
BOM_CONTENT. */
Modified: trunk/stdair/stdair/bom/Inventory.cpp
===================================================================
--- trunk/stdair/stdair/bom/Inventory.cpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/Inventory.cpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -5,6 +5,7 @@
#include <cassert>
// STDAIR
#include <stdair/bom/InventoryStructure.hpp>
+#include <stdair/bom/BomRoot.hpp>
#include <stdair/bom/Inventory.hpp>
#include <stdair/bom/FlightDate.hpp>
#include <stdair/bom/FlightDateList.hpp>
Modified: trunk/stdair/stdair/bom/Inventory.hpp
===================================================================
--- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -5,16 +5,16 @@
// Import section
// //////////////////////////////////////////////////////////////////////
// STDAIR
-#include <stdair/bom/BomContentRoot.hpp>
-#include <stdair/bom/InventoryContent.hpp>
#include <stdair/bom/BomRootTypes.hpp>
#include <stdair/bom/InventoryTypes.hpp>
#include <stdair/bom/FlightDateTypes.hpp>
+#include <stdair/bom/InventoryContent.hpp>
namespace stdair {
// Forward declarations
class FacBomContent;
+ class BomRoot;
class FlightDate;
struct FlightDateList_T;
struct FlightDateMap_T;
@@ -26,12 +26,12 @@
public:
// /////////////////////////////////////////////////////////////////////////
- // See the explanations, within the BomContentRoot class, for all
+ // See the explanations, within the BomRoot class, for all
// the types which require to be specified below
// /////////////////////////////////////////////////////////////////////////
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef BomContentRoot_T ParentBomContent_T;
+ typedef BomRoot Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef InventoryStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/InventoryContent.hpp
===================================================================
--- trunk/stdair/stdair/bom/InventoryContent.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/InventoryContent.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -4,7 +4,8 @@
// //////////////////////////////////////////////////////////////////////
// Import section
// //////////////////////////////////////////////////////////////////////
-// STDAIR
+// STDAIR
+#include <stdair/STDAIR_Types.hpp>
#include <stdair/bom/BomContent.hpp>
namespace stdair {
@@ -32,7 +33,80 @@
at the same level). */
virtual const std::string describeShortKey() const = 0;
-
+ public:
+ // ////////// Getters ////////////
+ /** Get the booking counter. */
+ const NbOfBookings_T& getBookingCounter () const {
+ return _bookingCounter;
+ }
+
+ /** Get the total inventory revenue. */
+ const Revenue_T& getRevenue () const {
+ return _inventoryRevenue;
+ }
+
+ /** Get the inventory average fare. */
+ const Fare_T& getAverageFare() const {
+ return _inventoryAverageFare;
+ }
+
+ /** Get the Availability Seat Kilometer for the inventory. */
+ const Distance_T& getASK() const {
+ return _inventoryASK;
+ }
+
+ /** Get the yield value for the inventory. */
+ const Revenue_T& getYield () const {
+ return _inventoryYield;
+ }
+
+ /** Get the Revenue Passanger Kilometer for the whole inventory. */
+ const Distance_T& getRPK() const {
+ return _inventoryRPK;
+ }
+
+ /** Get the unit revenue value for the whole inventory. */
+ const Revenue_T& getUnitRevenue () const {
+ return _inventoryUnitRevenue;
+ }
+
+ /** Get the load factor value for this inventory. */
+ const Revenue_T& getLoadFactor () const {
+ return _inventoryLoadFactor;
+ }
+
+ public:
+ // ///////// Setters //////////
+ /** Set the revenue amount. */
+ void setRevenue (const Revenue_T& iInventoryRevenue) {
+ _inventoryRevenue = iInventoryRevenue;
+ }
+
+ /** Set the Revenue Passanger Kilometer. */
+ void setRPK (const Distance_T& iInventoryRPK) {
+ _inventoryRPK = iInventoryRPK;
+ }
+
+ /** Set the unit revenue. */
+ void setUnitRevenue (const Revenue_T& iInventoryURevenue) {
+ _inventoryUnitRevenue = iInventoryURevenue;
+ }
+
+ /** Set the average fare. */
+ void setAverageFare(Fare_T iIAFare) {
+ _inventoryAverageFare = iIAFare;
+ }
+
+ /** Set the yield. */
+ void setYield (const Revenue_T& iInvYield) {
+ _inventoryYield = iInvYield;
+ }
+
+ /** Set the load factor. */
+ void setLoadFactor (const Revenue_T& iInventoryLF) {
+ _inventoryLoadFactor = iInventoryLF;
+ }
+
protected:
/** Default constructors. */
InventoryContent ();
@@ -43,6 +117,31 @@
protected:
// Attributes
+ /** Counter of all bookings into the inventory. */
+ NbOfBookings_T _bookingCounter;
+
+ /** Total amount of money earn with all flight bookings
+ for one airline. */
+ Revenue_T _inventoryRevenue;
+
+ /** Value of the average fare of the inventory.*/
+ Fare_T _inventoryAverageFare;
+
+ /** Value of the Available Seat Kilometer for this Inventory.*/
+ Distance_T _inventoryASK;
+
+ /** Value of the Yield (Revenue/ASK). */
+ Revenue_T _inventoryYield;
+
+ /** Value of the Revenue Passanger Kilometer for the whole inventory.*/
+ Distance_T _inventoryRPK;
+
+ /** Value of the Unit Revenue (Revenue/RPK). */
+ Revenue_T _inventoryUnitRevenue;
+
+ /** Value of the Load Factor (ASK/RPK). */
+ Revenue_T _inventoryLoadFactor;
+
};
}
Modified: trunk/stdair/stdair/bom/InventoryStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -12,13 +12,11 @@
#include <stdair/bom/BomStructure.hpp>
#include <stdair/bom/InventoryKey.hpp>
#include <stdair/bom/BomChildrenHolderImp.hpp>
-#include <stdair/bom/BomIterator.hpp>
#include <stdair/bom/FlightDateStructure.hpp>
namespace stdair {
// Forward declaration
- template <typename BOM_CONTENT> class BomStructureRoot;
class BomStructureDummy;
class BomContentDummy;
@@ -45,7 +43,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the associated children type. */
typedef boost::mpl::vector<FlightDateStructure<ContentChild_T>,
Modified: trunk/stdair/stdair/bom/LegCabin.hpp
===================================================================
--- trunk/stdair/stdair/bom/LegCabin.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/LegCabin.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -22,7 +22,7 @@
// Type definitions
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef LegDate ParentBomContent_T;
+ typedef LegDate Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef LegCabinStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/LegCabinStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -38,7 +38,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the associated children type. */
typedef boost::mpl::vector <BomStructureDummy,
Modified: trunk/stdair/stdair/bom/LegDate.hpp
===================================================================
--- trunk/stdair/stdair/bom/LegDate.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -25,7 +25,7 @@
// Type definitions
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef FlightDate ParentBomContent_T;
+ typedef FlightDate Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef LegDateStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/LegDateStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -38,7 +38,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the children type of the
BOM_CONTENT. */
Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentCabin.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -25,7 +25,7 @@
// Type definitions
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef SegmentDate ParentBomContent_T;
+ typedef SegmentDate Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef SegmentCabinStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/SegmentCabinStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentCabinStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/SegmentCabinStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -38,7 +38,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the children type of the
BOM_CONTENT. */
Modified: trunk/stdair/stdair/bom/SegmentDate.hpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -25,7 +25,7 @@
// Type definitions
/** Definition allowing to retrieve the associated parent
BOM content type. */
- typedef FlightDate ParentBomContent_T;
+ typedef FlightDate Parent_T;
/** Definition allowing to retrieve the associated BOM structure type. */
typedef SegmentDateStructure_T BomStructure_T;
Modified: trunk/stdair/stdair/bom/SegmentDateStructure.hpp
===================================================================
--- trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-10-15 15:11:19 UTC (rev 47)
@@ -38,7 +38,7 @@
/** Definition allowing to retrieve the associated parent
BOM structure type. */
- typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T;
+ typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T;
/** Definition allowing to retrieve the children type of the
BOM_CONTENT. */
Modified: trunk/stdair/stdair/bom/sources.mk
===================================================================
--- trunk/stdair/stdair/bom/sources.mk 2009-10-15 09:21:08 UTC (rev 46)
+++ trunk/stdair/stdair/bom/sources.mk 2009-10-15 15:11:19 UTC (rev 47)
@@ -1,6 +1,6 @@
bom_h_sources = \
$(top_srcdir)/stdair/bom/BomKey.hpp \
- $(top_srcdir)/stdair/bom/BomStructureRootKey.hpp \
+ $(top_srcdir)/stdair/bom/BomRootKey.hpp \
$(top_srcdir)/stdair/bom/InventoryKey.hpp \
$(top_srcdir)/stdair/bom/FlightDateKey.hpp \
$(top_srcdir)/stdair/bom/LegDateKey.hpp \
@@ -8,8 +8,12 @@
$(top_srcdir)/stdair/bom/SegmentCabinKey.hpp \
$(top_srcdir)/stdair/bom/BookingClassK...
[truncated message content] |