From: <qua...@us...> - 2010-04-09 15:07:29
|
Revision: 172 http://stdair.svn.sourceforge.net/stdair/?rev=172&view=rev Author: quannaus Date: 2010-04-09 15:07:22 +0000 (Fri, 09 Apr 2010) Log Message: ----------- [Dev] Added several inventory objects. Modified Paths: -------------- trunk/stdair/stdair/batches/stdair.cpp trunk/stdair/stdair/bom/BR.cpp trunk/stdair/stdair/bom/BR.hpp trunk/stdair/stdair/bom/BomMap.hpp trunk/stdair/stdair/bom/FD.cpp trunk/stdair/stdair/bom/FD.hpp trunk/stdair/stdair/bom/IN.cpp trunk/stdair/stdair/bom/IN.hpp trunk/stdair/stdair/bom/LegCabinKey.hpp trunk/stdair/stdair/bom/ND.cpp trunk/stdair/stdair/bom/ND.hpp trunk/stdair/stdair/bom/Structure.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/factory/FacBomContent.hpp trunk/stdair/stdair/factory/FacBomStructure.hpp Added Paths: ----------- trunk/stdair/stdair/bom/BC.cpp trunk/stdair/stdair/bom/BC.hpp trunk/stdair/stdair/bom/BCTypes.hpp trunk/stdair/stdair/bom/BK.cpp trunk/stdair/stdair/bom/BK.hpp trunk/stdair/stdair/bom/BKTypes.hpp trunk/stdair/stdair/bom/BucketContent.cpp trunk/stdair/stdair/bom/BucketContent.hpp trunk/stdair/stdair/bom/BucketKey.cpp trunk/stdair/stdair/bom/BucketKey.hpp trunk/stdair/stdair/bom/LC.cpp trunk/stdair/stdair/bom/LC.hpp trunk/stdair/stdair/bom/LCTypes.hpp trunk/stdair/stdair/bom/LD.cpp trunk/stdair/stdair/bom/LD.hpp trunk/stdair/stdair/bom/LDTypes.hpp trunk/stdair/stdair/bom/SC.cpp trunk/stdair/stdair/bom/SC.hpp trunk/stdair/stdair/bom/SCTypes.hpp trunk/stdair/stdair/bom/SD.cpp trunk/stdair/stdair/bom/SD.hpp trunk/stdair/stdair/bom/SDTypes.hpp Removed Paths: ------------- trunk/stdair/stdair/bom/BRKey.hpp trunk/stdair/stdair/bom/FDKey.hpp trunk/stdair/stdair/bom/INKey.hpp trunk/stdair/stdair/bom/NDKey.hpp Modified: trunk/stdair/stdair/batches/stdair.cpp =================================================================== --- trunk/stdair/stdair/batches/stdair.cpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/batches/stdair.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -7,16 +7,15 @@ // StdAir #include <stdair/STDAIR_Types.hpp> #include <stdair/bom/BR.hpp> -#include <stdair/bom/BRKey.hpp> #include <stdair/bom/BRTypes.hpp> #include <stdair/bom/IN.hpp> -#include <stdair/bom/INKey.hpp> +#include <stdair/bom/InventoryKey.hpp> #include <stdair/bom/INTypes.hpp> #include <stdair/bom/FD.hpp> -#include <stdair/bom/FDKey.hpp> +#include <stdair/bom/FlightDateKey.hpp> #include <stdair/bom/FDTypes.hpp> #include <stdair/bom/ND.hpp> -#include <stdair/bom/NDKey.hpp> +#include <stdair/bom/NetworkDateKey.hpp> #include <stdair/bom/NDTypes.hpp> #include <stdair/bom/BomList.hpp> #include <stdair/factory/FacBomContent.hpp> @@ -25,21 +24,20 @@ // ///////// M A I N //////////// int main (int argc, char* argv[]) { try { - stdair::BRKey_T lBRKey; stdair::BR& lBR = - stdair::FacBomContent::instance().testCreate<stdair::BR> (lBRKey); + stdair::FacBomContent::instance().testCreate<stdair::BR> (); - stdair::INKey_T lINKey ("BA"); + stdair::InventoryKey_T lINKey ("BA"); stdair::IN& lIN = stdair::FacBomContent::instance().testCreate<stdair::IN> (lINKey); stdair::FacBomContent::testLink (lIN, lBR); - stdair::FDKey_T lFDKey (17); + stdair::FlightDateKey_T lFDKey (17, stdair::Date_T (2010, 02, 14)); stdair::FD& lFD = stdair::FacBomContent::instance().testCreate<stdair::FD> (lFDKey); stdair::FacBomContent::testLink (lFD, lIN); - stdair::NDKey_T lNDKey (1); + stdair::NetworkDateKey_T lNDKey (stdair::Date_T (2010, 02, 14)); stdair::ND& lND = stdair::FacBomContent::instance().testCreate<stdair::ND> (lNDKey); stdair::FacBomContent::testLink (lND, lIN); Copied: trunk/stdair/stdair/bom/BC.cpp (from rev 171, trunk/stdair/stdair/bom/FD.cpp) =================================================================== --- trunk/stdair/stdair/bom/BC.cpp (rev 0) +++ trunk/stdair/stdair/bom/BC.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,21 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/BC.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BC::BC (const BomKey_T& iKey, BomStructure_T& ioBCStructure) + : BookingClassContent (iKey), _structure (ioBCStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BC::~BC () { + } + +} Copied: trunk/stdair/stdair/bom/BC.hpp (from rev 171, trunk/stdair/stdair/bom/FD.hpp) =================================================================== --- trunk/stdair/stdair/bom/BC.hpp (rev 0) +++ trunk/stdair/stdair/bom/BC.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,83 @@ +#ifndef __STDAIR_BOM_BC_HPP +#define __STDAIR_BOM_BC_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +// BOOST Fusion +#include <boost/fusion/include/map.hpp> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/BookingClassContent.hpp> +#include <stdair/bom/BCTypes.hpp> +#include <stdair/bom/BCTypes.hpp> + +namespace stdair { + // Forward declarations. + class SC; + + /** Class representing the actual functional/business content + for the Bom root. */ + class BC : public BookingClassContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent. */ + typedef SC Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef BCStructure_T BomStructure_T; + + /** Define the list of children holder types. */ + typedef boost::fusion::map< > ChildrenHolderTypeMap_T; + // ///////////////////////////////////////////////////////////////////////// + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getStructure () { + return _structure; + } + + 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 _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + BC (); + BC (const BC&); + BC (const BomKey_T& iKey, BomStructure_T& ioStructure); + /** Destructor. */ + virtual ~BC(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _structure; + + }; + +} +#endif // __STDAIR_BOM_BC_HPP Copied: trunk/stdair/stdair/bom/BCTypes.hpp (from rev 169, trunk/stdair/stdair/bom/FDTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/BCTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/BCTypes.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,31 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_BCTYPES_HPP +#define __STDAIR_BOM_BCTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace stdair { + // Forward declarations. + template <typename CONTENT> class Structure; + template <typename CONTENT> class BomChildrenHolderImp; + template <typename BOM> struct BomList_T; + template <typename BOM> struct BomMap_T; + class BC; + + /** Define the BomRootStructure. */ + typedef Structure<BC> BCStructure_T; + + /** Define the Inventory holder type. */ + typedef BomChildrenHolderImp<BC> BCHolder_T; + + /** Define the Inventory list. */ + typedef BomList_T<BC> BCList_T; + + /** Define the Inventory map. */ + typedef BomMap_T<BC> BCMap_T; + +} +#endif // __STDAIR_BOM_BCTYPES_HPP + Copied: trunk/stdair/stdair/bom/BK.cpp (from rev 171, trunk/stdair/stdair/bom/FD.cpp) =================================================================== --- trunk/stdair/stdair/bom/BK.cpp (rev 0) +++ trunk/stdair/stdair/bom/BK.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,21 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/BK.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BK::BK (const BomKey_T& iKey, BomStructure_T& ioBKStructure) + : BucketContent (iKey), _structure (ioBKStructure) { + } + + // //////////////////////////////////////////////////////////////////// + BK::~BK () { + } + +} Copied: trunk/stdair/stdair/bom/BK.hpp (from rev 171, trunk/stdair/stdair/bom/FD.hpp) =================================================================== --- trunk/stdair/stdair/bom/BK.hpp (rev 0) +++ trunk/stdair/stdair/bom/BK.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,83 @@ +#ifndef __STDAIR_BOM_BK_HPP +#define __STDAIR_BOM_BK_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +// BOOST Fusion +#include <boost/fusion/include/map.hpp> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/BucketContent.hpp> +#include <stdair/bom/BKTypes.hpp> +#include <stdair/bom/BKTypes.hpp> + +namespace stdair { + // Forward declarations. + class LC; + + /** Class representing the actual functional/business content + for the Bom root. */ + class BK : public BucketContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent. */ + typedef LC Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef BKStructure_T BomStructure_T; + + /** Define the list of children holder types. */ + typedef boost::fusion::map< > ChildrenHolderTypeMap_T; + // ///////////////////////////////////////////////////////////////////////// + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getStructure () { + return _structure; + } + + 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 _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + BK (); + BK (const BK&); + BK (const BomKey_T& iKey, BomStructure_T& ioStructure); + /** Destructor. */ + virtual ~BK(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _structure; + + }; + +} +#endif // __STDAIR_BOM_BK_HPP Copied: trunk/stdair/stdair/bom/BKTypes.hpp (from rev 169, trunk/stdair/stdair/bom/FDTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/BKTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/BKTypes.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,31 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_BKTYPES_HPP +#define __STDAIR_BOM_BKTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace stdair { + // Forward declarations. + template <typename CONTENT> class Structure; + template <typename CONTENT> class BomChildrenHolderImp; + template <typename BOM> struct BomList_T; + template <typename BOM> struct BomMap_T; + class BK; + + /** Define the BomRootStructure. */ + typedef Structure<BK> BKStructure_T; + + /** Define the Inventory holder type. */ + typedef BomChildrenHolderImp<BK> BKHolder_T; + + /** Define the Inventory list. */ + typedef BomList_T<BK> BKList_T; + + /** Define the Inventory map. */ + typedef BomMap_T<BK> BKMap_T; + +} +#endif // __STDAIR_BOM_BKTYPES_HPP + Modified: trunk/stdair/stdair/bom/BR.cpp =================================================================== --- trunk/stdair/stdair/bom/BR.cpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/BR.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -8,13 +8,13 @@ #include <stdair/bom/BR.hpp> #include <stdair/bom/IN.hpp> #include <stdair/bom/BomList.hpp> -#include <stdair/bom/Structure.hpp> +#include <stdair/bom/BomMap.hpp> namespace stdair { // //////////////////////////////////////////////////////////////////// - BR::BR (const Key_T& iKey, BomStructure_T& ioBRStructure) - : _key (iKey), _structure (ioBRStructure) { + BR::BR (const BomKey_T& iKey, BomStructure_T& ioBRStructure) + : BomRootContent (iKey), _structure (ioBRStructure) { } // //////////////////////////////////////////////////////////////////// @@ -26,4 +26,8 @@ return _structure.getChildrenHolder<IN>(); } + // //////////////////////////////////////////////////////////////////// + const INMap_T BR::getINMap () const { + return _structure.getChildrenHolder<IN>(); + } } Modified: trunk/stdair/stdair/bom/BR.hpp =================================================================== --- trunk/stdair/stdair/bom/BR.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/BR.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -9,19 +9,17 @@ // BOOST Fusion #include <boost/fusion/include/map.hpp> // STDAIR -#include <stdair/bom/BomContent.hpp> -#include <stdair/bom/BRKey.hpp> +#include <stdair/bom/BomRootContent.hpp> #include <stdair/bom/BRTypes.hpp> #include <stdair/bom/INTypes.hpp> namespace stdair { // Forward declarations. - class FacBomContent; class IN; /** Class representing the actual functional/business content for the Bom root. */ - class BR : public BomContent { + class BR : public BomRootContent { friend class FacBomContent; public: @@ -29,9 +27,6 @@ /** Definition allowing to retrieve the associated BOM structure type. */ typedef BRStructure_T BomStructure_T; - /** Definition allowing to retrieve the associated BOM key type. */ - typedef BRKey_T Key_T; - /** Define the list of children holder types. */ typedef boost::fusion::map< boost::fusion::pair<IN, INHolder_T*> > ChildrenHolderTypeMap_T; @@ -64,15 +59,9 @@ public: // /////////// Getters ///////////// - const Key_T& getKey () const { - return _key; - } - const INList_T getINList () const; + const INMap_T getINMap () const; - public: - // //////////// Setters ////////////// - private: /** Retrieve the BOM structure object. */ BomStructure_T& getStructure () { @@ -85,15 +74,12 @@ /** Default constructors. */ BR (); BR (const BR&); - BR (const Key_T& iKey, BomStructure_T& ioStructure); + BR (const BomKey_T& iKey, BomStructure_T& ioStructure); /** Destructor. */ virtual ~BR(); private: // Attributes - /** Key. */ - Key_T _key; - /** Reference structure. */ BomStructure_T& _structure; }; Deleted: trunk/stdair/stdair/bom/BRKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BRKey.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/BRKey.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -1,30 +0,0 @@ -#ifndef __STDAIR_BOM_BRKEY_HPP -#define __STDAIR_BOM_BRKEY_HPP - -#include <sstream> - -namespace stdair { - struct BRKey_T { - - // /////////// Display support methods ///////// - void toStream (std::ostream& ioOut) const { - ioOut << "BRKey: " << toString() << std::endl; - } - - void fromStream (std::istream& ioIn) { - } - - const std::string toString() const { - std::ostringstream oStr; - oStr << " -- ROOT -- "; - return oStr.str(); - } - - const std::string describe() const { - return toString(); - } - - }; -} - -#endif // __STDAIR_BOM_BRKEY_HPP Modified: trunk/stdair/stdair/bom/BomMap.hpp =================================================================== --- trunk/stdair/stdair/bom/BomMap.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/BomMap.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -6,6 +6,8 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <map> +// STDAIR +#include <stdair/basic/BasTypes.hpp> namespace stdair { @@ -30,8 +32,11 @@ // the iterator types specified below // ///////////////////////////////////////////////////////////////////////// /** Define the bom map iterators. */ - typedef BomIterator_T<BOM, typename BomStructureMap_T::const_iterator> iterator; - typedef BomIterator_T<BOM, typename BomStructureMap_T::const_reverse_iterator> reverse_iterator; + typedef BomIterator_T<BOM, + typename BomStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<BOM, + typename BomStructureMap_T::const_reverse_iterator + > reverse_iterator; // ///////////////////////////////////////////////////////////////////////// public: Copied: trunk/stdair/stdair/bom/BucketContent.cpp (from rev 169, trunk/stdair/stdair/bom/BookingClassContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/BucketContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/BucketContent.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,57 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/basic/BasConst_BookingClass.hpp> +#include <stdair/basic/BasConst_Yield.hpp> +#include <stdair/bom/BucketContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BucketContent::BucketContent (const BomKey_T& iKey) + : _key (iKey), + _nbOfBookings (DEFAULT_CLASS_NB_OF_BOOKINGS), + _totalNbOfBookings (DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS), + _lastDCPTotalNbOfBookings (DEFAULT_CLASS_TOTAL_NB_OF_BOOKINGS), + _unconstrainedDemand (DEFAULT_CLASS_UNCONSTRAINED_DEMAND), + _nbOfCancellations (DEFAULT_CLASS_NB_OF_CANCELLATIONS), + _nbOfNoShows (DEFAULT_CLASS_NB_OF_NOSHOWS), + _availability (DEFAULT_CLASS_AVAILABILITY), + _classRevenue (DEFAULT_REVENUE_VALUE), + _currentCensorshipFlag (DEFAULT_CLASS_CENSORSHIPFLAG), + _censorshipFlagList (DEFAULT_CLASS_CENSORSHIPFLAG_LIST), + _bookingLimit (DEFAULT_CLASS_BOOKING_LIMIT), + _authorizationLevel(DEFAULT_CLASS_AUTHORIZATION_LEVEL), + _MAX (DEFAULT_CLASS_MAX_AUTHORIZATION_LEVEL), + _MIN (DEFAULT_CLASS_MIN_AUTHORIZATION_LEVEL), + _overbookingRate (1 + DEFAULT_CLASS_OVERBOOKING_RATE), + _fare (DEFAULT_CLASS_FARE_VALUE), + _adjustedYield (DEFAULT_YIELD_VALUE), + _yield (DEFAULT_YIELD_VALUE), + _remainingDemandMean (DEFAULT_CLASS_REMAINING_DEMAND_MEAN), + _remainingProductDemandMean (DEFAULT_CLASS_REMAINING_DEMAND_MEAN), + _remainingDemandSD (DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION), + _remainingProductDemandSD (DEFAULT_CLASS_REMAINING_DEMAND_STANDARD_DEVIATION) { + } + + // //////////////////////////////////////////////////////////////////// + BucketContent::~BucketContent () { + } + + // //////////////////////////////////////////////////////////////////// + void BucketContent::setRemainingDemandMean(NbOfBookings_T& iMean) { + _remainingDemandMean = iMean; + _remainingProductDemandMean = iMean; + } + + // //////////////////////////////////////////////////////////////////// + void BucketContent::setRemainingDemandSD(NbOfBookings_T& iSD) { + _remainingDemandSD = iSD; + _remainingProductDemandSD = iSD; + } + +} + Copied: trunk/stdair/stdair/bom/BucketContent.hpp (from rev 169, trunk/stdair/stdair/bom/BookingClassContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/BucketContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/BucketContent.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,329 @@ +#ifndef __STDAIR_BOM_BUCKETCONTENT_HPP +#define __STDAIR_BOM_BUCKETCONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/BucketKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for an airline booking class. */ + class BucketContent : public BomContent { + public: + // Type definitions. + /** Definition allowing to retrieve the associated BOM key type. */ + typedef BucketKey_T BomKey_T; + + public: + // /////////// Getters //////////// + /** Get the booking class key. */ + const BomKey_T& getKey() const { + return _key; + } + + /** Get the booking code (part of the primary key). */ + const ClassCode_T& getClassCode() const { + return _key.getClassCode(); + } + + /** Get the number of bookings of the bookingClass. */ + const NbOfBookings_T& getNbOfBookings() const { + return _nbOfBookings; + } + + /** Get the number of bookings (without cancellation counted) + of the bookingClass. */ + const NbOfBookings_T& getTotalNbOfBookings() const { + return _totalNbOfBookings; + } + + /** Get the number of bookings at the last DCP(without + cancellation counted) of the bookingClass. */ + const NbOfBookings_T& getLastDCPTotalNbOfBookings() const { + return _lastDCPTotalNbOfBookings; + } + + /** Get the unconstrained demand (last DCP) of the bookingClass. */ + const NbOfBookings_T& getUnconstrainedDemand () const { + return _unconstrainedDemand; + } + + /** Get the number of cancellations of the bookingClass. */ + const NbOfCancellations_T& getNbOfCancellations() const { + return _nbOfCancellations; + } + + /** Get the number of no-shows of the bookingClass. */ + const NbOfNoShows_T& getNbOfNoShows() const { + return _nbOfNoShows; + } + + /** Get the overbooking rate dedicated to the booking. */ + const OverbookingRate_T& getOverbookingRate() const { + return _overbookingRate; + } + + /** Get the list of censorship flags. */ + const CensorshipFlagList_T& getCensorshipFlagList() const { + return _censorshipFlagList; + } + + /** Get the current censorship flag. */ + const CensorshipFlag_T& getCurrentCensorshipFlag() const { + return _currentCensorshipFlag; + } + + /** Get the protection value. */ + const BookingLimit_T& getBookingLimit() const { + return _bookingLimit; + } + + /** Get the authorisation level value. */ + const AuthorizationLevel_T& getAuthorizationLevel () const { + return _authorizationLevel; + } + + /** Get the MAX value of AU. */ + const AuthorizationLevel_T& getMAX () const { + return _MAX; + } + + /** Get the MIN value of AU. */ + const AuthorizationLevel_T& getMIN () const { + return _MIN; + } + + /** Get the availability number. */ + const Availability_T& getAvailability() const { + return _availability; + } + + /** Get the revenue amount. */ + const Revenue_T& getRevenue() const { + return _classRevenue; + } + + /** Get the fare current value. */ + const Fare_T& getFare() const { + return _fare; + } + + /** Get the adjusted yield current value. */ + const Yield_T& getAdjustedYield() const { + return _adjustedYield; + } + + /** Get the yield current value. */ + const Yield_T& getYield() const { + return _yield; + } + + /** Get the remaining demand mean. */ + const NbOfBookings_T& getRemainingDemandMean() const { + return _remainingDemandMean; + } + + /** Get the remaining demand mean for the net booking product. */ + const NbOfBookings_T& getRemainingProductDemandMean() const { + return _remainingProductDemandMean; + } + + /** Get the remaining demand standard deviation. */ + const NbOfBookings_T& getRemainingDemandSD() const { + return _remainingDemandSD; + } + + /** Get the remaining demand standard deviation + for the net booking product. */ + const NbOfBookings_T& getRemainingProductDemandSD() const { + return _remainingProductDemandSD; + } + + public: + // /////////// Setters //////////// + /** Set the booking limit. */ + void setBookingLimit (BookingLimit_T& iBookingLimit) { + _bookingLimit = iBookingLimit; + } + + /** Set the authorization level. */ + void setAuthorizationLevel (AuthorizationLevel_T& iAuthorizationLevel) { + _authorizationLevel = iAuthorizationLevel; + } + + /** Set the MAX value of AU. */ + void setMAX (const AuthorizationLevel_T& iMAX) { + _MAX = iMAX; + } + + /** Set the MIN value of AU. */ + void setMIN (const AuthorizationLevel_T& iMIN) { + _MIN = iMIN; + } + + /** Set the Availability number. */ + void setAvailability (Availability_T& iAvailability) { + _availability = iAvailability; + } + + /** Set the censorship flag status. */ + void setCensorshipFlagStatus (bool iFlagStatus) { + _currentCensorshipFlag = iFlagStatus; + } + + /** Set the fare value. */ + void setFare(Fare_T& iFare) { + _fare = iFare; + } + + /** Set the adjusted fare value. */ + void setAdjustedYield(Yield_T& iYield) { + _adjustedYield = iYield; + } + + /** Set the yield value. */ + void setYield(Yield_T& iYield) { + _yield = iYield; + } + + /** Set the unconstrained demand. */ + void setUnconstrainedDemand (NbOfBookings_T& iDemand) { + _unconstrainedDemand = iDemand; + } + + /** Set the total bookings for the DCP. */ + void setDCPTotalNbOfBookings (NbOfBookings_T& iBookings) { + _lastDCPTotalNbOfBookings = iBookings; + } + + /** Set the remaining demand mean. */ + void setRemainingDemandMean (NbOfBookings_T&); + + /** Set the remaining demand mean for the net booking product. */ + void setRemainingProductDemandMean (NbOfBookings_T& iMean) { + _remainingProductDemandMean = iMean; + } + + /** Set the remaining demand standard deviation. */ + void setRemainingDemandSD (NbOfBookings_T&); + + /** Set the remaining demand standard deviation. */ + void setRemainingProductDemandSD (NbOfBookings_T& iSD) { + _remainingProductDemandSD = iSD; + } + + 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. */ + BucketContent (const BomKey_T&); + BucketContent (const BucketContent&); + + /** Destructor. */ + virtual ~BucketContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + + /** Number of current bookings in the booking. */ + NbOfBookings_T _nbOfBookings; + + /** Total number of bookings (without substraction of cancellation). */ + NbOfBookings_T _totalNbOfBookings; + + /** Total number of bookings at the last DCP (without + substraction of cancellation). */ + NbOfBookings_T _lastDCPTotalNbOfBookings; + + /** Unconstraining demnd value (last RMS Computation).*/ + NbOfBookings_T _unconstrainedDemand; + + /** Number of cancelled demands. */ + NbOfCancellations_T _nbOfCancellations; + + /** Number of no-shows. */ + NbOfNoShows_T _nbOfNoShows; + + /** Number of available seats. */ + Availability_T _availability; + + /** Total Revenue of the booking. */ + Revenue_T _classRevenue; + + /** Current Censorship flag which indicates whether the demand + is censored. */ + CensorshipFlag_T _currentCensorshipFlag; + + /** List of censorship flags which indicates whether the demand + is censored (one flag per DCP). */ + CensorshipFlagList_T _censorshipFlagList; + + /** Value of the booking limit of the booking. */ + BookingLimit_T _bookingLimit; + + /** Value of the authorization level of the booking. */ + AuthorizationLevel_T _authorizationLevel; + + /** MAX of Authorization Level (AU). */ + AuthorizationLevel_T _MAX; + + /** MIN of Authorization Level (AU). */ + AuthorizationLevel_T _MIN; + + /** Rate of allowed overbooking. */ + OverbookingRate_T _overbookingRate; + + /** Current Fare value of the booking. */ + Fare_T _fare; + + /** Current Adjusted Fare value of the booking. */ + Yield_T _adjustedYield; + + /** Current Yield value of the booking. */ + Yield_T _yield; + + /** Temporary attributes just for the forecaster prototype. */ + /** Remaining demand mean for the whole booking. */ + NbOfBookings_T _remainingDemandMean; + + /** Remaining demand mean for the product corresponding to this booking + (excluding (OnDs)). */ + NbOfBookings_T _remainingProductDemandMean; + + /** Remaining demand standrad deviation for the whole booking. */ + NbOfBookings_T _remainingDemandSD; + + /** Remaining demand standard deviation for the product + corresponding to this booking (excluding (OnDs)). */ + NbOfBookings_T _remainingProductDemandSD; + + }; + +} +#endif // __STDAIR_BOM_BUCKETCONTENT_HPP + Copied: trunk/stdair/stdair/bom/BucketKey.cpp (from rev 169, trunk/stdair/stdair/bom/BookingClassKey.cpp) =================================================================== --- trunk/stdair/stdair/bom/BucketKey.cpp (rev 0) +++ trunk/stdair/stdair/bom/BucketKey.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,41 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BucketKey.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + BucketKey_T::BucketKey_T (const ClassCode_T& iClassCode) + : _classCode (iClassCode) { + } + + // //////////////////////////////////////////////////////////////////// + BucketKey_T::~BucketKey_T () { + } + + // //////////////////////////////////////////////////////////////////// + void BucketKey_T::toStream (std::ostream& ioOut) const { + ioOut << "BucketKey: " << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void BucketKey_T::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + const std::string BucketKey_T::toString() const { + std::ostringstream oStr; + oStr << _classCode; + return oStr.str(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string BucketKey_T::describe() const { + std::ostringstream oStr; + oStr << _parentKey.describe() << ", " << toString(); + return oStr.str(); + } + +} Copied: trunk/stdair/stdair/bom/BucketKey.hpp (from rev 169, trunk/stdair/stdair/bom/BookingClassKey.hpp) =================================================================== --- trunk/stdair/stdair/bom/BucketKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/BucketKey.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,69 @@ +#ifndef __STDAIR_BOM_BUCKETKEY_HPP +#define __STDAIR_BOM_BUCKETKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> +#include <stdair/bom/LegCabinKey.hpp> + +namespace stdair { + /** Key of booking-class. */ + struct BucketKey_T : public BomKey_T { + + public: + // /////////// Typedefs //////////// + /** Definition allowing to retrieve the parent key type. */ + typedef LegCabinKey_T ParentKey_T; + + public: + // /////////// Construction /////////// + /** Constructor. */ + BucketKey_T (const ClassCode_T& iClassCode); + + /** Destructor. */ + ~BucketKey_T (); + + // /////////// Getters ////////// + /** Get the class code. */ + const ClassCode_T& getClassCode () const { + return _classCode; + } + + // /////////// Setters ///////////// + void setParentKey (const ParentKey_T& iParentKey) { + _parentKey = iParentKey; + } + + // /////////// Display support methods ///////// + /** Dump a Business Object Key into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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-cabin. */ + const std::string toString() const; + + /** Display of the key. */ + const std::string describe() const; + + private: + // Attributes + /** Leg-cabin key.*/ + ParentKey_T _parentKey; + + /** Cabin code. */ + ClassCode_T _classCode; + }; + +} +#endif // __STDAIR_BOM_BUCKETKEY_HPP Modified: trunk/stdair/stdair/bom/FD.cpp =================================================================== --- trunk/stdair/stdair/bom/FD.cpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/FD.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -5,17 +5,42 @@ #include <cassert> // STDAIR #include <stdair/bom/Structure.hpp> +#include <stdair/bom/IN.hpp> #include <stdair/bom/FD.hpp> +#include <stdair/bom/LD.hpp> +#include <stdair/bom/SD.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> namespace stdair { // //////////////////////////////////////////////////////////////////// - FD::FD (const Key_T& iKey, BomStructure_T& ioFDStructure) - : _key (iKey), _structure (ioFDStructure) { + FD::FD (const BomKey_T& iKey, BomStructure_T& ioFDStructure) + : FlightDateContent (iKey), _structure (ioFDStructure) { } // //////////////////////////////////////////////////////////////////// FD::~FD () { } + + // //////////////////////////////////////////////////////////////////// + const LDList_T FD::getLDList () const { + return _structure.getChildrenHolder<LD>(); + } + + // //////////////////////////////////////////////////////////////////// + const LDMap_T FD::getLDMap () const { + return _structure.getChildrenHolder<LD>(); + } + + // //////////////////////////////////////////////////////////////////// + const SDList_T FD::getSDList () const { + return _structure.getChildrenHolder<SD>(); + } + + // //////////////////////////////////////////////////////////////////// + const SDMap_T FD::getSDMap () const { + return _structure.getChildrenHolder<SD>(); + } } Modified: trunk/stdair/stdair/bom/FD.hpp =================================================================== --- trunk/stdair/stdair/bom/FD.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/FD.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -10,18 +10,20 @@ #include <boost/fusion/include/map.hpp> // STDAIR #include <stdair/bom/Structure.hpp> -#include <stdair/bom/BomContent.hpp> -#include <stdair/bom/FDKey.hpp> +#include <stdair/bom/FlightDateContent.hpp> #include <stdair/bom/FDTypes.hpp> +#include <stdair/bom/SDTypes.hpp> +#include <stdair/bom/LDTypes.hpp> namespace stdair { // Forward declarations. class IN; - class FacBomContent; + class SD; + class LD; /** Class representing the actual functional/business content for the Bom root. */ - class FD : public BomContent { + class FD : public FlightDateContent { friend class FacBomContent; public: @@ -31,15 +33,26 @@ /** Definition allowing to retrieve the associated BOM structure type. */ typedef FDStructure_T BomStructure_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef FDKey_T Key_T; /** Define the list of children holder types. */ - typedef boost::fusion::map< > ChildrenHolderTypeMap_T; + typedef boost::fusion::map< + boost::fusion::pair<SD, SDHolder_T*>, + boost::fusion::pair<LD, LDHolder_T*> > ChildrenHolderTypeMap_T; // ///////////////////////////////////////////////////////////////////////// + public: + // /////////// Getters ///////////// + const SDList_T getSDList () const; + const SDMap_T getSDMap () const; + const LDList_T getLDList () const; + const LDMap_T getLDMap () const; + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getStructure () { + return _structure; + } + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @@ -55,43 +68,24 @@ /** Get a string describing the whole key (differentiating two objects at any level). */ - const std::string describeKey() const { return _key.describe(); } + 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.describe(); } + const std::string describeShortKey() const { return _key.toString(); } - - public: - // /////////// Getters ///////////// - const Key_T& getKey () const { - return _key; - } - - public: - // //////////// Setters ////////////// - - private: - /** Retrieve the BOM structure object. */ - BomStructure_T& getStructure () { - return _structure; - } - protected: /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ FD (); FD (const FD&); - FD (const Key_T& iKey, BomStructure_T& ioStructure); + FD (const BomKey_T& iKey, BomStructure_T& ioStructure); /** Destructor. */ virtual ~FD(); private: // Attributes - /** Key. */ - Key_T _key; - /** Reference structure. */ BomStructure_T& _structure; Deleted: trunk/stdair/stdair/bom/FDKey.hpp =================================================================== --- trunk/stdair/stdair/bom/FDKey.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/FDKey.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -1,50 +0,0 @@ -#ifndef __STDAIR_BOM_FDKEY_HPP -#define __STDAIR_BOM_FDKEY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/bom/BomKey.hpp> - - -namespace stdair { - struct FDKey_T : public BomKey_T { - - // /////////// Display support methods ///////// - void toStream (std::ostream& ioOut) const { - ioOut << "FDKey: " << toString() << std::endl; - } - - void fromStream (std::istream& ioIn) { - } - - const std::string toString() const { - std::ostringstream oStr; - oStr << _flightNumber; - return oStr.str(); - } - - const std::string describe() const { - return toString(); - } - - public: - // /////////// Construction /////////// - /** Constructors. */ - FDKey_T (const int& iFlightNumber) : _flightNumber (iFlightNumber) { } - FDKey_T (const FDKey_T& iKey) - : _flightNumber (iKey._flightNumber) { } - /** Destructor. */ - ~FDKey_T () { } - - private: - // Attributes - /** Flight number. */ - int _flightNumber; - - }; -} - -#endif // __STDAIR_BOM_FDKEY_HPP Modified: trunk/stdair/stdair/bom/IN.cpp =================================================================== --- trunk/stdair/stdair/bom/IN.cpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/IN.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -10,12 +10,13 @@ #include <stdair/bom/FD.hpp> #include <stdair/bom/ND.hpp> #include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> namespace stdair { // //////////////////////////////////////////////////////////////////// - IN::IN (const Key_T& iKey, BomStructure_T& ioINStructure) - : _key (iKey), _structure (ioINStructure) { + IN::IN (const BomKey_T& iKey, BomStructure_T& ioINStructure) + : InventoryContent (iKey), _structure (ioINStructure) { } // //////////////////////////////////////////////////////////////////// @@ -28,8 +29,18 @@ } // //////////////////////////////////////////////////////////////////// + const NDMap_T IN::getNDMap () const { + return _structure.getChildrenHolder<ND>(); + } + + // //////////////////////////////////////////////////////////////////// const FDList_T IN::getFDList () const { return _structure.getChildrenHolder<FD>(); } + + // //////////////////////////////////////////////////////////////////// + const FDMap_T IN::getFDMap () const { + return _structure.getChildrenHolder<FD>(); + } } Modified: trunk/stdair/stdair/bom/IN.hpp =================================================================== --- trunk/stdair/stdair/bom/IN.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/IN.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -9,8 +9,7 @@ // BOOST Fusion #include <boost/fusion/include/map.hpp> // STDAIR -#include <stdair/bom/BomContent.hpp> -#include <stdair/bom/INKey.hpp> +#include <stdair/bom/InventoryContent.hpp> #include <stdair/bom/INTypes.hpp> #include <stdair/bom/FDTypes.hpp> #include <stdair/bom/NDTypes.hpp> @@ -20,11 +19,10 @@ class BR; class FD; class ND; - class FacBomContent; /** Class representing the actual functional/business content for the Bom root. */ - class IN : public BomContent { + class IN : public InventoryContent { friend class FacBomContent; public: @@ -34,9 +32,6 @@ /** Definition allowing to retrieve the associated BOM structure type. */ typedef INStructure_T BomStructure_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef INKey_T Key_T; /** Define the list of children holder types. */ typedef boost::fusion::map< @@ -45,6 +40,19 @@ // ///////////////////////////////////////////////////////////////////////// public: + // /////////// Getters ///////////// + const FDList_T getFDList () const; + const FDMap_T getFDMap () const; + const NDList_T getNDList () const; + const NDMap_T getNDMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getStructure () { + return _structure; + } + + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @param ostream& the output stream. */ @@ -59,47 +67,25 @@ /** Get a string describing the whole key (differentiating two objects at any level). */ - const std::string describeKey() const { return _key.describe(); } + 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.describe(); } + const std::string describeShortKey() const { return _key.toString(); } - public: - // /////////// Getters ///////////// - const Key_T& getKey () const { - return _key; - } - - const FDList_T getFDList () const; - - const NDList_T getNDList () const; - - public: - // //////////// Setters ////////////// - - private: - /** Retrieve the BOM structure object. */ - BomStructure_T& getStructure () { - return _structure; - } - protected: /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ IN (); IN (const IN&); - IN (const Key_T& iKey, BomStructure_T& ioStructure); + IN (const BomKey_T& iKey, BomStructure_T& ioStructure); /** Destructor. */ virtual ~IN(); private: // Attributes - /** Key. */ - Key_T _key; - /** Reference structure. */ BomStructure_T& _structure; Deleted: trunk/stdair/stdair/bom/INKey.hpp =================================================================== --- trunk/stdair/stdair/bom/INKey.hpp 2010-04-08 12:00:36 UTC (rev 171) +++ trunk/stdair/stdair/bom/INKey.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -1,50 +0,0 @@ -#ifndef __STDAIR_BOM_INKEY_HPP -#define __STDAIR_BOM_INKEY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/STDAIR_Types.hpp> -#include <stdair/bom/BomKey.hpp> - - -namespace stdair { - struct INKey_T : public BomKey_T { - - // /////////// Display support methods ///////// - void toStream (std::ostream& ioOut) const { - ioOut << "INKey: " << toString() << std::endl; - } - - void fromStream (std::istream& ioIn) { - } - - const std::string toString() const { - std::ostringstream oStr; - oStr << _airlineCode; - return oStr.str(); - } - - const std::string describe() const { - return toString(); - } - - public: - // /////////// Construction /////////// - /** Constructors. */ - INKey_T (const AirlineCode_T& iAirlineCode) : _airlineCode (iAirlineCode) { } - INKey_T (const INKey_T& iKey) - : _airlineCode (iKey._airlineCode) { } - /** Destructor. */ - ~INKey_T () { } - - private: - // Attributes - /** Airline code. */ - AirlineCode_T _airlineCode; - - }; -} - -#endif // __STDAIR_BOM_INKEY_HPP Copied: trunk/stdair/stdair/bom/LC.cpp (from rev 171, trunk/stdair/stdair/bom/FD.cpp) =================================================================== --- trunk/stdair/stdair/bom/LC.cpp (rev 0) +++ trunk/stdair/stdair/bom/LC.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,35 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/LD.hpp> +#include <stdair/bom/LC.hpp> +#include <stdair/bom/BK.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LC::LC (const BomKey_T& iKey, BomStructure_T& ioLCStructure) + : LegCabinContent (iKey), _structure (ioLCStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LC::~LC () { + } + + // //////////////////////////////////////////////////////////////////// + const BKList_T LC::getBKList () const { + return _structure.getChildrenHolder<BK>(); + } + + // //////////////////////////////////////////////////////////////////// + const BKMap_T LC::getBKMap () const { + return _structure.getChildrenHolder<BK>(); + } + +} Copied: trunk/stdair/stdair/bom/LC.hpp (from rev 171, trunk/stdair/stdair/bom/FD.hpp) =================================================================== --- trunk/stdair/stdair/bom/LC.hpp (rev 0) +++ trunk/stdair/stdair/bom/LC.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,90 @@ +#ifndef __STDAIR_BOM_LC_HPP +#define __STDAIR_BOM_LC_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +// BOOST Fusion +#include <boost/fusion/include/map.hpp> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/LegCabinContent.hpp> +#include <stdair/bom/LCTypes.hpp> +#include <stdair/bom/BKTypes.hpp> + +namespace stdair { + // Forward declarations. + class LD; + class BK; + + /** Class representing the actual functional/business content + for the Bom root. */ + class LC : public LegCabinContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent. */ + typedef LD Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef LCStructure_T BomStructure_T; + + /** Define the list of children holder types. */ + typedef boost::fusion::map< + boost::fusion::pair<BK, BKHolder_T*> > ChildrenHolderTypeMap_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Getters ///////////// + const BKList_T getBKList () const; + const BKMap_T getBKMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getStructure () { + return _structure; + } + + 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 _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + LC (); + LC (const LC&); + LC (const BomKey_T& iKey, BomStructure_T& ioStructure); + /** Destructor. */ + virtual ~LC(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _structure; + + }; + +} +#endif // __STDAIR_BOM_LC_HPP Copied: trunk/stdair/stdair/bom/LCTypes.hpp (from rev 169, trunk/stdair/stdair/bom/FDTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/LCTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/LCTypes.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,31 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_LCTYPES_HPP +#define __STDAIR_BOM_LCTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace stdair { + // Forward declarations. + template <typename CONTENT> class Structure; + template <typename CONTENT> class BomChildrenHolderImp; + template <typename BOM> struct BomList_T; + template <typename BOM> struct BomMap_T; + class LC; + + /** Define the BomRootStructure. */ + typedef Structure<LC> LCStructure_T; + + /** Define the Inventory holder type. */ + typedef BomChildrenHolderImp<LC> LCHolder_T; + + /** Define the Inventory list. */ + typedef BomList_T<LC> LCList_T; + + /** Define the Inventory map. */ + typedef BomMap_T<LC> LCMap_T; + +} +#endif // __STDAIR_BOM_LCTYPES_HPP + Copied: trunk/stdair/stdair/bom/LD.cpp (from rev 171, trunk/stdair/stdair/bom/FD.cpp) =================================================================== --- trunk/stdair/stdair/bom/LD.cpp (rev 0) +++ trunk/stdair/stdair/bom/LD.cpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,35 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/FD.hpp> +#include <stdair/bom/LD.hpp> +#include <stdair/bom/LC.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + LD::LD (const BomKey_T& iKey, BomStructure_T& ioLDStructure) + : LegDateContent (iKey), _structure (ioLDStructure) { + } + + // //////////////////////////////////////////////////////////////////// + LD::~LD () { + } + + // //////////////////////////////////////////////////////////////////// + const LCList_T LD::getLCList () const { + return _structure.getChildrenHolder<LC>(); + } + + // //////////////////////////////////////////////////////////////////// + const LCMap_T LD::getLCMap () const { + return _structure.getChildrenHolder<LC>(); + } + +} Copied: trunk/stdair/stdair/bom/LD.hpp (from rev 171, trunk/stdair/stdair/bom/FD.hpp) =================================================================== --- trunk/stdair/stdair/bom/LD.hpp (rev 0) +++ trunk/stdair/stdair/bom/LD.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,90 @@ +#ifndef __STDAIR_BOM_LD_HPP +#define __STDAIR_BOM_LD_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <iosfwd> +// BOOST Fusion +#include <boost/fusion/include/map.hpp> +// STDAIR +#include <stdair/bom/Structure.hpp> +#include <stdair/bom/LegDateContent.hpp> +#include <stdair/bom/LDTypes.hpp> +#include <stdair/bom/LCTypes.hpp> + +namespace stdair { + // Forward declarations. + class FD; + class LC; + + /** Class representing the actual functional/business content + for the Bom root. */ + class LD : public LegDateContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated parent. */ + typedef FD Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef LDStructure_T BomStructure_T; + + /** Define the list of children holder types. */ + typedef boost::fusion::map< + boost::fusion::pair<LC, LCHolder_T*> > ChildrenHolderTypeMap_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Getters ///////////// + const LCList_T getLCList () const; + const LCMap_T getLCMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getStructure () { + return _structure; + } + + 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 _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + LD (); + LD (const LD&); + LD (const BomKey_T& iKey, BomStructure_T& ioStructure); + /** Destructor. */ + virtual ~LD(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _structure; + + }; + +} +#endif // __STDAIR_BOM_LD_HPP Copied: trunk/stdair/stdair/bom/LDTypes.hpp (from rev 169, trunk/stdair/stdair/bom/FDTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/LDTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/LDTypes.hpp 2010-04-09 15:07:22 UTC (rev 172) @@ -0,0 +1,31 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_LDTYPES_HPP +#define __STDAIR_BOM_LDTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace stdair { + // Forward declarations. + template <typename CONTENT> class Structure; + template <typename CONTENT> class BomChildrenHolderImp; + template <typename BOM> struct BomList_T; + template <typename BOM> struct BomMap_T; + class LD; + + /** Define the BomRootStructure. */ + typedef Structure<LD> LDStructure... [truncated message content] |