From: <qua...@us...> - 2009-10-27 16:23:46
|
Revision: 56 http://stdair.svn.sourceforge.net/stdair/?rev=56&view=rev Author: quannaus Date: 2009-10-27 16:23:33 +0000 (Tue, 27 Oct 2009) Log Message: ----------- [Dev] Added AirlineFeature. Modified Paths: -------------- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BookingClassStructure.hpp trunk/stdair/stdair/bom/FlightDateStructure.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/InventoryStructure.hpp trunk/stdair/stdair/bom/LegCabinStructure.hpp trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentCabinStructure.hpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/factory/FacBomContent.hpp Added Paths: ----------- trunk/stdair/stdair/bom/AirlineFeature.cpp trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/AirlineFeatureContent.cpp trunk/stdair/stdair/bom/AirlineFeatureContent.hpp trunk/stdair/stdair/bom/AirlineFeatureKey.cpp trunk/stdair/stdair/bom/AirlineFeatureKey.hpp trunk/stdair/stdair/bom/AirlineFeatureList.cpp trunk/stdair/stdair/bom/AirlineFeatureList.hpp trunk/stdair/stdair/bom/AirlineFeatureMap.cpp trunk/stdair/stdair/bom/AirlineFeatureMap.hpp trunk/stdair/stdair/bom/AirlineFeatureSet.cpp trunk/stdair/stdair/bom/AirlineFeatureSet.hpp trunk/stdair/stdair/bom/AirlineFeatureSetContent.cpp trunk/stdair/stdair/bom/AirlineFeatureSetContent.hpp trunk/stdair/stdair/bom/AirlineFeatureSetKey.cpp trunk/stdair/stdair/bom/AirlineFeatureSetKey.hpp trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp trunk/stdair/stdair/bom/AirlineFeatureSetTypes.hpp trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp trunk/stdair/stdair/bom/AirlineFeatureTypes.hpp trunk/stdair/stdair/bom/OptimizerStruct.cpp trunk/stdair/stdair/bom/OptimizerStruct.hpp Copied: trunk/stdair/stdair/bom/AirlineFeature.cpp (from rev 55, trunk/stdair/stdair/bom/BookingClass.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeature.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,67 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// C +#include <assert.h> +// STDAIR +#include <stdair/bom/AirlineFeatureStructure.hpp> +#include <stdair/bom/AirlineFeature.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeature:: + AirlineFeature (const BomKey_T& iKey, + const ForecasterMode_T& iForecastMode, + const HistoricalDataLimit_T& iHistoricalDataLimit, + const OptimizerStruct_T& iOptimizerStruct, + const ControlMode_T& iControlMode, + BomStructure_T& ioAirlineFeatureStructure) + : AirlineFeatureContent (iKey, iForecastMode, iHistoricalDataLimit, + iOptimizerStruct, iControlMode), + _airlineFeatureStructure (ioAirlineFeatureStructure) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeature::~AirlineFeature () { + } + + // ////////////////////////////////////////////////////////////////////// + void AirlineFeature::toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + // ////////////////////////////////////////////////////////////////////// + void AirlineFeature::fromStream (std::istream& ioIn) { + } + + // ////////////////////////////////////////////////////////////////////// + std::string AirlineFeature::toString() const { + std::ostringstream oStr; + oStr << describeShortKey() << std::endl; + return oStr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeature::describe() const { + std::ostringstream ostr; + ostr << describeKey() + << ", " << _forecasterMode + << ", " << _historicalDataLimit + << ", " << _optimizerStruct.describe() + << ", " << _controlMode; + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeature::describeKey() const { + return _key.toString(); + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeature::describeShortKey() const { + return _key.toString(); + } + +} + Copied: trunk/stdair/stdair/bom/AirlineFeature.hpp (from rev 55, trunk/stdair/stdair/bom/BookingClass.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,93 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURE_HPP +#define __STDAIR_BOM_AIRLINEFEATURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirlineFeatureSet.hpp> +#include <stdair/bom/AirlineFeatureStructure.hpp> +#include <stdair/bom/AirlineFeatureContent.hpp> +#include <stdair/bom/AirlineFeatureSetTypes.hpp> +#include <stdair/bom/AirlineFeatureTypes.hpp> + +namespace stdair { + // Forward declarations + class FacBomContent; + struct AirlineFeatureKey_T; + struct AirlineFeatureList_T; + struct AirlineFeatureMap_T; + + /** Class representing the actual functional/business content for a + segment-cabin. */ + class AirlineFeature : public AirlineFeatureContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated parent + BOM content type. */ + typedef AirlineFeatureSet Parent_T; + + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef AirlineFeatureStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirlineFeatureKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef AirlineFeature 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; + + /** Give a description of the structure (for display purposes). */ + const std::string describe() const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _airlineFeatureStructure; + } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + AirlineFeature (); + AirlineFeature (const AirlineFeature&); + AirlineFeature (const BomKey_T&, const ForecasterMode_T&, + const HistoricalDataLimit_T&, const OptimizerStruct_T&, + const ControlMode_T&, BomStructure_T&); + + /** Destructor. */ + virtual ~AirlineFeature(); + + protected: + // Attributes + /** Reference structure. */ + BomStructure_T& _airlineFeatureStructure; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURE_HPP + Copied: trunk/stdair/stdair/bom/AirlineFeatureContent.cpp (from rev 55, trunk/stdair/stdair/bom/BookingClassContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureContent.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,28 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/AirlineFeatureContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureContent:: + AirlineFeatureContent (const BomKey_T& iKey, + const ForecasterMode_T& iForecastMode, + const HistoricalDataLimit_T& iHistoricalDataLimit, + const OptimizerStruct_T& iOptimizerStruct, + const ControlMode_T& iControlMode) + : _key (iKey), _forecasterMode (iForecastMode), + _historicalDataLimit (iHistoricalDataLimit), + _optimizerStruct (iOptimizerStruct), _controlMode (iControlMode){ + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureContent::~AirlineFeatureContent () { + } + +} + Copied: trunk/stdair/stdair/bom/AirlineFeatureContent.hpp (from rev 55, trunk/stdair/stdair/bom/BookingClassContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureContent.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,81 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURECONTENT_HPP +#define __STDAIR_BOM_AIRLINEFEATURECONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/AirlineFeatureKey.hpp> +#include <stdair/bom/OptimizerStruct.hpp> + +namespace stdair { + + /** Class representing the actual attributes for an airline booking class. */ + class AirlineFeatureContent : public BomContent { + public: + // Type definitions. + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirlineFeatureKey_T BomKey_T; + + public: + // /////////// Getters //////////// + /** Get the booking class 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. */ + AirlineFeatureContent (const BomKey_T&, const ForecasterMode_T&, + const HistoricalDataLimit_T&, + const OptimizerStruct_T&, const ControlMode_T&); + AirlineFeatureContent (const AirlineFeatureContent&); + + /** Destructor. */ + virtual ~AirlineFeatureContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + + /** The type of forecaster. */ + ForecasterMode_T _forecasterMode; + + /** The size of the moving average window. */ + HistoricalDataLimit_T _historicalDataLimit; + + /** The type of optimizer. */ + OptimizerStruct_T _optimizerStruct; + + /** The type of inventory control. */ + ControlMode_T _controlMode; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURECONTENT_HPP + Copied: trunk/stdair/stdair/bom/AirlineFeatureKey.cpp (from rev 51, trunk/stdair/stdair/bom/InventoryKey.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureKey.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureKey.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,34 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirlineFeatureKey.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureKey_T::AirlineFeatureKey_T (const AirlineCode_T& iAirlineCode) + : _airlineCode (iAirlineCode) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureKey_T::~AirlineFeatureKey_T () { + } + + // //////////////////////////////////////////////////////////////////// + void AirlineFeatureKey_T::toStream (std::ostream& ioOut) const { + ioOut << "AirlineFeatureKey: " << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void AirlineFeatureKey_T::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + std::string AirlineFeatureKey_T::toString() const { + std::ostringstream oStr; + oStr << _airlineCode; + return oStr.str(); + } + +} Copied: trunk/stdair/stdair/bom/AirlineFeatureKey.hpp (from rev 51, trunk/stdair/stdair/bom/InventoryKey.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureKey.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,50 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATUREKEY_HPP +#define __STDAIR_BOM_AIRLINEFEATUREKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> + +namespace stdair { + /** Key of AirlineFeature. */ + struct AirlineFeatureKey_T : public BomKey_T { + + public: + // /////////// Construction /////////// + /** Constructor. */ + AirlineFeatureKey_T (const AirlineCode_T& iAirlineCode); + + /** Destructor. */ + ~AirlineFeatureKey_T (); + + // /////////// Getters ////////// + /** Get the airline code. */ + const AirlineCode_T& getAirlineCode() const; + + // /////////// 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. */ + std::string toString() const; + + private: + // Attributes + /** Airline code. */ + AirlineCode_T _airlineCode; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATUREKEY_HPP Copied: trunk/stdair/stdair/bom/AirlineFeatureList.cpp (from rev 47, trunk/stdair/stdair/bom/BookingClassList.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureList.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureList.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,50 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/BomChildrenHolderImp.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/AirlineFeatureList.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureList_T:: + AirlineFeatureList_T (const AirlineFeatureHolder_T& iAirlineFeatureHolder) + : _airlineFeatureHolder (iAirlineFeatureHolder) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureList_T:: + AirlineFeatureList_T (const AirlineFeatureList_T& iAFList) + : _airlineFeatureHolder (iAFList._airlineFeatureHolder) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureList_T::~AirlineFeatureList_T () { + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureList_T::iterator AirlineFeatureList_T::begin () const { + return _airlineFeatureHolder.listBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureList_T::iterator AirlineFeatureList_T::end () const { + return _airlineFeatureHolder.listEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureList_T::reverse_iterator AirlineFeatureList_T::rbegin () const { + return _airlineFeatureHolder.listRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureList_T::reverse_iterator AirlineFeatureList_T::rend () const { + return _airlineFeatureHolder.listREnd (); + } + +} + Copied: trunk/stdair/stdair/bom/AirlineFeatureList.hpp (from rev 47, trunk/stdair/stdair/bom/BookingClassList.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureList.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureList.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,70 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURELIST_HPP +#define __STDAIR_BOM_AIRLINEFEATURELIST_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirlineFeatureTypes.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class AirlineFeature; + + /** Structure which handles the iterators for a booking class list. */ + struct AirlineFeatureList_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the booking class list iterators. */ + typedef BomIterator_T<AirlineFeature, + AirlineFeatureStructureList_T::const_iterator> iterator; + typedef BomIterator_T<AirlineFeature, + AirlineFeatureStructureList_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + /** Define the booking class holder. */ + typedef BomChildrenHolderImp<AirlineFeature> AirlineFeatureHolder_T; + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the list. */ + iterator begin () const; + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the list. */ + iterator end () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the list. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the list. */ + reverse_iterator rend () const; + + public: + /** Default constructors. */ + AirlineFeatureList_T (); + AirlineFeatureList_T (const AirlineFeatureList_T&); + AirlineFeatureList_T (const AirlineFeatureHolder_T&); + + /** Destructor. */ + virtual ~AirlineFeatureList_T(); + + private: + // Attributes + /** Reference structure. */ + const AirlineFeatureHolder_T& _airlineFeatureHolder; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURELIST_HPP + Copied: trunk/stdair/stdair/bom/AirlineFeatureMap.cpp (from rev 47, trunk/stdair/stdair/bom/BookingClassList.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureMap.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureMap.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,56 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/BomChildrenHolderImp.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/AirlineFeatureMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T:: + AirlineFeatureMap_T (const AirlineFeatureHolder_T& iAirlineFeatureHolder) + : _airlineFeatureHolder (iAirlineFeatureHolder) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T:: + AirlineFeatureMap_T (const AirlineFeatureMap_T& iAFMap) + : _airlineFeatureHolder (iAFMap._airlineFeatureHolder) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T::~AirlineFeatureMap_T () { + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T::iterator AirlineFeatureMap_T::begin () const { + return _airlineFeatureHolder.mapBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T::iterator AirlineFeatureMap_T::end () const { + return _airlineFeatureHolder.mapEnd (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T::reverse_iterator AirlineFeatureMap_T::rbegin () const { + return _airlineFeatureHolder.mapRBegin (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T::reverse_iterator AirlineFeatureMap_T::rend () const { + return _airlineFeatureHolder.mapREnd (); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T::iterator AirlineFeatureMap_T:: + find (const MapKey_T& iKey) const { + return _airlineFeatureHolder.find (iKey); + } + +} + Copied: trunk/stdair/stdair/bom/AirlineFeatureMap.hpp (from rev 47, trunk/stdair/stdair/bom/BookingClassList.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureMap.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureMap.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,74 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATUREMAP_HPP +#define __STDAIR_BOM_AIRLINEFEATUREMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirlineFeatureTypes.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + template <typename BOM_STRUCTURE> class BomChildrenHolderImp; + class AirlineFeature; + + /** Structure which handles the iterators for a booking class map. */ + struct AirlineFeatureMap_T { + + public: + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the booking class map iterators. */ + typedef BomIterator_T<AirlineFeature, + AirlineFeatureStructureMap_T::const_iterator> iterator; + typedef BomIterator_T<AirlineFeature, + AirlineFeatureStructureMap_T::const_reverse_iterator> reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + /** Define the booking class holder. */ + typedef BomChildrenHolderImp<AirlineFeature> AirlineFeatureHolder_T; + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the map. */ + iterator begin () const; + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the map. */ + iterator end () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the map. */ + reverse_iterator rbegin () const; + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the map. */ + reverse_iterator rend () const; + + /** Retrieve, if existing, the AirlineFeature corresponding to the + given key. */ + iterator find (const MapKey_T&) const; + + public: + /** Default constructors. */ + AirlineFeatureMap_T (); + AirlineFeatureMap_T (const AirlineFeatureMap_T&); + AirlineFeatureMap_T (const AirlineFeatureHolder_T&); + + /** Destructor. */ + virtual ~AirlineFeatureMap_T(); + + private: + // Attributes + /** Reference structure. */ + const AirlineFeatureHolder_T& _airlineFeatureHolder; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATUREMAP_HPP + Copied: trunk/stdair/stdair/bom/AirlineFeatureSet.cpp (from rev 55, trunk/stdair/stdair/bom/BomRoot.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,76 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/AirlineFeatureSetStructure.hpp> +#include <stdair/bom/AirlineFeatureSet.hpp> +#include <stdair/bom/AirlineFeature.hpp> +#include <stdair/bom/AirlineFeatureList.hpp> +#include <stdair/bom/AirlineFeatureMap.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureSet:: + AirlineFeatureSet (const BomKey_T& iKey, + BomStructure_T& ioAirlineFeatureSetStructure) + : AirlineFeatureSetContent (iKey), + _bomRootStructure (ioAirlineFeatureSetStructure) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureSet::~AirlineFeatureSet () { + } + + // ////////////////////////////////////////////////////////////////////// + const std::string AirlineFeatureSet::display() const { + // Store current formatting flags of std::cout + std::ios::fmtflags oldFlags = std::cout.flags(); + std::ostringstream ostr; + ostr << "Set of airline features" << std::endl; + + AirlineFeatureList_T lAirlineFeatureList = getAirlineFeatureList(); + for (AirlineFeatureList_T::iterator itAirlineFeature = + lAirlineFeatureList.begin(); + itAirlineFeature != lAirlineFeatureList.end(); ++itAirlineFeature) { + const AirlineFeature& lAirlineFeature = *itAirlineFeature; + + ostr << lAirlineFeature.describe (); + } + + // Reset formatting flags of std::cout + std::cout.flags (oldFlags); + + return ostr.str(); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureList_T AirlineFeatureSet::getAirlineFeatureList () const { + return _bomRootStructure.getChildrenList(); + } + + // ////////////////////////////////////////////////////////////////////// + AirlineFeatureMap_T AirlineFeatureSet::getAirlineFeatureMap () const { + return _bomRootStructure.getChildrenList(); + } + + // ////////////////////////////////////////////////////////////////////// + const AirlineFeature* AirlineFeatureSet:: + getAirlineFeature (const AirlineCode_T& iAirlineCode) const { + + AirlineFeatureMap_T lAirlineFeatureMap = getAirlineFeatureMap (); + AirlineFeatureMap_T::iterator itAirlineFeature = + lAirlineFeatureMap.find (iAirlineCode); + + if (itAirlineFeature != lAirlineFeatureMap.end()) { + const AirlineFeature* oAirlineFeature_ptr = itAirlineFeature->second; + assert (oAirlineFeature_ptr != NULL); + return oAirlineFeature_ptr; + } + + return NULL; + } + +} Copied: trunk/stdair/stdair/bom/AirlineFeatureSet.hpp (from rev 55, trunk/stdair/stdair/bom/BomRoot.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,99 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURESET_HPP +#define __STDAIR_BOM_AIRLINEFEATURESET_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirlineFeatureSetStructure.hpp> +#include <stdair/bom/AirlineFeatureSetContent.hpp> +#include <stdair/bom/AirlineFeatureSetTypes.hpp> +#include <stdair/bom/AirlineFeatureTypes.hpp> + +namespace stdair { + // Forward declarations. + class FacBomContent; + class AirlineFeature; + struct AirlineFeatureSetKey_T; + struct AirlineFeatureList_T; + struct AirlineFeatureMap_T; + + /** Class representing the actual functional/business content + for the Bom root. */ + class AirlineFeatureSet : public AirlineFeatureSetContent { + friend class FacBomContent; + + public: + // ///////////////////////////////////////////////////////////////////////// + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef AirlineFeatureSetStructure_T BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirlineFeatureSetKey_T BomKey_T; + + /** Definition allowing to retrieve the associated + BOM content child type. */ + typedef AirlineFeature 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 { ioOut << toString(); } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { } + + /** Get the serialised version of the Business Object. */ + std::string toString() const { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return std::string (""); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return std::string (""); } + + /** Display the full context of the set of airline features. */ + const std::string display() const; + + public: + // /////////// Getters ///////////// + /** Retrieve, if existing, the Airline features corresponding to the + given airline code. + <br>If not existing, return the NULL pointer. */ + const AirlineFeature* getAirlineFeature (const AirlineCode_T&) const; + + /** Get a AirlineFeatureList_T for iteration methods. */ + AirlineFeatureList_T getAirlineFeatureList () const; + + /** Get a AirlineFeatureMap_T for iteration methods. */ + AirlineFeatureMap_T getAirlineFeatureMap () const; + + private: + /** Retrieve the BOM structure object. */ + BomStructure_T& getBomStructure () { + return _bomRootStructure; + } + + protected: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + AirlineFeatureSet (); + AirlineFeatureSet (const AirlineFeatureSet&); + AirlineFeatureSet (const BomKey_T&, BomStructure_T&); + /** Destructor. */ + virtual ~AirlineFeatureSet(); + + private: + // Attributes + /** Reference structure. */ + BomStructure_T& _bomRootStructure; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURESET_HPP Copied: trunk/stdair/stdair/bom/AirlineFeatureSetContent.cpp (from rev 55, trunk/stdair/stdair/bom/BomRootContent.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetContent.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSetContent.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,20 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// STDAIR +#include <stdair/bom/AirlineFeatureSetContent.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureSetContent::AirlineFeatureSetContent (const BomKey_T& iKey) + : _key (iKey) { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureSetContent::~AirlineFeatureSetContent () { + } + +} Copied: trunk/stdair/stdair/bom/AirlineFeatureSetContent.hpp (from rev 55, trunk/stdair/stdair/bom/BomRootContent.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSetContent.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,68 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURESETCONTENT_HPP +#define __STDAIR_BOM_AIRLINEFEATURESETCONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomContent.hpp> +#include <stdair/bom/AirlineFeatureSetKey.hpp> + +namespace stdair { + /** Class representing the actual attributes for the Bom root. */ + class AirlineFeatureSetContent : public BomContent { + + public: + /** Definition allowing to retrieve the associated BOM key type. */ + typedef AirlineFeatureSetKey_T BomKey_T; + + public: + // /////////// Getters ////////////// + /** Get the AirlineFeatureSet key. */ + const BomKey_T& getKey() const { + return _key; + } + + public: + // ///////// Setters ////////// + + + 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. */ + AirlineFeatureSetContent (); + AirlineFeatureSetContent (const AirlineFeatureSetContent&); + AirlineFeatureSetContent (const BomKey_T& iKey); + + /** Destructor. */ + virtual ~AirlineFeatureSetContent(); + + protected: + // Attributes + /** The key of both structure and content objects. */ + BomKey_T _key; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURESETCONTENT_HPP Copied: trunk/stdair/stdair/bom/AirlineFeatureSetKey.cpp (from rev 51, trunk/stdair/stdair/bom/BomRootKey.cpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetKey.cpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSetKey.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,33 @@ +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/AirlineFeatureSetKey.hpp> + +namespace stdair { + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureSetKey_T::AirlineFeatureSetKey_T () { + } + + // //////////////////////////////////////////////////////////////////// + AirlineFeatureSetKey_T::~AirlineFeatureSetKey_T () { + } + + // //////////////////////////////////////////////////////////////////// + void AirlineFeatureSetKey_T::toStream (std::ostream& ioOut) const { + ioOut << "AirlineFeatureSetStructureKey: " << toString() << std::endl; + } + + // //////////////////////////////////////////////////////////////////// + void AirlineFeatureSetKey_T::fromStream (std::istream& ioIn) { + } + + // //////////////////////////////////////////////////////////////////// + std::string AirlineFeatureSetKey_T::toString() const { + std::ostringstream oStr; + oStr << " -- AIRLINE FEATURE SET -- "; + return oStr.str(); + } + +} Copied: trunk/stdair/stdair/bom/AirlineFeatureSetKey.hpp (from rev 51, trunk/stdair/stdair/bom/BomRootKey.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetKey.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSetKey.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,46 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURESETKEY_HPP +#define __STDAIR_BOM_AIRLINEFEATURESETKEY_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/STDAIR_Types.hpp> +#include <stdair/bom/BomKey.hpp> + +namespace stdair { + /** Key of the BOM structure root. */ + struct AirlineFeatureSetKey_T : public BomKey_T { + + public: + // /////////// Construction /////////// + /** Constructor. */ + AirlineFeatureSetKey_T (); + + /** Destructor. */ + ~AirlineFeatureSetKey_T (); + + + // /////////// 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. */ + std::string toString() const; + + private: + // Attributes + // No attributes, as that class corresponds to the root of Bom structure. + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURESETKEY_HPP Copied: trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp (from rev 55, trunk/stdair/stdair/bom/BomRootStructure.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,121 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURESETSTRUCTURE_HPP +#define __STDAIR_BOM_AIRLINEFEATURESETSTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructureDummy.hpp> +#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/AirlineFeatureStructure.hpp> + +namespace stdair { + /** Wrapper class aimed at holding the actual content, modeled + by a specific AirlineFeatureSet class. */ + template <typename BOM_CONTENT> + class AirlineFeatureSetStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + friend class BomStructure; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BOM_CONTENT Content_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + private: + // Type definitions + /** Definition allowing to retrieve the associated BOM key type. */ + typedef typename BOM_CONTENT::BomKey_T BomKey_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector<AirlineFeatureStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; + + /** Definition allowing to retrive the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + /** Definition allowing to retrive the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + public: + // /////////// Getters ///////////// + /** Get the AirlineFeatureSet key. */ + const BomKey_T& getKey () const { + assert (_content != NULL); + return _content->getKey (); + } + + /** Get the list of airline features. */ + const ChildrenBomHolder_T& getChildrenList() const { + assert (_childrenList != NULL); + return *_childrenList; + } + + /** Get the list of airline features. */ + void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _childrenList; + } + + private: + /////////////// Setters //////////////// + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + /** Set the children list. */ + void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { + _childrenList = &ioChildrenList; + } + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << toString() << std::endl; + } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { } + + /** Get the serialised version of the Business Object. */ + std::string toString() const { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return 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. */ + AirlineFeatureSetStructure () : _content (NULL), _childrenList (NULL) { }; + AirlineFeatureSetStructure (const AirlineFeatureSetStructure&); + + /** Destructor. */ + ~AirlineFeatureSetStructure () { } + + private: + // Attributes + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** List of inventories. */ + ChildrenBomHolder_T* _childrenList; + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURESETSTRUCTURE_HPP + Copied: trunk/stdair/stdair/bom/AirlineFeatureSetTypes.hpp (from rev 51, trunk/stdair/stdair/bom/BomRootTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureSetTypes.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,19 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_AIRLINEFEATURESETTYPES_HPP +#define __STDAIR_BOM_AIRLINEFEATURESETTYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// + +namespace stdair { + // Forward declarations. + template <typename BOM_CONTENT> class AirlineFeatureSetStructure; + class AirlineFeatureSet; + + /** Define the AirlineFeatureSetStructure. */ + typedef AirlineFeatureSetStructure<AirlineFeatureSet> AirlineFeatureSetStructure_T; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURESETTYPES_HPP + Copied: trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp (from rev 55, trunk/stdair/stdair/bom/BookingClassStructure.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,112 @@ +#ifndef __STDAIR_BOM_AIRLINEFEATURESTRUCTURE_HPP +#define __STDAIR_BOM_AIRLINEFEATURESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructureDummy.hpp> +#include <stdair/bom/BomContentDummy.hpp> + +namespace stdair { + /** Wrapper class aimed at holding the actual content, modeled + by an external specific AirlineFeature class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class AirlineFeatureStructure : 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 associated children type. */ + typedef boost::mpl::vector <BomStructureDummy, + BomStructureDummy> ChildrenBomTypeList_T; + + /** Definition allowing to retrieve the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) AirlineFeatureSetStructure object. */ + ParentBomStructure_T* getAirlineFeatureSetStructurePtr() const { + return _parent; + } + + /** Get the (parent) AirlineFeatureSetStructure object. */ + ParentBomStructure_T& getAirlineFeatureSetStructure() const; + + /** Get the segment-cabin key. */ + const BomKey_T& getKey() const { + assert (_content != NULL); + return _content->getKey(); + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) AirlineFeatureSetStructure object. */ + void setAirlineFeatureSetStructure (ParentBomStructure_T& ioAirlineFeatureSetStructure){ + _parent = &ioAirlineFeatureSetStructure; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { + ioOut << toString() << 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. */ + AirlineFeatureStructure () : _parent (NULL), _content (NULL) { } + AirlineFeatureStructure (const AirlineFeatureStructure&); + + /** Destructor. */ + virtual ~AirlineFeatureStructure() { } + + private: + // Attributes + /** Parent segment-cabin. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + }; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURESTRUCTURE_HPP Copied: trunk/stdair/stdair/bom/AirlineFeatureTypes.hpp (from rev 51, trunk/stdair/stdair/bom/BookingClassTypes.hpp) =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureTypes.hpp (rev 0) +++ trunk/stdair/stdair/bom/AirlineFeatureTypes.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -0,0 +1,29 @@ +// ////////////////////////////////////////////////////////////////////// +#ifndef __STDAIR_BOM_AIRLINEFEATURETYPES_HPP +#define __STDAIR_BOM_AIRLINEFEATURETYPES_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> +#include <vector> + +namespace stdair { + + // Forward declarations. + template <typename BOM_CONTENT> class AirlineFeatureStructure; + class AirlineFeature; + + /** Define the AirlineFeature structure. */ + typedef AirlineFeatureStructure<AirlineFeature> AirlineFeatureStructure_T; + + /** Define the segment-cabin structure list. */ + typedef std::vector<AirlineFeatureStructure_T*> AirlineFeatureStructureList_T; + + /** Define the segment-cabin structure map. */ + typedef std::map<const std::string, AirlineFeatureStructure_T*> AirlineFeatureStructureMap_T; + +} +#endif // __STDAIR_BOM_AIRLINEFEATURETYPES_HPP + Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -61,21 +61,6 @@ at the same level). */ const std::string describeShortKey() const { return std::string (""); } - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - // Initialise the index - unsigned short lIdx = 0; - - for (typename BomChildrenOrderedList_T::const_iterator itChild = - _bomChildrenOrderedList.begin(); - itChild != _bomChildrenOrderedList.end(); ++itChild, ++lIdx) { - const BomStructure_T* lCurrentChild_ptr = *itChild; - ioOut << "[" << lIdx << "]: "; - lCurrentChild_ptr->describeFull (ioOut); - } - } - // /////////// Iteration methods ////////// /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ @@ -124,7 +109,12 @@ MapReverseIterator_T mapREnd () const { return _bomChildrenList.rend(); } - + + /** Retrieve, if existing, the bom corresponding to the given key. */ + MapIterator_T find (const MapKey_T& iKey) const { + return _bomChildrenList.find (iKey); + } + private: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -9,12 +9,6 @@ #include <stdair/bom/Inventory.hpp> #include <stdair/bom/InventoryList.hpp> #include <stdair/bom/InventoryMap.hpp> -#include <stdair/bom/FlightDate.hpp> -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/LegDate.hpp> -#include <stdair/bom/SegmentCabin.hpp> -#include <stdair/bom/LegCabin.hpp> -#include <stdair/bom/BookingClass.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/BookingClassStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -73,12 +73,6 @@ ioOut << toString() << std::endl; } - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - } - /** Read a Business Object from an input stream. @param istream& the input stream. */ void fromStream (std::istream& ioIn) { } Modified: trunk/stdair/stdair/bom/FlightDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -122,14 +122,6 @@ ioOut << toString() << std::endl; } - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - displaySegmentDateList (ioOut); - displayLegDateList (ioOut); - } - /** Read a Business Object from an input stream. @param istream& the input stream. */ void fromStream (std::istream& ioIn) { } @@ -144,23 +136,6 @@ /** Get a string describing the short key (differentiating two objects at the same level). */ const std::string describeShortKey() const { return getKey().toString(); } - - /** Dump the segment-date children list in to an output stream. - @param ostream& the output stream. */ - void displaySegmentDateList (std::ostringstream& ioOut) const { - ioOut << "SegmentDates: " << std::endl; - assert (_childrenList != NULL); - _childrenList->describeFull (ioOut); - } - - /** Dump the leg-date children list in to an output stream. - @param ostream& the output stream. */ - void displayLegDateList (std::ostringstream& ioOut) const { - ioOut << "LegDates: " << std::endl; - assert (_secondChildrenList != NULL); - _secondChildrenList->describeFull (ioOut); - } - private: /** Constructors are private so as to force the usage of the Factory Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/Inventory.cpp 2009-10-27 16:23:33 UTC (rev 56) @@ -9,11 +9,6 @@ #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/FlightDateList.hpp> #include <stdair/bom/FlightDateMap.hpp> -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/LegDate.hpp> -#include <stdair/bom/SegmentCabin.hpp> -#include <stdair/bom/LegCabin.hpp> -#include <stdair/bom/BookingClass.hpp> namespace stdair { @@ -39,9 +34,6 @@ // ////////////////////////////////////////////////////////////////////// std::string Inventory::toString() const { std::ostringstream oStr; - - _inventoryStructure.describeFull (oStr); - return oStr.str(); } Modified: trunk/stdair/stdair/bom/InventoryStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -102,13 +102,6 @@ ioOut << toString() << std::endl; } - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - displayFlightDateList (ioOut); - } - /** Read a Business Object from an input stream. @param istream& the input stream. */ void fromStream (std::istream& ioIn) { } @@ -124,14 +117,6 @@ at the same level). */ const std::string describeShortKey() const { return getKey().toString(); } - /** Dump the flight-date children list in to an output stream. - @param ostream& the output stream. */ - void displayFlightDateList (std::ostringstream& ioOut) const { - ioOut << "FlightDates: " << std::endl; - assert (_childrenList != NULL); - _childrenList->describeFull (ioOut); - } - private: /** Constructors are private so as to force the usage of the Factory layer. */ Modified: trunk/stdair/stdair/bom/LegCabinStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -74,12 +74,6 @@ ioOut << toString() << std::endl; } - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void describeFull (std::ostringstream& ioOut) const { - ioOut << describeShortKey () << std::endl; - } - /** Read a Business Object from an input stream. @param istream& the input stream. */ void fromStream (std::istream& ioIn) { } Modified: trunk/stdair/stdair/bom/LegDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-26 13:08:42 UTC (rev 55) +++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-27 16:23:33 UTC (rev 56) @@ -96,13 +96,6 @@ ioOut << toString() << std::endl; } - /** Dump a Business Object with all its children into an output stream. - @param ostream& the output stream. */ - void... [truncated message content] |