From: <qua...@us...> - 2009-10-09 13:07:23
|
Revision: 38 http://stdair.svn.sourceforge.net/stdair/?rev=38&view=rev Author: quannaus Date: 2009-10-09 13:07:14 +0000 (Fri, 09 Oct 2009) Log Message: ----------- [Dev] Changed the name of bom structure objects. Modified Paths: -------------- trunk/stdair/stdair/bom/sources.mk Added Paths: ----------- trunk/stdair/stdair/bom/FlightDateStructure.hpp trunk/stdair/stdair/bom/InventoryStructure.hpp trunk/stdair/stdair/bom/LegDateStructure.hpp trunk/stdair/stdair/bom/SegmentDateStructure.hpp Removed Paths: ------------- trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/SegmentDate.hpp Deleted: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,336 +0,0 @@ -#ifndef __STDAIR_BOM_FLIGHTDATE_HPP -#define __STDAIR_BOM_FLIGHTDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/FlightDateKey.hpp> -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/LegDate.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> - -namespace stdair { - - // Forward declaration - template <typename BOM_CONTENT> class Inventory; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific FlightDate class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class FlightDate : 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 FlightDateKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - - /** Definition allowing to retrieve the children type of the - BOM_CONTENT. */ - typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; - - /** Definition allowing to retrieve the second children type of the - BOM_CONTENT. */ - typedef typename BOM_CONTENT::SecondContentChild_T SecondContentChild_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<SegmentDate<ContentChild_T>, - LegDate<SecondContentChild_T> > 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; - - /** Definition allowing to retrive the second children bom holder type. */ - typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; - - /** Define the iterators of the segment-date list. */ - typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; - typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; - - /** Define the iterators of the segment-date map. */ - typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; - typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; - - /** Define the iterators of the leg-date list. */ - typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; - typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; - - /** Define the iterators of the leg-date map. */ - typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; - typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; - - - public: - // /////////// Getters ///////////// - /** Get the (parent) Inventory object. */ - ParentBomStructure_T* getInventoryPtr() const { - return _parent; - } - - /** Get the (parent) Inventory object. */ - ParentBomStructure_T& getInventory() const { - assert (_parent != NULL); - return *_parent; - } - - /** Get the flight-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - /** Get the list of segment-dates. */ - const ChildrenBomHolder_T& getChildrenList() const { - return *_childrenList; - } - - /** Get the list of leg-dates. */ - const SecondChildrenBomHolder_T& getSecondChildrenList() const { - return *_secondChildrenList; - } - - /** Get the list of segment-dates. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; - } - - /** Get the list of leg-dates. */ - void getChildrenList (SecondChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _secondChildrenList; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) FlightDate object. */ - void setBomStructureRoot (ParentBomStructure_T& ioParent) { - _parent = &ioParent; - } - - /** Default children list setter. */ - void setChildrenList (DefaultChildrenBomHolder_T&) { } - - /** Set the segment-date children list. */ - void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { - _childrenList = &ioChildrenList; - } - - /** Set the leg-date children list. */ - void setChildrenList (SecondChildrenBomHolder_T& ioChildrenList) { - _secondChildrenList = &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; - } - - /** 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) { } - - /** 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(); } - - /** 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); - } - - public: - // /////////// Iteration methods ////////// - /** Initialise the internal iterator on segment date: - return the iterator at the begining of the list. */ - SegmentDateListIterator_T segmentDateListBegin () const { - assert (_childrenList != NULL); - return _childrenList->listBegin (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the end of the list. */ - SegmentDateListIterator_T segmentDateListEnd () const { - assert (_childrenList != NULL); - return _childrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rbegining of the list. */ - SegmentDateListReverseIterator_T segmentDateListRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rend of the list. */ - SegmentDateListReverseIterator_T segmentDateListREnd () const { - assert (_childrenList != NULL); - return _childrenList->listREnd (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the begining of the map. */ - SegmentDateMapIterator_T segmentDateMapBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapBegin (); - } - - /** Initialise the internal iterator on segment date: - return the iterator at the end of the map. */ - SegmentDateMapIterator_T segmentDateMapEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rbegining of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on segment date: - return the reverse iterator at the rend of the map. */ - SegmentDateMapReverseIterator_T segmentDateMapREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapREnd (); - } - - - /** Initialise the internal iterator on leg date: - return the iterator at the begining of the list. */ - LegDateListIterator_T legDateListBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listBegin (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the end of the list. */ - LegDateListIterator_T legDateListEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rbegining of the list. */ - LegDateListReverseIterator_T legDateListRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rend of the list. */ - LegDateListReverseIterator_T legDateListREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->listREnd (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the begining of the map. */ - LegDateMapIterator_T legDateMapBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapBegin (); - } - - /** Initialise the internal iterator on leg date: - return the iterator at the end of the map. */ - LegDateMapIterator_T legDateMapEnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rbegining of the map. */ - LegDateMapReverseIterator_T legDateMapRBegin () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on leg date: - return the reverse iterator at the rend of the map. */ - LegDateMapReverseIterator_T legDateMapREnd () const { - assert (_secondChildrenList != NULL); - return _secondChildrenList->mapREnd (); - } - - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - FlightDate (); - FlightDate (const FlightDate&); - FlightDate (const BomKey_T& iKey) - : _parent (NULL), _key (iKey), _childrenList (NULL), - _secondChildrenList (NULL) { } - - /** Destructor. */ - virtual ~FlightDate() { } - - private: - // Attributes - /** Parent root. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - - /** List of segment-dates. */ - ChildrenBomHolder_T* _childrenList; - - /** List of leg-dates. */ - SecondChildrenBomHolder_T* _secondChildrenList; - - }; - -} -#endif // __STDAIR_BOM_FLIGHTDATE_HPP - Copied: trunk/stdair/stdair/bom/FlightDateStructure.hpp (from rev 37, trunk/stdair/stdair/bom/FlightDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/FlightDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/FlightDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,336 @@ +#ifndef __STDAIR_BOM_FLIGHTDATESTRUCTURE_HPP +#define __STDAIR_BOM_FLIGHTDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/FlightDateKey.hpp> +#include <stdair/bom/SegmentDateStructure.hpp> +#include <stdair/bom/LegDateStructure.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declaration + template <typename BOM_CONTENT> class Inventory; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific FlightDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class FlightDateStructure : 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 FlightDateKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the second children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::SecondContentChild_T SecondContentChild_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector<SegmentDateStructure<ContentChild_T>, + LegDateStructure<SecondContentChild_T> > 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; + + /** Definition allowing to retrive the second children bom holder type. */ + typedef BomChildrenHolderImp<SecondContentChild_T> SecondChildrenBomHolder_T; + + /** Define the iterators of the segment-date list. */ + typedef typename ChildrenBomHolder_T::ListIterator_T SegmentDateListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T SegmentDateListReverseIterator_T; + + /** Define the iterators of the segment-date map. */ + typedef typename ChildrenBomHolder_T::MapIterator_T SegmentDateMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T SegmentDateMapReverseIterator_T; + + /** Define the iterators of the leg-date list. */ + typedef typename SecondChildrenBomHolder_T::ListIterator_T LegDateListIterator_T; + typedef typename SecondChildrenBomHolder_T::ListReverseIterator_T LegDateListReverseIterator_T; + + /** Define the iterators of the leg-date map. */ + typedef typename SecondChildrenBomHolder_T::MapIterator_T LegDateMapIterator_T; + typedef typename SecondChildrenBomHolder_T::MapReverseIterator_T LegDateMapReverseIterator_T; + + + public: + // /////////// Getters ///////////// + /** Get the (parent) InventoryStructure object. */ + ParentBomStructure_T* getInventoryStructurePtr() const { + return _parent; + } + + /** Get the (parent) InventoryStructure object. */ + ParentBomStructure_T& getInventoryStructure() const { + assert (_parent != NULL); + return *_parent; + } + + /** Get the flight-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + /** Get the list of segment-dates. */ + const ChildrenBomHolder_T& getChildrenList() const { + return *_childrenList; + } + + /** Get the list of leg-dates. */ + const SecondChildrenBomHolder_T& getSecondChildrenList() const { + return *_secondChildrenList; + } + + /** Get the list of segment-dates. */ + void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _childrenList; + } + + /** Get the list of leg-dates. */ + void getChildrenList (SecondChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _secondChildrenList; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) FlightDate object. */ + void setInventoryStructure (ParentBomStructure_T& ioParent) { + _parent = &ioParent; + } + + /** Default children list setter. */ + void setChildrenList (DefaultChildrenBomHolder_T&) { } + + /** Set the segment-date children list. */ + void setChildrenList (ChildrenBomHolder_T& ioChildrenList) { + _childrenList = &ioChildrenList; + } + + /** Set the leg-date children list. */ + void setChildrenList (SecondChildrenBomHolder_T& ioChildrenList) { + _secondChildrenList = &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; + } + + /** 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) { } + + /** 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(); } + + /** 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); + } + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the list. */ + SegmentDateListIterator_T segmentDateListBegin () const { + assert (_childrenList != NULL); + return _childrenList->listBegin (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the list. */ + SegmentDateListIterator_T segmentDateListEnd () const { + assert (_childrenList != NULL); + return _childrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the list. */ + SegmentDateListReverseIterator_T segmentDateListRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rend of the list. */ + SegmentDateListReverseIterator_T segmentDateListREnd () const { + assert (_childrenList != NULL); + return _childrenList->listREnd (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the begining of the map. */ + SegmentDateMapIterator_T segmentDateMapBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapBegin (); + } + + /** Initialise the internal iterator on segment date: + return the iterator at the end of the map. */ + SegmentDateMapIterator_T segmentDateMapEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rbegining of the map. */ + SegmentDateMapReverseIterator_T segmentDateMapRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on segment date: + return the reverse iterator at the rend of the map. */ + SegmentDateMapReverseIterator_T segmentDateMapREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapREnd (); + } + + + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the list. */ + LegDateListIterator_T legDateListBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listBegin (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the list. */ + LegDateListIterator_T legDateListEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the list. */ + LegDateListReverseIterator_T legDateListRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rend of the list. */ + LegDateListReverseIterator_T legDateListREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->listREnd (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the begining of the map. */ + LegDateMapIterator_T legDateMapBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapBegin (); + } + + /** Initialise the internal iterator on leg date: + return the iterator at the end of the map. */ + LegDateMapIterator_T legDateMapEnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rbegining of the map. */ + LegDateMapReverseIterator_T legDateMapRBegin () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on leg date: + return the reverse iterator at the rend of the map. */ + LegDateMapReverseIterator_T legDateMapREnd () const { + assert (_secondChildrenList != NULL); + return _secondChildrenList->mapREnd (); + } + + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + FlightDateStructure (); + FlightDateStructure (const FlightDateStructure&); + FlightDateStructure (const BomKey_T& iKey) + : _parent (NULL), _key (iKey), _childrenList (NULL), + _secondChildrenList (NULL) { } + + /** Destructor. */ + virtual ~FlightDateStructure() { } + + private: + // Attributes + /** Parent root. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + + /** List of segment-dates. */ + ChildrenBomHolder_T* _childrenList; + + /** List of leg-dates. */ + SecondChildrenBomHolder_T* _secondChildrenList; + + }; + +} +#endif // __STDAIR_BOM_FLIGHTDATESTRUCTURE_HPP + Deleted: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/Inventory.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,237 +0,0 @@ -#ifndef __STDAIR_BOM_INVENTORY_HPP -#define __STDAIR_BOM_INVENTORY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// (Boost) MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/InventoryKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> -#include <stdair/bom/BomIterator.hpp> -#include <stdair/bom/FlightDate.hpp> - -namespace stdair { - - // Forward declaration - template <typename BOM_CONTENT> class BomStructureRoot; - class BomStructureDummy; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific Inventory class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class Inventory : 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 InventoryKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the children type of the - BOM_CONTENT. */ - typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; - - /** Definition allowing to retrieve the associated children type. */ - typedef boost::mpl::vector<FlightDate<ContentChild_T>, - BomStructureDummy> ChildrenBomTypeList_T; - - /** Define the default children bom holder type. */ - typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; - - /** Define the children bom holder type. */ - typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; - - /** Define the iterators of the flight-date list. */ - typedef typename ChildrenBomHolder_T::ListIterator_T FlightDateListIterator_T; - typedef typename ChildrenBomHolder_T::ListReverseIterator_T FlightDateListReverseIterator_T; - - /** Define the iterators of the flight-date map. */ - typedef typename ChildrenBomHolder_T::MapIterator_T FlightDateMapIterator_T; - typedef typename ChildrenBomHolder_T::MapReverseIterator_T FlightDateMapReverseIterator_T; - - public: - // /////////// Getters ///////////// - /** Get the (parent) BomStructureRoot object. */ - ParentBomStructure_T* getBomStructureRootPtr() const { - return _parent; - } - - /** Get the (parent) BomStructureRoot object. */ - ParentBomStructure_T& getBomStructureRoot() const { - assert (_parent != NULL); - return *_parent; - } - - /** Get the flight-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - /** Get the list of flight-dates. */ - const ChildrenBomHolder_T& getChildrenList() const { - assert (_childrenList != NULL); - return *_childrenList; - } - - /** Get the list of flight-dates. */ - void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { - ioChildrenList = _childrenList; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) Inventory object. */ - void setBomStructureRoot (ParentBomStructure_T& ioParent) { - _parent = &ioParent; - } - - /** 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; - } - - /** 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) { } - - /** 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(); } - - /** 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); - } - - public: - // /////////// Iteration methods ////////// - /** Initialise the internal iterator on flight date: - return the iterator at the begining of the list. */ - FlightDateListIterator_T flightDateListBegin () const { - assert (_childrenList != NULL); - return _childrenList->listBegin (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the end of the list. */ - FlightDateListIterator_T flightDateListEnd () const { - assert (_childrenList != NULL); - return _childrenList->listEnd (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rbegining of the list. */ - FlightDateListReverseIterator_T flightDateListRBegin () const { - assert (_childrenList != NULL); - return _childrenList->listRBegin (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rend of the list. */ - FlightDateListReverseIterator_T flightDateListREnd () const { - assert (_childrenList != NULL); - return _childrenList->listREnd (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the begining of the map. */ - FlightDateMapIterator_T flightDateMapBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapBegin (); - } - - /** Initialise the internal iterator on flight date: - return the iterator at the end of the map. */ - FlightDateMapIterator_T flightDateMapEnd () const { - assert (_childrenList != NULL); - return _childrenList->mapEnd (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rbegining of the map. */ - FlightDateMapReverseIterator_T flightDateMapRBegin () const { - assert (_childrenList != NULL); - return _childrenList->mapRBegin (); - } - - /** Initialise the internal reverse iterator on flight date: - return the reverse iterator at the rend of the map. */ - FlightDateMapReverseIterator_T flightDateMapREnd () const { - assert (_childrenList != NULL); - return _childrenList->mapREnd (); - } - - private: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Default constructors. */ - Inventory (); - Inventory (const Inventory&); - Inventory (const BomKey_T& iKey) - : _parent (NULL), _key (iKey), _childrenList (NULL) { } - - /** Destructor. */ - virtual ~Inventory() { } - - private: - // Attributes - /** Parent root. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - - /** List of flight-dates. */ - ChildrenBomHolder_T* _childrenList; - }; - -} -#endif // __STDAIR_BOM_INVENTORY_HPP - Copied: trunk/stdair/stdair/bom/InventoryStructure.hpp (from rev 37, trunk/stdair/stdair/bom/Inventory.hpp) =================================================================== --- trunk/stdair/stdair/bom/InventoryStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/InventoryStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,237 @@ +#ifndef __STDAIR_BOM_INVENTORYSTRUCTURE_HPP +#define __STDAIR_BOM_INVENTORYSTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <cassert> +// (Boost) MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/InventoryKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> +#include <stdair/bom/BomIterator.hpp> +#include <stdair/bom/FlightDateStructure.hpp> + +namespace stdair { + + // Forward declaration + template <typename BOM_CONTENT> class BomStructureRoot; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific Inventory class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class InventoryStructure : 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 InventoryKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the children type of the + BOM_CONTENT. */ + typedef typename BOM_CONTENT::ContentChild_T ContentChild_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_T::BomStructure_T ParentBomStructure_T; + + /** Definition allowing to retrieve the associated children type. */ + typedef boost::mpl::vector<FlightDate<ContentChild_T>, + BomStructureDummy> ChildrenBomTypeList_T; + + /** Define the default children bom holder type. */ + typedef BomChildrenHolderImp<BomContentDummy> DefaultChildrenBomHolder_T; + + /** Define the children bom holder type. */ + typedef BomChildrenHolderImp<ContentChild_T> ChildrenBomHolder_T; + + /** Define the iterators of the flight-date list. */ + typedef typename ChildrenBomHolder_T::ListIterator_T FlightDateListIterator_T; + typedef typename ChildrenBomHolder_T::ListReverseIterator_T FlightDateListReverseIterator_T; + + /** Define the iterators of the flight-date map. */ + typedef typename ChildrenBomHolder_T::MapIterator_T FlightDateMapIterator_T; + typedef typename ChildrenBomHolder_T::MapReverseIterator_T FlightDateMapReverseIterator_T; + + public: + // /////////// Getters ///////////// + /** Get the (parent) BomStructureRoot object. */ + ParentBomStructure_T* getBomStructureRootPtr() const { + return _parent; + } + + /** Get the (parent) BomStructureRoot object. */ + ParentBomStructure_T& getBomStructureRoot() const { + assert (_parent != NULL); + return *_parent; + } + + /** Get the flight-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + /** Get the list of flight-dates. */ + const ChildrenBomHolder_T& getChildrenList() const { + assert (_childrenList != NULL); + return *_childrenList; + } + + /** Get the list of flight-dates. */ + void getChildrenList (ChildrenBomHolder_T*& ioChildrenList) { + ioChildrenList = _childrenList; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) Inventory object. */ + void setBomStructureRoot (ParentBomStructure_T& ioParent) { + _parent = &ioParent; + } + + /** 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; + } + + /** 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) { } + + /** 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(); } + + /** 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); + } + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the list. */ + FlightDateListIterator_T flightDateListBegin () const { + assert (_childrenList != NULL); + return _childrenList->listBegin (); + } + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the list. */ + FlightDateListIterator_T flightDateListEnd () const { + assert (_childrenList != NULL); + return _childrenList->listEnd (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the list. */ + FlightDateListReverseIterator_T flightDateListRBegin () const { + assert (_childrenList != NULL); + return _childrenList->listRBegin (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rend of the list. */ + FlightDateListReverseIterator_T flightDateListREnd () const { + assert (_childrenList != NULL); + return _childrenList->listREnd (); + } + + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the map. */ + FlightDateMapIterator_T flightDateMapBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapBegin (); + } + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the map. */ + FlightDateMapIterator_T flightDateMapEnd () const { + assert (_childrenList != NULL); + return _childrenList->mapEnd (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the map. */ + FlightDateMapReverseIterator_T flightDateMapRBegin () const { + assert (_childrenList != NULL); + return _childrenList->mapRBegin (); + } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rend of the map. */ + FlightDateMapReverseIterator_T flightDateMapREnd () const { + assert (_childrenList != NULL); + return _childrenList->mapREnd (); + } + + private: + /** Constructors are private so as to force the usage of the Factory + layer. */ + /** Default constructors. */ + InventoryStructure (); + InventoryStructure (const InventoryStructure&); + InventoryStructure (const BomKey_T& iKey) + : _parent (NULL), _key (iKey), _childrenList (NULL) { } + + /** Destructor. */ + virtual ~InventoryStructure() { } + + private: + // Attributes + /** Parent root. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + + /** List of flight-dates. */ + ChildrenBomHolder_T* _childrenList; + }; + +} +#endif // __STDAIR_BOM_INVENTORYSTRUCTURE_HPP + Deleted: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/LegDate.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,127 +0,0 @@ -#ifndef __STDAIR_BOM_LEGDATE_HPP -#define __STDAIR_BOM_LEGDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/LegDateKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> - -namespace stdair { - - // Forward declarations - template <typename BOM_CONTENT> class FlightDate; - class BomStructureDummy; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific LegDate class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class LegDate : 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 LegDateKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_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) FlightDate object. */ - ParentBomStructure_T* getFlightDatePtr() const { - return _parent; - } - - /** Get the (parent) FlightDate object. */ - ParentBomStructure_T& getFlightDate() const; - - /** Get the leg-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) FlightDate object. */ - void setFlightDate (ParentBomStructure_T& ioFlightDate) { - _parent = &ioFlightDate; - } - - /** 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; - } - - /** 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) { } - - /** 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. */ - LegDate (); - LegDate (const LegDate&); - LegDate (const BomKey_T& iKey) : _parent (NULL), _key (iKey) { } - - /** Destructor. */ - virtual ~LegDate() { } - - private: - // Attributes - /** Parent flight-date. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - }; - -} -#endif // __STDAIR_BOM_LEGDATE_HPP Copied: trunk/stdair/stdair/bom/LegDateStructure.hpp (from rev 37, trunk/stdair/stdair/bom/LegDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/LegDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/LegDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,127 @@ +#ifndef __STDAIR_BOM_LEGDATESTRUCTURE_HPP +#define __STDAIR_BOM_LEGDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/LegDateKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> class FlightDateStructure; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific LegDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class LegDateStructure : 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 LegDateKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_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) FlightDateStructure object. */ + ParentBomStructure_T* getFlightDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) FlightDateStructure object. */ + ParentBomStructure_T& getFlightDateStructure() const; + + /** Get the leg-date key. */ + const BomKey_T& getKey() const { + return _key; + } + + private: + // /////////// Setters ///////////// + /** Set the (parent) FlightDateStructure object. */ + void setFlightDateStructure (ParentBomStructure_T& ioFlightDateStructure) { + _parent = &ioFlightDateStructure; + } + + /** 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; + } + + /** 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) { } + + /** 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. */ + LegDateStructure (); + LegDateStructure (const LegDateStructure&); + LegDateStructure (const BomKey_T& iKey) : _parent (NULL), _key (iKey) { } + + /** Destructor. */ + virtual ~LegDateStructure() { } + + private: + // Attributes + /** Parent flight-date. */ + ParentBomStructure_T* _parent; + + /** The actual functional (Business Object) content. */ + BOM_CONTENT* _content; + + /** The key of both the structure and content objects. */ + BomKey_T _key; + }; + +} +#endif // __STDAIR_BOM_LEGDATESTRUCTURE_HPP Deleted: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-08 15:22:51 UTC (rev 37) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -1,127 +0,0 @@ -#ifndef __STDAIR_BOM_SEGMENTDATE_HPP -#define __STDAIR_BOM_SEGMENTDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// MPL -#include <boost/mpl/vector.hpp> -// STDAIR -#include <stdair/bom/BomStructure.hpp> -#include <stdair/bom/SegmentDateKey.hpp> -#include <stdair/bom/BomChildrenHolderImp.hpp> - -namespace stdair { - - // Forward declarations - template <typename BOM_CONTENT> class FlightDate; - class BomStructureDummy; - class BomContentDummy; - - /** Wrapper class aimed at holding the actual content, modeled - by an external specific SegmentDate class (for instance, - in the AIRSCHED library). */ - template <class BOM_CONTENT> - class SegmentDate : 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 SegmentDateKey<BOM_CONTENT> BomKey_T; - - /** Definition allowing to retrieve the associated parent - BOM structure type. */ - typedef typename BOM_CONTENT::ParentBomContent_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) FlightDate object. */ - ParentBomStructure_T* getFlightDatePtr() const { - return _parent; - } - - /** Get the (parent) FlightDate object. */ - ParentBomStructure_T& getFlightDate() const; - - /** Get the segment-date key. */ - const BomKey_T& getKey() const { - return _key; - } - - private: - // /////////// Setters ///////////// - /** Set the (parent) FlightDate object. */ - void setFlightDate (ParentBomStructure_T& ioFlightDate) { - _parent = &ioFlightDate; - } - - /** 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; - } - - /** 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) { } - - /** 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. */ - SegmentDate (); - SegmentDate (const SegmentDate&); - SegmentDate (const BomKey_T& iKey) : _parent (NULL), _key (iKey) { } - - /** Destructor. */ - virtual ~SegmentDate() { } - - private: - // Attributes - /** Parent flight-date. */ - ParentBomStructure_T* _parent; - - /** The actual functional (Business Object) content. */ - BOM_CONTENT* _content; - - /** The key of both the structure and content objects. */ - BomKey_T _key; - }; - -} -#endif // __STDAIR_BOM_SEGMENTDATE_HPP Copied: trunk/stdair/stdair/bom/SegmentDateStructure.hpp (from rev 37, trunk/stdair/stdair/bom/SegmentDate.hpp) =================================================================== --- trunk/stdair/stdair/bom/SegmentDateStructure.hpp (rev 0) +++ trunk/stdair/stdair/bom/SegmentDateStructure.hpp 2009-10-09 13:07:14 UTC (rev 38) @@ -0,0 +1,127 @@ +#ifndef __STDAIR_BOM_SEGMENTDATESTRUCTURE_HPP +#define __STDAIR_BOM_SEGMENTDATESTRUCTURE_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// MPL +#include <boost/mpl/vector.hpp> +// STDAIR +#include <stdair/bom/BomStructure.hpp> +#include <stdair/bom/SegmentDateKey.hpp> +#include <stdair/bom/BomChildrenHolderImp.hpp> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT> class FlightDateStructure; + class BomStructureDummy; + class BomContentDummy; + + /** Wrapper class aimed at holding the actual content, modeled + by an external specific SegmentDate class (for instance, + in the AIRSCHED library). */ + template <class BOM_CONTENT> + class SegmentDateStructure : 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 SegmentDateKey<BOM_CONTENT> BomKey_T; + + /** Definition allowing to retrieve the associated parent + BOM structure type. */ + typedef typename BOM_CONTENT::ParentBomContent_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) FlightDateStructure object. */ + ParentBomStructure_T* getFlightDateStructurePtr() const { + return _parent; + } + + /** Get the (parent) FlightDateStructure object. */ + ParentBomStructure_T& getFlightDateStructure() const; + + /** Get the segment-date key. */ + const BomKey_T& getKey() const { + return _key; +... [truncated message content] |