From: <qua...@us...> - 2009-11-16 15:53:31
|
Revision: 65 http://stdair.svn.sourceforge.net/stdair/?rev=65&view=rev Author: quannaus Date: 2009-11-16 15:53:21 +0000 (Mon, 16 Nov 2009) Log Message: ----------- [Dev] Build the routing. Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeatureSet.cpp trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRootStructure.hpp trunk/stdair/stdair/bom/BookingClassStructure.hpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDateStructure.hpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/InventoryStructure.hpp trunk/stdair/stdair/bom/LegCabinStructure.hpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentCabin.cpp trunk/stdair/stdair/bom/SegmentCabinStructure.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/factory/FacBomContent.hpp trunk/stdair/stdair/factory/FacBomStructure.hpp Added Paths: ----------- trunk/stdair/stdair/bom/BomStopContent.hpp trunk/stdair/stdair/bom/BomStopStructure.hpp Removed Paths: ------------- trunk/stdair/stdair/bom/BomContentDummy.hpp trunk/stdair/stdair/bom/BomStructureDummy.hpp Modified: trunk/stdair/stdair/bom/AirlineFeatureSet.cpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/AirlineFeatureSet.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -48,12 +48,12 @@ // ////////////////////////////////////////////////////////////////////// AirlineFeatureList_T AirlineFeatureSet::getAirlineFeatureList () const { - return _bomStructure.getChildrenList(); + return _bomStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// AirlineFeatureMap_T AirlineFeatureSet::getAirlineFeatureMap () const { - return _bomStructure.getChildrenList(); + return _bomStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/AirlineFeatureSetStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -9,8 +9,8 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/AirlineFeatureStructure.hpp> #include <stdair/bom/AirlineFeatureKey.hpp> @@ -48,10 +48,10 @@ 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; + typedef boost::mpl::vector<AirlineFeatureStructure<ContentChild_T>, BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrive the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; @@ -64,15 +64,15 @@ return _content->getKey (); } - /** Get the list of airline features. */ - const ChildrenBomHolder_T& getChildrenList() const { - assert (_childrenList != NULL); - return *_childrenList; + /** Get the holder of airline features. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + assert (_childrenHolder != NULL); + return *_childrenHolder; } - /** Get the list of airline features. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; + /** Get the holder of airline features. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; } /** Retrieve, if existing, the airline feature corresponding to the @@ -81,7 +81,7 @@ ContentChild_T* getContentChild (const ChildKey_T& iKey) const { ContentChild_T* oContentChild_ptr = NULL; - ChildrenMap_T lChildrenMap (getChildrenList()); + ChildrenMap_T lChildrenMap (getChildrenHolder()); const MapKey_T lMapKey = iKey.toString(); typename ChildrenMap_T::iterator itContentChild = @@ -97,12 +97,12 @@ private: /////////////// Setters //////////////// - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } - /** Set the children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; + /** Set the children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; } public: @@ -132,7 +132,7 @@ /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ - AirlineFeatureSetStructure () : _content (NULL), _childrenList (NULL) { }; + AirlineFeatureSetStructure () : _content (NULL), _childrenHolder (NULL) { }; AirlineFeatureSetStructure (const AirlineFeatureSetStructure&); /** Destructor. */ @@ -143,8 +143,8 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - /** List of inventories. */ - ChildrenBomHolder_T* _childrenList; + /** Holder of inventories. */ + ChildrenBomHolder_T* _childrenHolder; }; } Modified: trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/AirlineFeatureStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,8 +7,8 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> namespace stdair { /** Wrapper class aimed at holding the actual content, modeled @@ -33,11 +33,11 @@ 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; + typedef boost::mpl::vector <BomStopStructure, + BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; public: // /////////// Getters ///////////// @@ -62,8 +62,8 @@ _parent = &ioAirlineFeatureSetStructure; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } public: // /////////// Display support methods ///////// Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -27,18 +27,18 @@ public: /** Define lists of children BOM structures. */ - typedef std::vector<BomStructure_T*> BomChildrenOrderedList_T; - typedef std::map<const std::string, BomStructure_T*> BomChildrenList_T; + typedef std::vector<BomStructure_T*> BomChildrenList_T; + typedef std::map<const std::string, BomStructure_T*> BomChildrenMap_T; /** Define the different types of iterators. */ typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::const_iterator> ListIterator_T; + typename BomChildrenList_T::const_iterator> ListIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenOrderedList_T::const_reverse_iterator> ListReverseIterator_T; + typename BomChildrenList_T::const_reverse_iterator> ListReverseIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::const_iterator> MapIterator_T; + typename BomChildrenMap_T::const_iterator> MapIterator_T; typedef BomIterator_T<BOM_CONTENT_CHILD, - typename BomChildrenList_T::const_reverse_iterator> MapReverseIterator_T; + typename BomChildrenMap_T::const_reverse_iterator> MapReverseIterator_T; public: // /////////// Display support methods ///////// @@ -65,61 +65,61 @@ /** Initialise the internal iterators on bom objects: return the iterator at the begining of the list. */ ListIterator_T listBegin () const { - return ListIterator_T(_bomChildrenOrderedList.begin()); + return ListIterator_T(_bomChildrenList.begin()); } /** Initialise the internal iterators on bom objects: return the iterator past the end of the list. */ ListIterator_T listEnd () const { - return _bomChildrenOrderedList.end(); + return _bomChildrenList.end(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator at the rbegining of the list. */ ListReverseIterator_T listRBegin () const { - return _bomChildrenOrderedList.rbegin(); + return _bomChildrenList.rbegin(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator past the rend of the list. */ ListReverseIterator_T listREnd () const { - return _bomChildrenOrderedList.rend(); + return _bomChildrenList.rend(); } /** Initialise the internal iterators on bom objects: return the iterator at the begining of the map. */ MapIterator_T mapBegin () const { - return _bomChildrenList.begin(); + return _bomChildrenMap.begin(); } /** Initialise the internal iterators on bom objects: return the iterator past the end of the map. */ MapIterator_T mapEnd () const { - return _bomChildrenList.end(); + return _bomChildrenMap.end(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator at the rbegining of the map. */ MapReverseIterator_T mapRBegin () const { - return _bomChildrenList.rbegin(); + return _bomChildrenMap.rbegin(); } /** Initialise the internal reverse iterators on bom objects: return the reverse iterator past the rend of the map. */ MapReverseIterator_T mapREnd () const { - return _bomChildrenList.rend(); + return _bomChildrenMap.rend(); } // /////////// Other operators ///////////// /** Get the size of the list. */ const unsigned int size () const { - return _bomChildrenOrderedList.size(); + return _bomChildrenList.size(); } /** Retrieve, if existing, the bom corresponding to the given key. */ MapIterator_T find (const MapKey_T& iKey) const { - return _bomChildrenList.find (iKey); + return _bomChildrenMap.find (iKey); } private: @@ -135,10 +135,10 @@ private: ///////////// Attributes ////////////// /** List of children BOM structures. */ - BomChildrenList_T _bomChildrenList; + BomChildrenMap_T _bomChildrenMap; /** Map of children BOM structures with their key. */ - BomChildrenOrderedList_T _bomChildrenOrderedList; + BomChildrenList_T _bomChildrenList; }; } Deleted: trunk/stdair/stdair/bom/BomContentDummy.hpp =================================================================== --- trunk/stdair/stdair/bom/BomContentDummy.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/BomContentDummy.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -1,70 +0,0 @@ -#ifndef __STDAIR_BOM_BOMCONTENTDUMMY_HPP -#define __STDAIR_BOM_BOMCONTENTDUMMY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomContent.hpp> - -namespace stdair { - // Forward declarations. - class BomStructureDummy; - class BomKey; - - /** Class representing the actual functional/business content - for the Bom dummy. - <br>That class is just an utility tool to mark the dummy - of the Bom tree. */ - class BomContentDummy : public BomContent { - friend class FacBomContent; - - public: - // Type definitions - /** Definition allowing to retrieve the associated BOM structure type. */ - typedef BomStructureDummy BomStructure_T; - - /** Definition allowing to retrieve the associated BOM key type. */ - typedef BomKey BomKey_T; - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const { ioOut << toString(); } - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - void fromStream (std::istream& ioIn) { } - - /** Get the serialised version of the Business Object. */ - std::string toString() const { return describeKey(); } - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const { return std::string (""); } - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return std::string (""); } - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - BomContentDummy (); - BomContentDummy (const BomContentDummy&); - BomContentDummy (const BomStructure_T& iBomStructure) - : _bomStructure (iBomStructure) { } - - /** Destructor. */ - virtual ~BomContentDummy() { } - - private: - // Attributes - /** Reference structure. */ - const BomStructure_T& _bomStructure; - }; - -} -#endif // __STDAIR_BOM_BOMCONTENTDUMMY_HPP Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -23,12 +23,12 @@ // //////////////////////////////////////////////////////////////////// InventoryList_T BomRoot::getInventoryList () const { - return _bomRootStructure.getChildrenList(); + return _bomRootStructure.getChildrenHolder(); } // //////////////////////////////////////////////////////////////////// InventoryMap_T BomRoot::getInventoryMap () const { - return _bomRootStructure.getChildrenList(); + return _bomRootStructure.getChildrenHolder(); } Inventory* BomRoot::getInventory (const AirlineCode_T& iAirlineCode) const { Modified: trunk/stdair/stdair/bom/BomRootStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRootStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/BomRootStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -9,8 +9,8 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/InventoryStructure.hpp> namespace stdair { @@ -37,10 +37,10 @@ typedef typename BOM_CONTENT::BomKey_T BomKey_T; /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStructureDummy> ChildrenBomTypeList_T; + typedef boost::mpl::vector<InventoryStructure<ContentChild_T>, BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrive the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; @@ -53,25 +53,25 @@ return _content->getKey (); } - /** Get the list of inventories. */ - const ChildrenBomHolder_T& getChildrenList() const { - assert (_childrenList != NULL); - return *_childrenList; + /** Get the holder of inventories. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + assert (_childrenHolder != NULL); + return *_childrenHolder; } - /** Get the list of inventories. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; + /** Get the holder of inventories. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; } private: /////////////// Setters //////////////// - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } - /** Set the children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; + /** Set the children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; } public: @@ -101,7 +101,7 @@ /** Constructors are private so as to force the usage of the Factory layer. */ /** Default constructors. */ - BomRootStructure () : _content (NULL), _childrenList (NULL) { }; + BomRootStructure () : _content (NULL), _childrenHolder (NULL) { }; BomRootStructure (const BomRootStructure&); /** Destructor. */ @@ -112,8 +112,8 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - /** List of inventories. */ - ChildrenBomHolder_T* _childrenList; + /** Holder of inventories. */ + ChildrenBomHolder_T* _childrenHolder; }; } Copied: trunk/stdair/stdair/bom/BomStopContent.hpp (from rev 63, trunk/stdair/stdair/bom/BomContentDummy.hpp) =================================================================== --- trunk/stdair/stdair/bom/BomStopContent.hpp (rev 0) +++ trunk/stdair/stdair/bom/BomStopContent.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -0,0 +1,70 @@ +#ifndef __STDAIR_BOM_BOMSTOPCONTENT_HPP +#define __STDAIR_BOM_BOMSTOPCONTENT_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomContent.hpp> + +namespace stdair { + // Forward declarations. + class BomStopStructure; + class BomKey; + + /** Class representing the actual functional/business content + for the Bom stop. + <br>That class is just an utility tool to mark the stop + of the Bom tree. */ + class BomStopContent : public BomContent { + friend class FacBomContent; + + public: + // Type definitions + /** Definition allowing to retrieve the associated BOM structure type. */ + typedef BomStopStructure BomStructure_T; + + /** Definition allowing to retrieve the associated BOM key type. */ + typedef BomKey BomKey_T; + + public: + // /////////// Display support methods ///////// + /** Dump a Business Object into an output stream. + @param ostream& the output stream. */ + void toStream (std::ostream& ioOut) const { ioOut << toString(); } + + /** Read a Business Object from an input stream. + @param istream& the input stream. */ + void fromStream (std::istream& ioIn) { } + + /** Get the serialised version of the Business Object. */ + std::string toString() const { return describeKey(); } + + /** Get a string describing the whole key (differentiating two objects + at any level). */ + const std::string describeKey() const { return std::string (""); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return std::string (""); } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + BomStopContent (); + BomStopContent (const BomStopContent&); + BomStopContent (const BomStructure_T& iBomStructure) + : _bomStructure (iBomStructure) { } + + /** Destructor. */ + virtual ~BomStopContent() { } + + private: + // Attributes + /** Reference structure. */ + const BomStructure_T& _bomStructure; + }; + +} +#endif // __STDAIR_BOM_BOMSTOPCONTENT_HPP Copied: trunk/stdair/stdair/bom/BomStopStructure.hpp (from rev 63, trunk/stdair/stdair/bom/BomStructureDummy.hpp) =================================================================== --- trunk/stdair/stdair/bom/BomStopStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/BomStopStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -0,0 +1,94 @@ +#ifndef __STDAIR_BOM_BOMSTOPSTRUCTURE_HPP +#define __STDAIR_BOM_BOMSTOPSTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/BomKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> +// MPL +#include <boost/mpl/vector.hpp> + +namespace stdair { + // Forward declarations. + class BomStopContent; + + /** Wrapper class aimed at holding the actual content, modeled + by a specific BomStopContent class. */ + class BomStopStructure : public BomStructure { + friend class FacBomStructure; + friend class FacBomContent; + + private: + // Type definitions + /** Definition allowing to retrieve the associated BOM content type. */ + typedef BomStopContent Content_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector<> ChildrenBomTypeList_T; + + /** Definition allowing to retrive the default children bom holder type. */ + typedef BomChildrenHolderImp<mpl_::void_> DefaultChildrenBomHolder_T; + + public: + + // /////////// Getters ///////////// + /** Get the BomStopStructure key. */ + const BomKey_T& getKey() const { + return _key; + } + + private: + /////////////// Setters //////////////// + /** 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 _key.toString(); } + + /** Get a string describing the short key (differentiating two objects + at the same level). */ + const std::string describeShortKey() const { return _key.toString(); } + + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + BomStopStructure (); + BomStopStructure (const BomStopStructure&); + BomStopStructure (const BomKey_T& iKey) { _key = iKey; } + + /** Destructor. */ + ~BomStopStructure () { } + + private: + // Attributes + /** The key of both the structure and content objects. */ + BomKey_T _key; + + /** The actual functional (Business Object) content. */ + Content_T* _content; + }; + +} +#endif // __STDAIR_BOM_BOMSTOPSTRUCTURE_HPP + Deleted: trunk/stdair/stdair/bom/BomStructureDummy.hpp =================================================================== --- trunk/stdair/stdair/bom/BomStructureDummy.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/BomStructureDummy.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -1,94 +0,0 @@ -#ifndef __STDAIR_BOM_BOMSTRUCTUREDUMMY_HPP -#define __STDAIR_BOM_BOMSTRUCTUREDUMMY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/BomKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> -// MPL -#include <boost/mpl/vector.hpp> - -namespace stdair { - // Forward declarations. - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by a specific BomContentDummy class. */ - class BomStructureDummy : public BomStructure { - friend class FacBomStructure; - friend class FacBomContent; - - private: - // Type definitions - /** Definition allowing to retrieve the associated BOM content type. */ - typedef BomContentDummy Content_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<> ChildrenBomTypeList_T; - - /** Definition allowing to retrive the default children bom holder type. */ - typedef BomChildrenHolderImp<mpl_::void_> DefaultChildrenBomHolder_T; - - public: - - // /////////// Getters ///////////// - /** Get the BomStructureDummy key. */ - const BomKey_T& getKey() const { - return _key; - } - - private: - /////////////// Setters //////////////// - /** 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 _key.toString(); } - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - BomStructureDummy (); - BomStructureDummy (const BomStructureDummy&); - BomStructureDummy (const BomKey_T& iKey) { _key = iKey; } - - /** Destructor. */ - ~BomStructureDummy () { } - - private: - // Attributes - /** The key of both the structure and content objects. */ - BomKey_T _key; - - /** The actual functional (Business Object) content. */ - Content_T* _content; - }; - -} -#endif // __STDAIR_BOM_BOMSTRUCTUREDUMMY_HPP - Modified: trunk/stdair/stdair/bom/BookingClassStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/BookingClassStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,8 +7,8 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> namespace stdair { /** Wrapper class aimed at holding the actual content, modeled @@ -33,11 +33,11 @@ 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; + typedef boost::mpl::vector <BomStopStructure, + BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; public: // /////////// Getters ///////////// @@ -62,8 +62,8 @@ _parent = &ioSegmentCabinStructure; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } public: // /////////// Display support methods ///////// Modified: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -58,22 +58,22 @@ // ////////////////////////////////////////////////////////////////////// SegmentDateList_T FlightDate::getSegmentDateList () const { - return _flightDateStructure.getChildrenList(); + return _flightDateStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// SegmentDateMap_T FlightDate::getSegmentDateMap () const { - return _flightDateStructure.getChildrenList(); + return _flightDateStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// LegDateList_T FlightDate::getLegDateList () const { - return _flightDateStructure.getSecondChildrenList(); + return _flightDateStructure.getSecondChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// LegDateMap_T FlightDate::getLegDateMap () const { - return _flightDateStructure.getSecondChildrenList(); + return _flightDateStructure.getSecondChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/FlightDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,8 +7,8 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/SegmentDateStructure.hpp> #include <stdair/bom/LegDateStructure.hpp> #include <stdair/bom/SegmentDateKey.hpp> @@ -67,7 +67,7 @@ LegDateStructure<SecondContentChild_T> > ChildrenBomTypeList_T; /** Definition allowing to retrive the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; @@ -81,7 +81,7 @@ /** Define the children booking class holder type. */ typedef BomChildrenHolderImp<BookingClass_T> BookingClassHolder_T; - /** Define the map of ContentChild_T. */ + /** Define the map of booking class. */ typedef BomMap_T<BookingClass_T> BookingClassMap_T; public: @@ -103,16 +103,16 @@ return _content->getKey(); } - /** Get the list of segment-dates. */ - const ChildrenBomHolder_T& getChildrenList() const { - assert (_childrenList != NULL); - return *_childrenList; + /** Get the holder of segment-dates. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + assert (_childrenHolder != NULL); + return *_childrenHolder; } - /** Get the list of leg-dates. */ - const SecondChildrenBomHolder_T& getSecondChildrenList() const { - assert (_secondChildrenList != NULL); - return *_secondChildrenList; + /** Get the holder of leg-dates. */ + const SecondChildrenBomHolder_T& getSecondChildrenHolder() const { + assert (_secondChildrenHolder != NULL); + return *_secondChildrenHolder; } /** Get the holder of booking classes. */ @@ -121,14 +121,14 @@ return *_bookingClassHolder; } - /** Get the list of segment-dates. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; + /** Get the holder of segment-dates. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; } - /** Get the list of leg-dates. */ - void getChildrenList (SecondChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _secondChildrenList; + /** Get the holder of leg-dates. */ + void getChildrenHolder (SecondChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _secondChildrenHolder; } /** Retrieve, if existing, the segment-date corresponding to the @@ -137,7 +137,7 @@ ContentChild_T* getContentChild (const ChildKey_T& iKey) const { ContentChild_T* oContentChild_ptr = NULL; - ChildrenMap_T lChildrenMap (getChildrenList()); + ChildrenMap_T lChildrenMap (getChildrenHolder()); const MapKey_T lMapKey = iKey.toString(); typename ChildrenMap_T::iterator itContentChild = @@ -157,7 +157,7 @@ SecondContentChild_T* getSecondContentChild (const SecondChildKey_T& iKey) const { SecondContentChild_T* oContentChild_ptr = NULL; - SecondChildrenMap_T lChildrenMap (getSecondChildrenList()); + SecondChildrenMap_T lChildrenMap (getSecondChildrenHolder()); const MapKey_T lMapKey = iKey.toString(); typename SecondChildrenMap_T::iterator itContentChild = @@ -198,20 +198,20 @@ _parent = &ioParent; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } - /** Set the segment-date children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; + /** Set the segment-date children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; } - /** Set the leg-date children list. */ - void setChildrenList (SecondChildrenBomHolder_T& ioChildrenList) { - _secondChildrenList = &ioChildrenList; + /** Set the leg-date children holder. */ + void setChildrenHolder (SecondChildrenBomHolder_T& ioChildrenHolder) { + _secondChildrenHolder = &ioChildrenHolder; } - /** Set the booking class list. */ + /** Set the booking class holder. */ void setBookingClassHolder (BookingClassHolder_T& ioBookingClassHolder) { _bookingClassHolder = &ioBookingClassHolder; } @@ -244,7 +244,8 @@ layer. */ /** Default constructors. */ FlightDateStructure () : _parent (NULL), _content (NULL), - _childrenList (NULL), _secondChildrenList (NULL), + _childrenHolder (NULL), + _secondChildrenHolder (NULL), _bookingClassHolder (NULL) { } FlightDateStructure (const FlightDateStructure&); @@ -259,13 +260,13 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - /** List of segment-dates. */ - ChildrenBomHolder_T* _childrenList; + /** Holder of segment-dates. */ + ChildrenBomHolder_T* _childrenHolder; - /** List of leg-dates. */ - SecondChildrenBomHolder_T* _secondChildrenList; + /** Holder of leg-dates. */ + SecondChildrenBomHolder_T* _secondChildrenHolder; - /** List of booking classes. */ + /** Holder of booking classes. */ BookingClassHolder_T* _bookingClassHolder; }; Modified: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/Inventory.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,6 +7,7 @@ #include <stdair/bom/InventoryStructure.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/FlightDate.hpp> +#include <stdair/bom/BookingClass.hpp> #include <stdair/bom/BomList.hpp> #include <stdair/bom/BomMap.hpp> @@ -50,15 +51,25 @@ // ////////////////////////////////////////////////////////////////////// FlightDateList_T Inventory::getFlightDateList () const { - return _inventoryStructure.getChildrenList(); + return _inventoryStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// FlightDateMap_T Inventory::getFlightDateMap () const { - return _inventoryStructure.getChildrenList(); + return _inventoryStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// + BookingClassList_T Inventory::getBookingClassList () const { + return _inventoryStructure.getBookingClassHolder(); + } + + // ////////////////////////////////////////////////////////////////////// + BookingClassMap_T Inventory::getBookingClassMap () const { + return _inventoryStructure.getBookingClassHolder(); + } + + // ////////////////////////////////////////////////////////////////////// FlightDate* Inventory:: getFlightDate (const FlightDateKey_T& iKey) const { return _inventoryStructure.getContentChild (iKey); Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -9,6 +9,7 @@ #include <stdair/bom/InventoryStructure.hpp> #include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/FlightDateTypes.hpp> +#include <stdair/bom/BookingClassTypes.hpp> #include <stdair/bom/InventoryContent.hpp> namespace stdair { @@ -75,6 +76,12 @@ /** Get a FlightDateMap_T for iteration methods. */ FlightDateMap_T getFlightDateMap () const; + + /** Get a BookingClassList_T for iteration methods. */ + BookingClassList_T getBookingClassList () const; + + /** Get a BookingClassMap_T for iteration methods. */ + BookingClassMap_T getBookingClassMap () const; /** Get the airline feature. */ const AirlineFeature* getAirlineFeature () const { Modified: trunk/stdair/stdair/bom/InventoryStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -9,8 +9,8 @@ // (Boost) MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/FlightDateStructure.hpp> #include <stdair/bom/FlightDateKey.hpp> @@ -52,10 +52,10 @@ /** Definition allowing to retrieve the associated children type. */ typedef boost::mpl::vector<FlightDateStructure<ContentChild_T>, - BomStructureDummy> ChildrenBomTypeList_T; + BomStopStructure> ChildrenBomTypeList_T; /** Define the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; /** Define the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; @@ -66,7 +66,7 @@ /** Define the children booking class holder type. */ typedef BomChildrenHolderImp<BookingClass_T> BookingClassHolder_T; - /** Define the map of ContentChild_T. */ + /** Define the map of booking class. */ typedef BomMap_T<BookingClass_T> BookingClassMap_T; public: @@ -88,15 +88,15 @@ return _content->getKey (); } - /** Get the list of flight-dates. */ - const ChildrenBomHolder_T& getChildrenList() const { - assert (_childrenList != NULL); - return *_childrenList; + /** Get the holder of flight-dates. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + assert (_childrenHolder != NULL); + return *_childrenHolder; } - /** Get the list of flight-dates. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; + /** Get the holder of flight-dates. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; } /** Get the holder of booking classes. */ @@ -111,7 +111,7 @@ ContentChild_T* getContentChild (const ChildKey_T& iKey) const { ContentChild_T* oContentChild_ptr= NULL; - ChildrenMap_T lChildrenMap (getChildrenList()); + ChildrenMap_T lChildrenMap (getChildrenHolder()); const MapKey_T lMapKey = iKey.toString(); typename ChildrenMap_T::iterator itContentChild = @@ -132,15 +132,15 @@ _parent = &ioParent; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } - /** Set the children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; + /** Set the children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; } - /** Set the booking class list. */ + /** Set the booking class holder. */ void setBookingClassHolder (BookingClassHolder_T& ioBookingClassHolder) { _bookingClassHolder = &ioBookingClassHolder; } @@ -173,7 +173,8 @@ layer. */ /** Default constructors. */ InventoryStructure () : _parent (NULL), _content (NULL), - _childrenList (NULL), _bookingClassHolder (NULL) { } + _childrenHolder (NULL), + _bookingClassHolder (NULL) { } InventoryStructure (const InventoryStructure&); /** Destructor. */ @@ -187,10 +188,10 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - /** List of flight-dates. */ - ChildrenBomHolder_T* _childrenList; + /** Holder of flight-dates. */ + ChildrenBomHolder_T* _childrenHolder; - /** List of booking classes. */ + /** Holder of booking classes. */ BookingClassHolder_T* _bookingClassHolder; }; Modified: trunk/stdair/stdair/bom/LegCabinStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/LegCabinStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,11 +7,14 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/BookingClassStructure.hpp> namespace stdair { + // Forward declarations. + template <typename BOM> struct BomMap_T; + /** Wrapper class aimed at holding the actual content, modeled by an external specific LegCabin class (for instance, in the AIRSCHED library). */ @@ -34,14 +37,20 @@ 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; + typedef boost::mpl::vector <BomStopStructure, + BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; + /** Define the associated segment-cabin type. */ + typedef typename BOM_CONTENT::SegmentCabinContent_T SegmentCabin_T; + /** Define the associated segment-cabin holder type. */ - typedef BomChildrenHolderImp<typename BOM_CONTENT::SegmentCabinContent_T> SegmentCabinHolder_T; + typedef BomChildrenHolderImp<SegmentCabin_T> SegmentCabinHolder_T; + + /** Define the map of segment-cabin. */ + typedef BomMap_T<SegmentCabin_T> SegmentCabinMap_T; public: // /////////// Getters ///////////// @@ -66,8 +75,8 @@ _parent = &ioLegDateStructure; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } /** Set the segment-cabin holder. */ void setSegmentCabinHolder (SegmentCabinHolder_T& ioSegmentCabinHolder) { Modified: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/LegDate.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -55,12 +55,12 @@ // //////////////////////////////////////////////////////////////////// LegCabinList_T LegDate::getLegCabinList () const { - return _legDateStructure.getChildrenList(); + return _legDateStructure.getChildrenHolder(); } // //////////////////////////////////////////////////////////////////// LegCabinMap_T LegDate::getLegCabinMap () const { - return _legDateStructure.getChildrenList(); + return _legDateStructure.getChildrenHolder(); } // //////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -40,7 +40,7 @@ /** Definition allowing to retrieve the specific SegmentDate type. */ typedef SegmentDate SegmentDateContent_T; - + public: // /////////// Getters //////////// // /** Get the airline code (from the parent class). */ Modified: trunk/stdair/stdair/bom/LegDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,8 +7,8 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/LegCabinStructure.hpp> #include <stdair/bom/LegCabinKey.hpp> @@ -49,17 +49,23 @@ /** Definition allowing to retrieve the associated children type. */ typedef boost::mpl::vector <LegCabinStructure<ContentChild_T>, - BomStructureDummy> ChildrenBomTypeList_T; + BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + /** Define the associated segment-date type. */ + typedef typename BOM_CONTENT::SegmentDateContent_T SegmentDate_T; + + /** Define the associated segment-date holder type. */ + typedef BomChildrenHolderImp<SegmentDate_T> SegmentDateHolder_T; + + /** Define the map of segment-date. */ + typedef BomMap_T<SegmentDate_T> SegmentDateMap_T; - /** Define the associated segment-date holder type.*/ - typedef BomChildrenHolderImp<typename BOM_CONTENT::SegmentDateContent_T> SegmentDateHolder_T; - public: // /////////// Getters ///////////// /** Get the (parent) FlightDateStructure object. */ @@ -76,14 +82,14 @@ return _content->getKey(); } - /** Get the list of leg-cabins. */ - const ChildrenBomHolder_T& getChildrenList() const { - return *_childrenList; + /** Get the holder of leg-cabins. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + return *_childrenHolder; } - /** Get the list of leg-cabins. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; + /** Get the holder of leg-cabins. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; } /** Retrieve, if existing, the leg-cabin corresponding to the @@ -92,7 +98,7 @@ ContentChild_T* getContentChild (const ChildKey_T& iKey) const { ContentChild_T* oContentChild_ptr = NULL; - ChildrenMap_T lChildrenMap (getChildrenList()); + ChildrenMap_T lChildrenMap (getChildrenHolder()); const MapKey_T lMapKey = iKey.toString(); typename ChildrenMap_T::iterator itContentChild = @@ -113,12 +119,12 @@ _parent = &ioFlightDateStructure; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } - /** Set the leg-cabin children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; + /** Set the leg-cabin children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; } /** Set the segment-date holder. */ @@ -154,7 +160,7 @@ layer. */ /** Default constructors. */ LegDateStructure () : _parent (NULL), _content (NULL), - _childrenList (NULL), _segmentDateHolder (NULL) { } + _childrenHolder (NULL), _segmentDateHolder (NULL) { } LegDateStructure (const LegDateStructure&); /** Destructor. */ @@ -168,8 +174,8 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - /** List of leg-cabins. */ - ChildrenBomHolder_T* _childrenList; + /** Holder of leg-cabins. */ + ChildrenBomHolder_T* _childrenHolder; /** Holder of associated segment-dates. */ SegmentDateHolder_T* _segmentDateHolder; Modified: trunk/stdair/stdair/bom/SegmentCabin.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/SegmentCabin.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -56,12 +56,12 @@ // ////////////////////////////////////////////////////////////////////// BookingClassList_T SegmentCabin::getBookingClassList () const { - return _segmentCabinStructure.getChildrenList(); + return _segmentCabinStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// BookingClassMap_T SegmentCabin::getBookingClassMap () const { - return _segmentCabinStructure.getChildrenList(); + return _segmentCabinStructure.getChildrenHolder(); } } Modified: trunk/stdair/stdair/bom/SegmentCabinStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabinStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/SegmentCabinStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,11 +7,14 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/BookingClassStructure.hpp> namespace stdair { + // Forward declarations. + template <typename BOM> struct BomMap_T; + /** Wrapper class aimed at holding the actual content, modeled by an external specific SegmentCabin class (for instance, in the AIRSCHED library). */ @@ -39,16 +42,22 @@ /** Definition allowing to retrieve the associated children type. */ typedef boost::mpl::vector <BookingClassStructure<ContentChild_T>, - BomStructureDummy> ChildrenBomTypeList_T; + BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + typedef BomChildrenHolderImp<BomStopContent> DefaultChildrenBomHolder_T; /** Definition allowing to retrive the children bom holder type. */ typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + /** Define the associated leg-cabin type. */ + typedef typename BOM_CONTENT::LegCabinContent_T LegCabin_T; + /** Define the associated leg-cabin holder type. */ - typedef BomChildrenHolderImp<typename BOM_CONTENT::LegCabinContent_T> LegCabinHolder_T; + typedef BomChildrenHolderImp<LegCabin_T> LegCabinHolder_T; + + /** Define the map of leg-cabin. */ + typedef BomMap_T<LegCabin_T> LegCabinMap_T; public: // /////////// Getters ///////////// @@ -69,14 +78,14 @@ return _content->getKey(); } - /** Get the list of segment-cabins. */ - const ChildrenBomHolder_T& getChildrenList() const { - return *_childrenList; + /** Get the holder of segment-cabins. */ + const ChildrenBomHolder_T& getChildrenHolder() const { + return *_childrenHolder; } - /** Get the list of segment-cabins. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; + /** Get the holder of segment-cabins. */ + void getChildrenHolder (ChildrenBomHolder_T*& ioChildrenHolder) { + ioChildrenHolder = _childrenHolder; } private: @@ -86,12 +95,12 @@ _parent = &ioSegmentDateStructure; } - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } + /** Default children holder setter. */ + void setChildrenHolder (DefaultChildrenBomHolder_T&) { } - /** Set the segment-cabin children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; + /** Set the segment-cabin children holder. */ + void setChildrenHolder (ChildrenBomHolder_T& ioChildrenHolder) { + _childrenHolder = &ioChildrenHolder; } /** Set the leg-cabin holder. */ @@ -127,7 +136,7 @@ layer. */ /** Default constructors. */ SegmentCabinStructure () : _parent (NULL), _content (NULL), - _childrenList (NULL), _legCabinHolder (NULL) { } + _childrenHolder (NULL), _legCabinHolder (NULL) { } SegmentCabinStructure (const SegmentCabinStructure&); /** Destructor. */ @@ -141,8 +150,8 @@ /** The actual functional (Business Object) content. */ BOM_CONTENT* _content; - /** List of segment-cabins. */ - ChildrenBomHolder_T* _childrenList; + /** Holder of segment-cabins. */ + ChildrenBomHolder_T* _childrenHolder; /** Holder of associated leg-cabins. */ LegCabinHolder_T* _legCabinHolder; Modified: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2009-11-16 15:53:21 UTC (rev 65) @@ -57,12 +57,12 @@ // ////////////////////////////////////////////////////////////////////// SegmentCabinList_T SegmentDate::getSegmentCabinList () const { - return _segmentDateStructure.getChildrenList(); + return _segmentDateStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// SegmentCabinMap_T SegmentDate::getSegmentCabinMap () const { - return _segmentDateStructure.getChildrenList(); + return _segmentDateStructure.getChildrenHolder(); } // ////////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/SegmentDateStructure.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-11-13 08:52:41 UTC (rev 64) +++ trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-11-16 15:53:21 UTC (rev 65) @@ -7,11 +7,14 @@ // MPL #include <boost/mpl/vector.hpp> // STDAIR -#include <stdair/bom/BomStructureDummy.hpp> -#include <stdair/bom/BomContentDummy.hpp> +#include <stdair/bom/BomStopStructure.hpp> +#include <stdair/bom/BomStopContent.hpp> #include <stdair/bom/SegmentCabinStructure.hpp> namespace stdair { + // Forward declarations. + template <typename BOM> struct BomMap_T; + /** Wrapper class aimed at holding the actual content, modeled by an external specific SegmentDate class (for instance, in the AIRSCHED library). */ @@ -39,16 +42,22 @@ /** Definition allowing to retrieve the associated children type. */ typedef boost::mpl::vector <SegmentCabinStructure<ContentChild_T>, - BomStructureDummy> ChildrenBomTypeList_T; + BomStopStructure> ChildrenBomTypeList_T; /** Definition allowing to retrieve the default children bom holder type. */ - ... [truncated message content] |