From: <qua...@us...> - 2010-01-06 16:53:59
|
Revision: 88 http://stdair.svn.sourceforge.net/stdair/?rev=88&view=rev Author: quannaus Date: 2010-01-06 16:53:49 +0000 (Wed, 06 Jan 2010) Log Message: ----------- [Dev] Added Network, NetworkDate, AirportDate and OutboundPath. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/basic/BasConst.cpp trunk/stdair/stdair/basic/sources.mk trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomRootStructure.hpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/BookingClassKey.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/AirportDateContent.cpp trunk/stdair/stdair/bom/AirportDateContent.hpp trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/AirportDateKey.hpp trunk/stdair/stdair/bom/AirportDateStructure.hpp trunk/stdair/stdair/bom/AirportDateTypes.hpp trunk/stdair/stdair/bom/Network.cpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkContent.cpp trunk/stdair/stdair/bom/NetworkContent.hpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/NetworkDateContent.cpp trunk/stdair/stdair/bom/NetworkDateContent.hpp trunk/stdair/stdair/bom/NetworkDateKey.cpp trunk/stdair/stdair/bom/NetworkDateKey.hpp trunk/stdair/stdair/bom/NetworkDateStructure.hpp trunk/stdair/stdair/bom/NetworkDateTypes.hpp trunk/stdair/stdair/bom/NetworkKey.cpp trunk/stdair/stdair/bom/NetworkKey.hpp trunk/stdair/stdair/bom/NetworkStructure.hpp trunk/stdair/stdair/bom/NetworkTypes.hpp trunk/stdair/stdair/bom/OutboundPath.cpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/OutboundPathContent.cpp trunk/stdair/stdair/bom/OutboundPathContent.hpp trunk/stdair/stdair/bom/OutboundPathKey.cpp trunk/stdair/stdair/bom/OutboundPathKey.hpp trunk/stdair/stdair/bom/OutboundPathStructure.hpp trunk/stdair/stdair/bom/OutboundPathTypes.hpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -55,6 +55,9 @@ /** Define the type for date (e.g., departure date of a flight). */ typedef boost::gregorian::date Date_T; + /** Define the type for network ID. */ + typedef std::string NetworkID_T; + /** Define the type for airport codes. */ typedef std::string AirportCode_T; Modified: trunk/stdair/stdair/basic/BasConst.cpp =================================================================== --- trunk/stdair/stdair/basic/BasConst.cpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/basic/BasConst.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -93,10 +93,10 @@ // /** Time duration representing a full minute (in seconds).*/ // const int TIME_DURATION_FOR_A_MINUTE_IN_SECONDS = 60; - // /** Null time duration (in boost::time_duration unit).*/ - // const Duration_T NULL_BOOST_TIME_DURATION = - // boost::posix_time::hours(0)+ boost::posix_time::minutes (0) - // + boost::posix_time::seconds (0); + /** Null time duration (in boost::time_duration unit).*/ + const Duration_T NULL_BOOST_TIME_DURATION = + boost::posix_time::hours(0)+ boost::posix_time::minutes (0) + + boost::posix_time::seconds (0); // /** Date duration representing a full day (in boost::date_duration unit).*/ // const DateOffSet_T BOOST_DATE_DURATION_FOR_A_DAY (1); @@ -144,40 +144,40 @@ // const DateTime_T DEFAULT_DEMAND_DATETIME (DEFAULT_WHOLE_DEMAND_UPDATE_DATE, // NULL_BOOST_TIME_DURATION); - // // //////// Fare Rules /////// - // /** Default saturdayStay value (false). */ - // const SaturdayStay_T DEFAULT_SATURDAY_STAY = false; + // //////// Fare Rules /////// + /** Default saturdayStay value (false). */ + const SaturdayStay_T DEFAULT_SATURDAY_STAY = false; + + /** Default change fees value (false). */ + const ChangeFees_T DEFAULT_CHANGE_FEES = false; + + /** Default non refundable value (false). */ + const NonRefundable_T DEFAULT_NON_REFUNDABLE = false; + + /** Default airlineCode value ('XX'). */ + const AirlineCode_T DEFAULT_AIRLINE_CODE = "XX"; - // /** Default change fees value (false). */ - // const ChangeFees_T DEFAULT_CHANGE_FEES = false; + /** Default airlineCode value (''). */ + const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE = ""; - // /** Default non refundable value (false). */ - // const NonRefundable_T DEFAULT_NON_REFUNDABLE = false; + /** Default airportCode value ('XXX'). */ + const AirportCode_T DEFAULT_AIRPORT_CODE = "XXX"; - // /** Default airlineCode value ('XX'). */ - // const AirlineCode_T DEFAULT_AIRLINE_CODE = "XX"; + /** Default family code value ('X'). */ + const ClassCode_T DEFAULT_FAMILY_CODE = "0"; - // /** Default airlineCode value (''). */ - // const AirlineCode_T DEFAULT_NULL_AIRLINE_CODE = ""; + /** Default classCode value ('X'). */ + const ClassCode_T DEFAULT_CLASS_CODE = "X"; - // /** Default airportCode value ('XXX'). */ - // const AirportCode_T DEFAULT_AIRPORT_CODE = "XXX"; + /** Default number of airlines. */ + const NbOfAirlines_T DEFAULT_NBOFAIRLINES = 0; - // /** Default family code value ('X'). */ - // const ClassCode_T DEFAULT_FAMILY_CODE = "0"; + /** Default classCode value (''). */ + const ClassCode_T DEFAULT_NULL_CLASS_CODE = ""; - // /** Default classCode value ('X'). */ - // const ClassCode_T DEFAULT_CLASS_CODE = "X"; + /** Default flightPathCode value (''). */ + const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE = ""; - // /** Default number of airlines. */ - // const NbOfAirlines_T DEFAULT_NBOFAIRLINES = 0; - - // /** Default classCode value (''). */ - // const ClassCode_T DEFAULT_NULL_CLASS_CODE = ""; - - // /** Default flightPathCode value (''). */ - // const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE = ""; - // // //////// DemandFeatures /////// // /** Default SaturdayStay average ratio of demand (value between [0, 100]). */ // const SaturdayStayRatio_T DEFAULT_SATURDAY_STAY_RATIO = 50; @@ -331,21 +331,21 @@ // /** Default remaining futre demand standard deviation for OnD. */ // const NbOfBookings_T DEFAULT_OND_REMAINING_DEMAND_STANDARD_DEVIATION = 0.0; - // // //////// Travel Solutions /////// - // /** Default Minimum connection time. */ - // const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME (0, 30, 0); + // //////// Travel Solutions /////// + /** Default Minimum connection time. */ + const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME (0, 30, 0); - // /** Default Matching Indicator value. */ - // const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR (0.0); + /** Default Matching Indicator value. */ + const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR (0.0); - // /** Default price value (0.0). */ + /** Default price value (0.0). */ // const PriceValue_T DEFAULT_PRICE_VALUE (0.0); - // /** Default currency (euro). */ - // const PriceCurrency_T DEFAULT_CURRENCY ("EUR"); + /** Default currency (euro). */ + const PriceCurrency_T DEFAULT_CURRENCY ("EUR"); - // /** Default availability status for a travel solution. */ - // const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS = false; + /** Default availability status for a travel solution. */ + const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS = false; // // //////// Cancellation /////// // /** Default Fare value */ Added: trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp =================================================================== --- trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp (rev 0) +++ trunk/stdair/stdair/basic/BasConst_TravelSolution.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,73 @@ +#ifndef __STDAIR_BAS_BASCONST_TRAVELSOLUTION_HPP +#define __STDAIR_BAS_BASCONST_TRAVELSOLUTION_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// LATUS Common +#include <stdair/basic/BasComTypes.hpp> + +namespace stdair { + + /** Default flight speed (number of kilometers per hour). */ + extern const unsigned int DEFAULT_FLIGHT_SPEED; + + // //////// Travel Solutions /////// + /** Default distance value (kilometers). */ + extern const Distance_T DEFAULT_DISTANCE_VALUE; + + /** Default Minimum connection time. */ + extern const Duration_T DEFAULT_MINIMUM_CONNECTION_TIME; + + /** Null time duration (in boost::time_duration unit).*/ + extern const Duration_T NULL_BOOST_TIME_DURATION; + + /** Default airlineCode value ('XX'). */ + extern const AirlineCode_T DEFAULT_AIRLINE_CODE; + + /** Default epsilon value. */ + extern const double DEFAULT_EPSILON_VALUE; + + /** Default classCode value ('X'). */ + extern const ClassCode_T DEFAULT_CLASS_CODE; + + /** Default flightPathCode value (''). */ + extern const FlightPathCode_T DEFAULT_FLIGHTPATH_CODE; + + /** Default value of Availability. */ + extern const Availability_T DEFAULT_CLASS_AVAILABILITY; + + /** Default availability status for a travel solution. */ + extern const AvailabilityStatus_T DEFAULT_AVAILABILITY_STATUS; + + /** Default number of bookings. */ + extern const NbOfBookings_T DEFAULT_CLASS_NB_OF_BOOKINGS; + + /** Default value of Fare. */ + extern const Fare_T DEFAULT_CLASS_FARE_VALUE; + + /** Default nember of required seats by the demand. */ + extern const unsigned short DEFAULT_NUMBER_OF_REQUIRED_SEATS; + + /** Default Matching Indicator value between customer requirements + and a fare rule. */ + extern const MatchingIndicator_T DEFAULT_MATCHING_INDICATOR; + + /** Default epsilon value between customer requirements + and a fare rule. */ + extern const double DEFAULT_EPSILON_VALUE; + + /** Default revenue value. */ + extern const Revenue_T DEFAULT_REVENUE_VALUE; + + /** Default currency (euro). */ + extern const PriceCurrency_T DEFAULT_CURRENCY; + + /** Default DICO studied airline. */ + extern const AirlineCode_T DEFAULT_DICO_STUDIED_AIRLINE; + + /** Default DICO studied date. */ + extern const Date_T DEFAULT_DICO_STUDIED_DATE; + +} +#endif // __STDAIR_BAS_BASCONST_TRAVELSOLUTION_HPP Modified: trunk/stdair/stdair/basic/sources.mk =================================================================== --- trunk/stdair/stdair/basic/sources.mk 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/basic/sources.mk 2010-01-06 16:53:49 UTC (rev 88) @@ -4,6 +4,7 @@ $(top_srcdir)/stdair/basic/BasConst_Inventory.hpp \ $(top_srcdir)/stdair/basic/BasConst_BookingClass.hpp \ $(top_srcdir)/stdair/basic/BasConst_Yield.hpp \ - $(top_srcdir)/stdair/basic/BasConst_Period_BOM.hpp + $(top_srcdir)/stdair/basic/BasConst_Period_BOM.hpp \ + $(top_srcdir)/stdair/basic/BasConst_TravelSolution.hpp bas_cc_sources = \ $(top_srcdir)/stdair/basic/BasConst.cpp Copied: trunk/stdair/stdair/bom/AirportDate.cpp (from rev 87, trunk/stdair/stdair/bom/LegDate.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,74 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/AirportDateStructure.hpp> +#include <stdair/bom/AirportDate.hpp> +#include <stdair/bom/OutboundPath.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirportDate::AirportDate (const BomKey_T& iKey, + BomStructure_T& ioAirportStructure) + : AirportDateContent (iKey), _airportDateStructure (ioAirportStructure) { + } + + // //////////////////////////////////////////////////////////////////// + AirportDate::~AirportDate () { + } + + // //////////////////////////////////////////////////////////////////// + void AirportDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void AirportDate::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + std::string AirportDate::toString() const { + std::ostringstream oStr; + + // First, put the key of that level + oStr << describeShortKey() << std::endl; + + // Then, browse the children + // [...] (no child for now) + + return oStr.str(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDate::describeKey() const { + return _airportDateStructure.describeKey(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDate::describeShortKey() const { + return _airportDateStructure.describeShortKey(); + } + + // //////////////////////////////////////////////////////////////////// + OutboundPathList_T AirportDate::getOutboundPathList () const { + return _airportDateStructure.getChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// + OutboundPathMap_T AirportDate::getOutboundPathMap () const { + return _airportDateStructure.getChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// + OutboundPath* AirportDate:: + getOutboundPath (const OutboundPathKey_T& iKey) const { + return _airportDateStructure.getContentChild (iKey); + } + +} + Copied: trunk/stdair/stdair/bom/AirportDate.hpp (from rev 87, trunk/stdair/stdair/bom/LegDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,98 @@ +#ifndef __STDAIR_BOM_AIRPORTDATE_HPP +#define __STDAIR_BOM_AIRPORTDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/AirportDateStructure.hpp> +#include <stdair/bom/AirportDateContent.hpp> +#include <stdair/bom/AirportDateTypes.hpp> +#include <stdair/bom/OutboundPathTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct AirportDateKey_T; + struct OutboundPathKey_T; + + /** Class representing the actual functional/business content for a + airport-date. */ + class AirportDate : public AirportDateContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef FlightDate Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef AirportDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirportDateKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef OutboundPath ContentChild_T; + + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a OutboundPathList_T for iteration methods. */ + OutboundPathList_T getOutboundPathList () const; + + /** Get a OutboundPathMap_T for iteration methods. */ + OutboundPathMap_T getOutboundPathMap () const; + + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _airportDateStructure; + } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + AirportDate (); + AirportDate (const AirportDate&); + AirportDate (const BomKey_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~AirportDate(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _airportDateStructure; + + }; + +} +#endif // __STDAIR_BOM_AIRPORTDATE_HPP + Copied: trunk/stdair/stdair/bom/AirportDateContent.cpp (from rev 87, trunk/stdair/stdair/bom/LegDateContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateContent.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,21 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/AirportDateContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirportDateContent::AirportDateContent (const BomKey_T& iKey) \ + : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + AirportDateContent::~AirportDateContent () { + } + +} + Copied: trunk/stdair/stdair/bom/AirportDateContent.hpp (from rev 87, trunk/stdair/stdair/bom/LegDateContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateContent.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_AIRPORTDATECONTENT_HPP +#define __STDAIR_BOM_AIRPORTDATECONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/AirportDateKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for an airport-date. */ + class AirportDateContent : public BomContent { + public: + // Type definitions. + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirportDateKey_T BomKey_T; + + public: + // /////////// Getters ///////////// + /** Get the airport-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + 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. */ + AirportDateContent (const BomKey_T&); + AirportDateContent (const AirportDateContent&); + + /** Destructor. */ + virtual ~AirportDateContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + + }; + +} +#endif // __STDAIR_BOM_AIRPORTDATECONTENT_HPP + Added: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,49 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirportDateKey.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::AirportDateKey_T () : _origin ("ZZZ") { + } + + // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::AirportDateKey_T (const AirportCode_T& iAirportCode) + : _origin (iAirportCode) { + } + + // //////////////////////////////////////////////////////////////////// + AirportDateKey_T::~AirportDateKey_T () { + } + + // //////////////////////////////////////////////////////////////////// + void AirportDateKey_T::toStream (std::ostream& ioOut) const { + ioOut << "AirportDateKey: " << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void AirportDateKey_T::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDateKey_T::toString() const { + std::ostringstream oStr; + oStr << _origin; + return oStr.str(); + } + + // //////////////////////////////////////////////////////////////////// + const std::string AirportDateKey_T::describe() const { + std::ostringstream oStr; + oStr << _parentKey.describe() << ", " << toString(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const Date_T& AirportDateKey_T::getBoardingDate() const { + return _parentKey.getReferenceDate(); + } +} Added: trunk/stdair/stdair/bom/AirportDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateKey.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,80 @@ +#ifndef __STDAIR_BOM_AIRPORTDATEKEY_HPP +#define __STDAIR_BOM_AIRPORTDATEKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> +#include <stdair/bom/NetworkDateKey.hpp> + +namespace stdair { + /** Key of airport-date. */ + struct AirportDateKey_T : public BomKey_T { + friend struct OutboundPathKey_T; + + public: + // /////////// Typedefs //////////// + /** Definition allowing to retrieve the parent key type. */ + typedef NetworkDateKey_T ParentKey_T; + + private: + // /////////// Default constructor ////////// + AirportDateKey_T () { }; + + public: + // /////////// Construction /////////// + /** Constructors. */ + AirportDateKey_T (const AirportCode_T& iAirportCode); + AirportDateKey_T (const AirportDateKey_T&); + + /** Destructor. */ + ~AirportDateKey_T (); + + // /////////// Getters ////////// + /** Get boarding date. */ + const Date_T& getBoardingDate() const; + + /** Get boarding airport. */ + const AirportCode_T& getBoardingPoint() const { + return _origin; + } + + // /////////// 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-date. */ + const std::string toString() const; + + /** Display of the key. */ + const std::string describe() const; + + // /////////// Setters ///////////// + /** Set the parent key. */ + void setParentKey (const ParentKey_T& iParentKey) { + _parentKey = iParentKey; + } + + private: + // Attributes + /** Network-date key.*/ + ParentKey_T _parentKey; + + /** The boarding airport. */ + AirportCode_T _origin; + }; + +} + +#endif // __STDAIR_BOM_NETWORKDATEKEY_HPP Copied: trunk/stdair/stdair/bom/AirportDateStructure.hpp (from rev 87, trunk/stdair/stdair/bom/LegDateStructure.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateStructure.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,169 @@ +#ifndef __STDAIR_BOM_AIRPORTDATESTRUCTURE_HPP +#define __STDAIR_BOM_AIRPORTDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> +#include <stdair/bom/OutboundPathStructure.hpp> +#include <stdair/bom/OutboundPathKey.hpp> + +namespace stdair { + // Forward declarations. + template <typename BOM> struct BomMap_T; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific AirportDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class AirportDateStructure : 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 associated BOM key type. */ + typedef typename BOM_CONTENT::BomKey_T BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::Parent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the child key type. */ + typedef OutboundPathKey_T ChildKey_T; + + /** Define the map of ContentChild_T. */ + typedef BomMap_T<ContentChild_T> ChildrenMap_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector <OutboundPathStructure<ContentChild_T>, + BomStopStructure> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; + + /** Definition allowing to retrive the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + + public: + // /////////// Getters ///////////// + /** Get the (parent) NetworkDateStructure object. */ + ParentBomStructure_T* getNetworkDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) NetworkDateStructure object. */ + ParentBomStructure_T& getNetworkDateStructure() const; + + /** Get the airport-date key. */ + const BomKey_T& getKey() const { + assert (_content != NULL); + return _content->getKey(); + } + + /** Get the holder of outbound paths. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + return *_childrenHolder; + } + + /** Get the holder of outbound paths. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; + } + + /** Retrieve, if existing, the outbound path corresponding to the + given key. + <br>If not exissting, return the NULL pointer. */ + ContentChild_T* getContentChild (const ChildKey_T& iKey) const { + ContentChild_T* oContentChild_ptr = NULL; + + ChildrenMap_T lChildrenMap (getChildrenHolder()); + const MapKey_T lMapKey = iKey.toString(); + + typename ChildrenMap_T::iterator itContentChild = + lChildrenMap.find (lMapKey); + + if (itContentChild != lChildrenMap.end()) { + oContentChild_ptr = itContentChild->second; + assert (oContentChild_ptr != NULL); + } + + return oContentChild_ptr; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) NetworkDateStructure object. */ + void setNetworkDateStructure (ParentBomStructure_T& ioNetworkDateStructure) { + _parent = &ioNetworkDateStructure; + } + + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } + + /** Set the outbound path children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; + } + + 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 getKey().toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return getKey().toString(); } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + AirportDateStructure () : _parent (NULL), _content (NULL), + _childrenHolder (NULL) { } + AirportDateStructure (const AirportDateStructure&); + + /** Destructor. */ + virtual ~AirportDateStructure() { } + + private: + // Attributes + /** Parent network-date. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** Holder of outbound paths. */ + ChildrenBomHolder_T* _childrenHolder; + }; + +} +#endif // __STDAIR_BOM_AIRPORTDATESTRUCTURE_HPP Copied: trunk/stdair/stdair/bom/AirportDateTypes.hpp (from rev 87, trunk/stdair/stdair/bom/LegDateTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirportDateTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirportDateTypes.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,36 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_AIRPORTDATETYPES_HPP +#define __STDAIR_BOM_AIRPORTDATETYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class AirportDateStructure; + template <typename BOM> struct BomList_T; + template <typename BOM> struct BomMap_T; + class AirportDate; + + /** Define the AirportDate structure. */ + typedef AirportDateStructure<AirportDate> AirportDateStructure_T; + + /** Define the airport-date structure list. */ + typedef std::vector<AirportDateStructure_T*> AirportDateStructureList_T; + + /** Define the airport-date structure map. */ + typedef std::map<const std::string, AirportDateStructure_T*> AirportDateStructureMap_T; + + /** Define the airport-date list. */ + typedef BomList_T<AirportDate> AirportDateList_T; + + /** Define the airport-date map. */ + typedef BomMap_T<AirportDate> AirportDateMap_T; +} +#endif // __STDAIR_BOM_AIRPORTDATETYPES_HPP + Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -9,6 +9,7 @@ #include <stdair/bom/BomList.hpp> #include <stdair/bom/BomMap.hpp> #include <stdair/bom/Inventory.hpp> +#include <stdair/bom/Network.hpp> namespace stdair { @@ -31,6 +32,17 @@ return _bomRootStructure.getChildrenHolder(); } + // //////////////////////////////////////////////////////////////////// + NetworkList_T BomRoot::getNetworkList () const { + return _bomRootStructure.getSecondChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// + NetworkMap_T BomRoot::getNetworkMap () const { + return _bomRootStructure.getSecondChildrenHolder(); + } + + // //////////////////////////////////////////////////////////////////// Inventory* BomRoot::getInventory (const AirlineCode_T& iAirlineCode) const { Inventory* oInventory_ptr = NULL; @@ -43,5 +55,19 @@ return oInventory_ptr; } + + // //////////////////////////////////////////////////////////////////// + Network* BomRoot::getNetwork (const NetworkID_T& iNetworkID) const { + Network* oNetwork_ptr = NULL; + + NetworkMap_T lNetworkMap = getNetworkMap (); + NetworkMap_T::iterator itNetwork = lNetworkMap.find (iNetworkID); + + if (itNetwork != lNetworkMap.end()) { + oNetwork_ptr = itNetwork->second; + } + + return oNetwork_ptr; + } } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -11,6 +11,7 @@ #include <stdair/bom/BomRootContent.hpp> #include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> +#include <stdair/bom/NetworkTypes.hpp> namespace stdair { // Forward declarations. @@ -60,6 +61,10 @@ /** Definition allowing to retrieve the associated BOM content child type. */ typedef Inventory ContentChild_T; + + /** Definition allowing to retrieve the associated second + BOM content child type. */ + typedef Network SecondContentChild_T; // ///////////////////////////////////////////////////////////////////////// @@ -104,6 +109,12 @@ /** Get a InventoryMap_T for iteration methods. */ InventoryMap_T getInventoryMap () const; + + /** Get a NetworkList_T for iteration methods. */ + NetworkList_T getNetworkList () const; + + /** Get a NetworkMap_T for iteration methods. */ + NetworkMap_T getNetworkMap () const; /** Get the reference of the AirlineFeatureSet object. */ const AirlineFeatureSet& getAirlineFeatureSet() const { @@ -115,6 +126,11 @@ given airline code (Inventory key). <br>If not existing, return the NULL pointer. */ Inventory* getInventory (const AirlineCode_T&) const; + + /** Retrieve, if existing, the Network corresponding to the + given airline code (Network key). + <br>If not existing, return the NULL pointer. */ + Network* getNetwork (const NetworkID_T&) const; public: // //////////// Setters ////////////// Modified: trunk/stdair/stdair/bom/BomRootStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRootStructure.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BomRootStructure.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -12,6 +12,7 @@ #include <stdair/bom/BomStopStructure.hpp> #include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/InventoryStructure.hpp> +#include <stdair/bom/NetworkStructure.hpp> namespace stdair { /** Wrapper class aimed at holding the actual content, modeled @@ -30,21 +31,30 @@ /** Definition allowing to retrieve the children type of the BOM_CONTENT. */ typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; - + + /** Definition allowing to retrieve the second children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::SecondContentChild_T SecondContentChild_T; + private: // Type definitions /** Definition allowing to retrieve the associated BOM key type. */ typedef typename BOM_CONTENT::BomKey_T BomKey_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStopStructure> ChildrenBomTypeList_T; - + typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, + NetworkStructure<SecondContentChild_T> > ChildrenBomTypeList_T; + /** Definition allowing to retrive the default children bom holder type. */ typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; - + /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + /** Definition allowing to retrive the second children bom holder type. */ + typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; + + public: // /////////// Getters ///////////// /** Get the BomRootStructure key. */ @@ -59,11 +69,22 @@ return *_childrenHolder; } + /** Get the holder of networks. */ + const SecondChildrenBomHolder_T& getSecondChildrenHolder() const { + assert (_secondChildrenHolder != NULL); + return *_secondChildrenHolder; + } + /** Get the holder of inventories. */ void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { ioChildrenHolder = _childrenHolder; } + /** Get the holder of networks. */ + void getChildrenHolder (SecondChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _secondChildrenHolder; + } + private: /////////////// Setters //////////////// /** Default children holder setter. */ @@ -74,6 +95,11 @@ _childrenHolder = &ioChildrenHolder; } + /** Set the network children holder. */ + void setChildrenHolder (SecondChildrenBomHolder_T& ioChildrenHolder) { + _secondChildrenHolder = &ioChildrenHolder; + } + public: // /////////// Display support methods ///////// /** Dump a Business Object into an output stream. @@ -101,7 +127,8 @@ /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ - BomRootStructure () : _content (NULL), _childrenHolder (NULL) { }; + BomRootStructure () : _content (NULL), _childrenHolder (NULL), + _secondChildrenHolder (NULL) { }; BomRootStructure (const BomRootStructure&); /** Destructor. */ @@ -114,6 +141,9 @@ /** Holder of inventories. */ ChildrenBomHolder_T* _childrenHolder; + + /** Holder of networks. */ + SecondChildrenBomHolder_T* _secondChildrenHolder; }; } Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -17,7 +17,7 @@ struct BookingClassKey_T; /** Class representing the actual functional/business content for a - segment-cabin. */ + booking class. */ class BookingClass : public BookingClassContent { friend class FacBomContent; Modified: trunk/stdair/stdair/bom/BookingClassKey.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/BookingClassKey.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -10,7 +10,7 @@ #include <stdair/bom/SegmentCabinKey.hpp> namespace stdair { - /** Key of segment-cabin. */ + /** Key of booking-class. */ struct BookingClassKey_T : public BomKey_T { public: Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2010-01-04 20:06:45 UTC (rev 87) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -42,8 +42,8 @@ BOM content child type. */ typedef SegmentDate ContentChild_T; - /** Definition allowing to retrieve the associated second - BOM content child type. */ + /** Definition allowing to retrieve the associated second + BOM content child type. */ typedef LegDate SecondContentChild_T; /** Definition allowing to retrieve the specific BookingClass type. */ Added: trunk/stdair/stdair/bom/Network.cpp =================================================================== --- trunk/stdair/stdair/bom/Network.cpp (rev 0) +++ trunk/stdair/stdair/bom/Network.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,68 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkStructure.hpp> +#include <stdair/bom/Network.hpp> +#include <stdair/bom/NetworkDate.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + Network::Network (const BomKey_T& iKey, + BomStructure_T& ioNetworkStructure) + : NetworkContent (iKey), _networkStructure (ioNetworkStructure) { + } + + // //////////////////////////////////////////////////////////////////// + Network::~Network () { + } + + // ////////////////////////////////////////////////////////////////////// + void Network::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void Network::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string Network::toString() const { + std::ostringstream oStr; + oStr << _key.toString(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Network::describeKey() const { + return _networkStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string Network::describeShortKey() const { + return _networkStructure.describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + NetworkDateList_T Network::getNetworkDateList () const { + return _networkStructure.getChildrenHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + NetworkDateMap_T Network::getNetworkDateMap () const { + return _networkStructure.getChildrenHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + NetworkDate* Network:: + getNetworkDate (const NetworkDateKey_T& iKey) const { + return _networkStructure.getContentChild (iKey); + } + +} + Added: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp (rev 0) +++ trunk/stdair/stdair/bom/Network.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,109 @@ +#ifndef __STDAIR_BOM_NETWORK_HPP +#define __STDAIR_BOM_NETWORK_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/NetworkStructure.hpp> +#include <stdair/bom/NetworkTypes.hpp> +#include <stdair/bom/NetworkDateTypes.hpp> +#include <stdair/bom/NetworkContent.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct NetworkDateKey_T; + struct NetworkKey_T; + + /** Class representing the actual functional/business content for + a network. */ + class Network : public NetworkContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + // 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 BomRoot Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef NetworkStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef NetworkKey_T BomKey_T; + + /** Definition allowing to retrieve the associated BOM content child + type. */ + typedef NetworkDate ContentChild_T; + + /** Definition allowing to retrieve the specific BookingClass type. */ + typedef BookingClass BookingClassContent_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a NetworkDateList_T for iteration methods. */ + NetworkDateList_T getNetworkDateList () const; + + /** Get a NetworkDateMap_T for iteration methods. */ + NetworkDateMap_T getNetworkDateMap () const; + + /** Retrieve, if existing, the NetworkDate corresponding to the + given network number and network date (NetworkDate key). + <br>If not existing, return the NULL pointer. */ + NetworkDate* getNetworkDate (const NetworkDateKey_T&) const; + + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _networkStructure; + } + + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + Network (); + Network (const Network&); + Network (const BomKey_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~Network(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _networkStructure; + }; + +} +#endif // __STDAIR_BOM_NETWORK_HPP + Copied: trunk/stdair/stdair/bom/NetworkContent.cpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkContent.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,20 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + NetworkContent::NetworkContent (const BomKey_T& iKey) : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + NetworkContent::~NetworkContent () { + } + +} + Copied: trunk/stdair/stdair/bom/NetworkContent.hpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkContent.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_NETWORKCONTENT_HPP +#define __STDAIR_BOM_NETWORKCONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/NetworkKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for an airline network. */ + class NetworkContent : public BomContent { + public : + // Type definitions + /** Definition allowing to retrieve the associated BOM key type. */ + typedef NetworkKey_T BomKey_T; + + 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; + + public: + // ////////// Getters //////////// + /** Get the network key. */ + const BomKey_T& getKey() const { + return _key; + } + + + protected: + /** Default constructors. */ + NetworkContent (const BomKey_T&); + NetworkContent (const NetworkContent&); + + /** Destructor. */ + virtual ~NetworkContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + }; + +} +#endif // __STDAIR_BOM_NETWORKCONTENT_HPP + Copied: trunk/stdair/stdair/bom/NetworkDate.cpp (from rev 87, trunk/stdair/stdair/bom/Inventory.cpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,62 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkDateStructure.hpp> +#include <stdair/bom/NetworkDate.hpp> +#include <stdair/bom/AirportDate.hpp> +#include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + NetworkDate::NetworkDate (const BomKey_T& iKey, + BomStructure_T& ioNetworkDateStructure) + : NetworkDateContent (iKey), _networkDateStructure (ioNetworkDateStructure) { + } + + // //////////////////////////////////////////////////////////////////// + NetworkDate::~NetworkDate () { + } + + // ////////////////////////////////////////////////////////////////////// + void NetworkDate::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void NetworkDate::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string NetworkDate::toString() const { + std::ostringstream oStr; + oStr << _key.toString(); + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string NetworkDate::describeKey() const { + return _networkDateStructure.describeKey(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string NetworkDate::describeShortKey() const { + return _networkDateStructure.describeShortKey(); + } + + // ////////////////////////////////////////////////////////////////////// + AirportDateList_T NetworkDate::getAirportDateList () const { + return _networkDateStructure.getChildrenHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + AirportDateMap_T NetworkDate::getAirportDateMap () const { + return _networkDateStructure.getChildrenHolder(); + } + +} + Added: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,104 @@ +#ifndef __STDAIR_BOM_NETWORKDATE_HPP +#define __STDAIR_BOM_NETWORKDATE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomRoot.hpp> +#include <stdair/bom/NetworkDateStructure.hpp> +#include <stdair/bom/NetworkDateTypes.hpp> +#include <stdair/bom/AirportDateTypes.hpp> +#include <stdair/bom/BookingClassTypes.hpp> +#include <stdair/bom/NetworkDateContent.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct AirportDateKey_T; + struct NetworkDateKey_T; + + /** Class representing the actual functional/business content for + a network-date. */ + class NetworkDate : public NetworkDateContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + // 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 BomRoot Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef NetworkDateStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef NetworkDateKey_T BomKey_T; + + /** Definition allowing to retrieve the associated BOM content child + type. */ + typedef AirportDate ContentChild_T; + + /** Definition allowing to retrieve the specific BookingClass type. */ + typedef BookingClass BookingClassContent_T; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const; + + /** 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; + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const; + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const; + + public: + // /////////// Getters ///////////// + /** Get a AirportDateList_T for iteration methods. */ + AirportDateList_T getAirportDateList () const; + + /** Get a AirportDateMap_T for iteration methods. */ + AirportDateMap_T getAirportDateMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _networkDateStructure; + } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + NetworkDate (); + NetworkDate (const NetworkDate&); + NetworkDate (const BomKey_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~NetworkDate(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _networkDateStructure; + + }; + +} +#endif // __STDAIR_BOM_NETWORKDATE_HPP + Copied: trunk/stdair/stdair/bom/NetworkDateContent.cpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDateContent.cpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,20 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/NetworkDateContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + NetworkDateContent::NetworkDateContent (const BomKey_T& iKey) : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + NetworkDateContent::~NetworkDateContent () { + } + +} + Copied: trunk/stdair/stdair/bom/NetworkDateContent.hpp (from rev 87, trunk/stdair/stdair/bom/InventoryContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/NetworkDateContent.hpp 2010-01-06 16:53:49 UTC (rev 88) @@ -0,0 +1,66 @@ +#ifndef __STDAIR_BOM_NETWORKDATECONTENT_HPP +#define __STDAIR_BOM_NETWORKDATECONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/NetworkDateKey.hpp> + +namespace stdair { + + /** Class representing the actual attributes for a network-date. */ + class NetworkDateContent : public ... [truncated message content] |