From: <qua...@us...> - 2010-07-07 15:10:20
|
Revision: 211 http://stdair.svn.sourceforge.net/stdair/?rev=211&view=rev Author: quannaus Date: 2010-07-07 15:10:13 +0000 (Wed, 07 Jul 2010) Log Message: ----------- [dev] Removed Network. Modified Paths: -------------- trunk/stdair/stdair/batches/stdair.cpp trunk/stdair/stdair/bom/BomManager.cpp trunk/stdair/stdair/bom/BomManager.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomSource.hpp trunk/stdair/stdair/bom/BomTypes.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/command/CmdBomManager.cpp trunk/stdair/stdair/command/CmdBomManager.hpp trunk/stdair/stdair/service/STDAIR_Service.cpp Removed Paths: ------------- trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/AirportDateContent.cpp trunk/stdair/stdair/bom/AirportDateContent.hpp trunk/stdair/stdair/bom/AirportDateKey.cpp trunk/stdair/stdair/bom/AirportDateKey.hpp trunk/stdair/stdair/bom/AirportDateTypes.hpp trunk/stdair/stdair/bom/Network.cpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkContent.cpp trunk/stdair/stdair/bom/NetworkContent.hpp trunk/stdair/stdair/bom/NetworkDate.cpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/NetworkDateContent.cpp trunk/stdair/stdair/bom/NetworkDateContent.hpp trunk/stdair/stdair/bom/NetworkDateKey.cpp trunk/stdair/stdair/bom/NetworkDateKey.hpp trunk/stdair/stdair/bom/NetworkDateTypes.hpp trunk/stdair/stdair/bom/NetworkKey.cpp trunk/stdair/stdair/bom/NetworkKey.hpp trunk/stdair/stdair/bom/NetworkTypes.hpp trunk/stdair/stdair/bom/OutboundPath.cpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/OutboundPathContent.cpp trunk/stdair/stdair/bom/OutboundPathContent.hpp trunk/stdair/stdair/bom/OutboundPathKey.cpp trunk/stdair/stdair/bom/OutboundPathKey.hpp trunk/stdair/stdair/bom/OutboundPathTypes.hpp Modified: trunk/stdair/stdair/batches/stdair.cpp =================================================================== --- trunk/stdair/stdair/batches/stdair.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/batches/stdair.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -7,14 +7,217 @@ // StdAir #include <stdair/STDAIR_Types.hpp> #include <stdair/bom/BomList.hpp> +#include <stdair/bom/BomSource.hpp> #include <stdair/factory/FacBomContent.hpp> +#include <stdair/service/Logger.hpp> +#include <stdair/STDAIR_Service.hpp> // ///////// M A I N //////////// int main (int argc, char* argv[]) { - try { + try { + + // Test create objects. + + // Output log File + std::string lLogFilename ("stdair.log"); + + // Set the log parameters + std::ofstream logOutputFile; + // open and clean the log outputfile + logOutputFile.open (lLogFilename.c_str()); + logOutputFile.clear(); + + const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile); + stdair::STDAIR_Service stdairService (lLogParams); + + // DEBUG + STDAIR_LOG_DEBUG ("Welcome to stdair"); + + // Step 0.0: initialisation + // Create the root of the Bom tree (i.e., a BomRoot object) + stdair::BomRoot& lBomRoot = + stdair::FacBomContent::instance().create<stdair::BomRoot>(); + + + // Step 0.1: Inventory level + // Create an Inventory (BA) + const stdair::AirlineCode_T lAirlineCode ("BA"); + stdair::InventoryKey_T lInventoryKey (lAirlineCode); + + stdair::Inventory& lInventory = + stdair::FacBomContent::instance().create<stdair::Inventory>(lInventoryKey); + stdair::FacBomContent::linkWithParent (lInventory, lBomRoot); + + // Display the inventory + STDAIR_LOG_DEBUG ("Inventory: " << lInventory.toString()); + + // Step 0.2: Flight-date level + // Create a FlightDate (BA15/10-JUN-2010) + const stdair::FlightNumber_T lFlightNumber = 15; + const stdair::Date_T lDate (2010, 6, 10); + stdair::FlightDateKey_T lFlightDateKey (lFlightNumber, lDate); + + stdair::FlightDate& lFlightDate = stdair::FacBomContent:: + instance().create<stdair::FlightDate> (lFlightDateKey); + stdair::FacBomContent::linkWithParent (lFlightDate, lInventory); + + // Display the flight-date + STDAIR_LOG_DEBUG ("FlightDate: " << lFlightDate.toString()); + + // Step 0.3: Segment-date level + // Create a first SegmentDate (LHR-SYD) + const stdair::AirportCode_T lLHR ("LHR"); + const stdair::AirportCode_T lSYD ("SYD"); + stdair::SegmentDateKey_T lSegmentDateKey (lLHR, lSYD); + + stdair::SegmentDate& lLHRSYDSegment = + stdair::FacBomContent:: + instance().create<stdair::SegmentDate> (lSegmentDateKey); + stdair::FacBomContent::linkWithParent (lLHRSYDSegment, lFlightDate); + + // Display the segment-date + STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRSYDSegment.toString()); + + + // Create a second SegmentDate (LHR-BKK) + const stdair::AirportCode_T lBKK ("BKK"); + lSegmentDateKey = stdair::SegmentDateKey_T (lLHR, lBKK); + + stdair::SegmentDate& lLHRBKKSegment = + stdair::FacBomContent:: + instance().create<stdair::SegmentDate> (lSegmentDateKey); + stdair::FacBomContent::linkWithParent (lLHRBKKSegment, lFlightDate); + + // Display the segment-date + STDAIR_LOG_DEBUG ("SegmentDate: " << lLHRBKKSegment.toString()); + + + // Create a third SegmentDate (BKK-SYD) + lSegmentDateKey = stdair::SegmentDateKey_T (lBKK, lSYD); + + stdair::SegmentDate& lBKKSYDSegment = + stdair::FacBomContent:: + instance().create<stdair::SegmentDate> (lSegmentDateKey); + stdair::FacBomContent::linkWithParent (lBKKSYDSegment, lFlightDate); + + // Display the segment-date + STDAIR_LOG_DEBUG ("SegmentDate: " << lBKKSYDSegment.toString()); + + + // Step 0.4: Leg-date level + // Create a first LegDate (LHR) + stdair::LegDateKey_T lLegDateKey (lLHR); + + stdair::LegDate& lLHRLeg = + stdair::FacBomContent::instance().create<stdair::LegDate> (lLegDateKey); + stdair::FacBomContent::linkWithParent<stdair::LegDate>(lLHRLeg, lFlightDate); + + // Display the leg-date + STDAIR_LOG_DEBUG ("LegDate: " << lLHRLeg.toString()); + + // Create a second LegDate (BKK) + lLegDateKey = stdair::LegDateKey_T (lBKK); + + stdair::LegDate& lBKKLeg = + stdair::FacBomContent::instance().create<stdair::LegDate> (lLegDateKey); + stdair::FacBomContent::linkWithParent (lBKKLeg, lFlightDate); + + // Display the leg-date + STDAIR_LOG_DEBUG ("LegDate: " << lBKKLeg.toString()); + + // Step 0.5: segment-cabin level + // Create a SegmentCabin (Y) of the Segment LHR-BKK; + const stdair::CabinCode_T lY ("Y"); + stdair::SegmentCabinKey_T lYSegmentCabinKey (lY); + + stdair::SegmentCabin& lLHRBKKSegmentYCabin = + stdair::FacBomContent:: + instance().create<stdair::SegmentCabin> (lYSegmentCabinKey); + stdair::FacBomContent:: + linkWithParent (lLHRBKKSegmentYCabin, lLHRBKKSegment); + + // Display the segment-cabin + STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRBKKSegmentYCabin.toString()); + + // Create a SegmentCabin (Y) of the Segment BKK-SYD; + stdair::SegmentCabin& lBKKSYDSegmentYCabin = + stdair::FacBomContent:: + instance().create<stdair::SegmentCabin> (lYSegmentCabinKey); + stdair::FacBomContent:: + linkWithParent (lBKKSYDSegmentYCabin, lBKKSYDSegment); + // Display the segment-cabin + STDAIR_LOG_DEBUG ("SegmentCabin: " << lBKKSYDSegmentYCabin.toString()); + + // Create a SegmentCabin (Y) of the Segment LHR-SYD; + stdair::SegmentCabin& lLHRSYDSegmentYCabin = + stdair::FacBomContent:: + instance().create<stdair::SegmentCabin> (lYSegmentCabinKey); + stdair::FacBomContent:: + linkWithParent (lLHRSYDSegmentYCabin, lLHRSYDSegment); + + // Display the segment-cabin + STDAIR_LOG_DEBUG ("SegmentCabin: " << lLHRSYDSegmentYCabin.toString()); + + + // Step 0.6: leg-cabin level + // Create a LegCabin (Y) of the Leg LHR-BKK; + stdair::LegCabinKey_T lYLegCabinKey (lY); + + stdair::LegCabin& lLHRLegYCabin = + stdair::FacBomContent::instance().create<stdair::LegCabin> (lYLegCabinKey); + stdair::FacBomContent::linkWithParent (lLHRLegYCabin, lLHRLeg); + + // Display the leg-cabin + STDAIR_LOG_DEBUG ("LegCabin: " << lLHRLegYCabin.toString()); + + // Create a LegCabin (Y) of the Leg BKK-SYD; + stdair::LegCabin& lBKKLegYCabin = + stdair::FacBomContent::instance().create<stdair::LegCabin> (lYLegCabinKey); + stdair::FacBomContent::linkWithParent (lBKKLegYCabin, lBKKLeg); + + // Display the leg-cabin + STDAIR_LOG_DEBUG ("LegCabin: " << lBKKLegYCabin.toString()); + + // Step 0.7: booking class level + // Create a BookingClass (Q) of the Segment LHR-BKK, cabin Y; + const stdair::ClassCode_T lQ ("Q"); + stdair::BookingClassKey_T lQBookingClassKey (lQ); + + stdair::BookingClass& lLHRBKKSegmentYCabinQClass = + stdair::FacBomContent:: + instance().create<stdair::BookingClass> (lQBookingClassKey); + stdair::FacBomContent:: + linkWithParent (lLHRBKKSegmentYCabinQClass, lLHRBKKSegmentYCabin); + + // Display the booking class + STDAIR_LOG_DEBUG ("BookingClass: " + << lLHRBKKSegmentYCabinQClass.toString()); + + // Browse the BomRoot and display the created objects. + STDAIR_LOG_DEBUG ("Browse the BomRoot"); + + const stdair::InventoryList_T& lInventoryList = lBomRoot.getInventoryList(); + for (stdair::InventoryList_T::iterator itInv = lInventoryList.begin(); + itInv != lInventoryList.end(); ++itInv) { + const stdair::Inventory& lCurrentInventory = *itInv; + STDAIR_LOG_DEBUG ("Inventory: " << lCurrentInventory.toString()); + + const stdair::FlightDateList_T& lFlightDateList = + lCurrentInventory.getFlightDateList (); + for (stdair::FlightDateList_T::iterator itFlightDate = + lFlightDateList.begin(); + itFlightDate != lFlightDateList.end(); ++itFlightDate) { + const stdair::FlightDate& lCurrentFlightDate = *itFlightDate; + STDAIR_LOG_DEBUG ("FlightDate: " << lCurrentFlightDate.describeKey()); + } + } + + // Close the Log outputFile + logOutputFile.close(); + } catch (const std::exception& stde) { std::cerr << "Standard exception: " << stde.what() << std::endl; return -1; Deleted: trunk/stdair/stdair/bom/AirportDate.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,90 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// STDAIR -#include <stdair/basic/BasConst_Inventory.hpp> -#include <stdair/bom/BomSource.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - AirportDate::AirportDate (const Key_T& iKey, - Structure_T& ioAirportStructure) - : AirportDateContent (iKey), _structure (ioAirportStructure) { - init (); - } - - // //////////////////////////////////////////////////////////////////// - AirportDate::~AirportDate () { - } - - // //////////////////////////////////////////////////////////////////// - void AirportDate::init () { - _structure.initChildrenHolder<OutboundPath>(); - } - - // //////////////////////////////////////////////////////////////////// - void AirportDate::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // //////////////////////////////////////////////////////////////////// - void AirportDate::fromStream (std::istream& ioIn) { - } - - // //////////////////////////////////////////////////////////////////// - std::string AirportDate::toString() const { - std::ostringstream oStr; - oStr << describeShortKey() << std::endl; - return oStr.str(); - } - - // //////////////////////////////////////////////////////////////////// - const std::string AirportDate::describeKey() const { - std::ostringstream oStr; - oStr << _structure.describeParentKey() << ", " << describeShortKey(); - return oStr.str(); - } - - // //////////////////////////////////////////////////////////////////// - OutboundPathList_T AirportDate::getOutboundPathList () const { - return _structure.getChildrenHolder<OutboundPath>(); - } - - // //////////////////////////////////////////////////////////////////// - OutboundPathMultimap_T AirportDate::getOutboundPathMultimap () const { - return _structure.getChildrenHolder<OutboundPath>(); - } - - - // //////////////////////////////////////////////////////////////////// - void AirportDate:: - buildOutboundPathListList (OutboundPath& ioOutboundPath) { - const OutboundPathKey_T& lOutboundPathKey = ioOutboundPath.getKey(); - const NbOfSegments_T& lNbOfSegments = - lOutboundPathKey.getNbOfSegments (); - assert (lNbOfSegments > 0 - && lNbOfSegments <= MAXIMUM_NUMBER_OF_SEGMENTS_IN_OND); - const NbOfSegments_T lNbOfSegments_m1 = - static_cast<const NbOfSegments_T> (lNbOfSegments - 1); - - // If needed, initialise the list of lists with empty fixed-length - // outbound-path lists. - while (_outboundPathListList.size() <= lNbOfSegments_m1) { - OutboundPathLightList_T lOutboundPathLightList; - _outboundPathListList.push_back (lOutboundPathLightList); - } - - // Retrieve the i-fixed-length Outbound-Path list (i = number of - // segments). - OutboundPathLightList_T& lOutboundPathLightList = - _outboundPathListList.at (lNbOfSegments-1); - - // Add the OutboundPath to that fixed-length-path list. - lOutboundPathLightList.push_back (&ioOutboundPath); - } - -} - Deleted: trunk/stdair/stdair/bom/AirportDate.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,115 +0,0 @@ -#ifndef __STDAIR_BOM_AIRPORTDATE_HPP -#define __STDAIR_BOM_AIRPORTDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// Boost Fusion -#include <boost/version.hpp> -#if BOOST_VERSION >= 103500 -#include <boost/fusion/include/map.hpp> -#else // BOOST_VERSION >= 103500 -#include <boost/mpl/map.hpp> -#endif // BOOST_VERSION >= 103500 -// StdAir -#include <stdair/bom/AirportDateContent.hpp> -#include <stdair/bom/AirportDateTypes.hpp> -#include <stdair/bom/OutboundPathTypes.hpp> - -namespace stdair { - // Forward declarations - class NetworkDate; - class OutboundPath; - - /** Class representing the actual functional/business content for a - airport-date. */ - class AirportDate : public AirportDateContent { - friend class FacBomContent; - - public: - // ////////////////////////////////////////////////////////////////// - // See the explanations, within the BomRoot class, for all - // the types which require to be specified below - // ////////////////////////////////////////////////////////////////// - /** Definition allowing to retrieve the associated BOM structure type. */ - typedef AirportDateStructure_T Structure_T; - - /** Definition allowing to retrieve the associated parent - BOM content type. */ - typedef NetworkDate Parent_T; - - /** Definition allowing to retrieve the map/multimap type using by - BomChildrenHolder. */ - typedef std::map<const MapKey_T, const Structure_T*> Map_T; - - /** Define the list of children holder types. */ -#if BOOST_VERSION >= 103500 - typedef boost::fusion::map< - boost::fusion::pair<OutboundPath, OutboundPathHolder_T*> - > ChildrenHolderMap_T; -#else // BOOST_VERSION >= 103500 - typedef boost::mpl::map< > ChildrenHolderMap_T; -#endif // BOOST_VERSION >= 103500 - // ////////////////////////////////////////////////////////////////// - - public: - // /////////// Getters ///////////// - /** Get a list or map of a children type for iteration methods. */ - OutboundPathList_T getOutboundPathList () const; - OutboundPathMultimap_T getOutboundPathMultimap () const; - - /** Get the OutboundPathListList. */ - const OutboundPathListList_T& getOutboundPathListList () const { - return _outboundPathListList; - } - - public: - // //////////// Business Methods ////////////// - /** Build the list of lists of outbound paths. **/ - void buildOutboundPathListList (stdair::OutboundPath&); - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - void fromStream (std::istream& ioIn); - - /** Get the serialised version of the Business Object. */ - std::string toString() const; - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const; - - protected: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Constructors. */ - AirportDate (const Key_T&, Structure_T&); - /** Destructor. */ - ~AirportDate(); - /** Initialise all the pointers of children holder to NULL. */ - void init(); - /** Default constructors. */ - AirportDate (); - AirportDate (const AirportDate&); - - protected: - // Attributes - /** Reference structure. */ - Structure_T& _structure; - - /** The list of lists of OutboundPaths, used uniquement for the - construction of the main list of OutboundPaths in - AirportDateStructure. */ - OutboundPathListList_T _outboundPathListList; - - }; - -} -#endif // __STDAIR_BOM_AIRPORTDATE_HPP - Deleted: trunk/stdair/stdair/bom/AirportDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDateContent.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,21 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// STDAIR -#include <stdair/bom/AirportDateContent.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - AirportDateContent::AirportDateContent (const Key_T& iKey) \ - : _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - AirportDateContent::~AirportDateContent () { - } - -} - Deleted: trunk/stdair/stdair/bom/AirportDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateContent.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDateContent.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,66 +0,0 @@ -#ifndef __STDAIR_BOM_AIRPORTDATECONTENT_HPP -#define __STDAIR_BOM_AIRPORTDATECONTENT_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomContent.hpp> -#include <stdair/bom/AirportDateKey.hpp> - -namespace stdair { - - /** Class representing the actual attributes for an airport-date. */ - class AirportDateContent : public BomContent { - public: - // Type definitions. - /** Definition allowing to retrieve the associated BOM key type. */ - typedef AirportDateKey_T Key_T; - - public: - // /////////// Getters ///////////// - /** Get the airport-date key. */ - const Key_T& getKey() const { - return _key; - } - - /** Get the (origin) airport (part of the primary key). */ - const AirportCode_T& getOrigin() const { - return _key.getBoardingPoint(); - } - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - virtual void toStream (std::ostream& ioOut) const = 0; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - virtual void fromStream (std::istream& ioIn) = 0; - - /** Get the serialised version of the Business Object. */ - virtual std::string toString() const = 0; - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - - protected: - /** Default constructors. */ - AirportDateContent (const Key_T&); - AirportDateContent (const AirportDateContent&); - /** Destructor. */ - virtual ~AirportDateContent(); - - protected: - // Attributes - /** The key of both structure and content objects. */ - Key_T _key; - - }; - -} -#endif // __STDAIR_BOM_AIRPORTDATECONTENT_HPP - Deleted: trunk/stdair/stdair/bom/AirportDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDateKey.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,43 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/AirportDateKey.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - AirportDateKey_T::AirportDateKey_T () : _origin ("ZZZ") { - } - - // //////////////////////////////////////////////////////////////////// - AirportDateKey_T::AirportDateKey_T (const AirportCode_T& iAirportCode) - : _origin (iAirportCode) { - } - - // //////////////////////////////////////////////////////////////////// - AirportDateKey_T::AirportDateKey_T (const AirportDateKey_T& iKey) - : _origin (iKey._origin) { - } - - // //////////////////////////////////////////////////////////////////// - AirportDateKey_T::~AirportDateKey_T () { - } - - // //////////////////////////////////////////////////////////////////// - void AirportDateKey_T::toStream (std::ostream& ioOut) const { - ioOut << "AirportDateKey: " << toString() << std::endl; - } - - // //////////////////////////////////////////////////////////////////// - void AirportDateKey_T::fromStream (std::istream& ioIn) { - } - - // //////////////////////////////////////////////////////////////////// - const std::string AirportDateKey_T::toString() const { - std::ostringstream oStr; - oStr << _origin; - return oStr.str(); - } - -} Deleted: trunk/stdair/stdair/bom/AirportDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateKey.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDateKey.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,56 +0,0 @@ -#ifndef __STDAIR_BOM_AIRPORTDATEKEY_HPP -#define __STDAIR_BOM_AIRPORTDATEKEY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomKey.hpp> - -namespace stdair { - /** Key of airport-date. */ - struct AirportDateKey_T : public BomKey_T { - - private: - // /////////// Default constructor ////////// - AirportDateKey_T (); - - public: - // /////////// Construction /////////// - /** Constructors. */ - AirportDateKey_T (const AirportCode_T& iAirportCode); - AirportDateKey_T (const AirportDateKey_T&); - /** Destructor. */ - ~AirportDateKey_T (); - - // /////////// Getters ////////// - /** Get boarding airport. */ - const AirportCode_T& getBoardingPoint() const { - return _origin; - } - - // /////////// Display support methods ///////// - /** Dump a Business Object Key into an output stream. - @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const; - - /** Read a Business Object Key from an input stream. - @param istream& the input stream. */ - void fromStream (std::istream& ioIn); - - /** Get the serialised version of the Business Object Key. - <br>That string is unique, at the level of a given Business Object, - when among children of a given parent Business Object. - <br>For instance, "H" and "K" allow to differentiate among two - marketing classes for the same segment-date. */ - const std::string toString() const; - - private: - // Attributes - /** The boarding airport. */ - AirportCode_T _origin; - }; - -} - -#endif // __STDAIR_BOM_NETWORKDATEKEY_HPP Deleted: trunk/stdair/stdair/bom/AirportDateTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDateTypes.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/AirportDateTypes.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,34 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -#ifndef __STDAIR_BOM_AIRPORTDATETYPES_HPP -#define __STDAIR_BOM_AIRPORTDATETYPES_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <map> -#include <vector> - -namespace stdair { - - // Forward declarations. - template <typename CONTENT> class Structure; - template <typename CONTENT> class BomChildrenHolderImp; - template <typename BOM> struct BomList_T; - template <typename BOM> struct BomMap_T; - class AirportDate; - - /** Define the AirportDate structure. */ - typedef Structure<AirportDate> AirportDateStructure_T; - - /** Define the AirportDate holder. */ - typedef BomChildrenHolderImp<AirportDate> AirportDateHolder_T; - - /** Define the airport-date list. */ - typedef BomList_T<AirportDate> AirportDateList_T; - - /** Define the airport-date map. */ - typedef BomMap_T<AirportDate> AirportDateMap_T; -} -#endif // __STDAIR_BOM_AIRPORTDATETYPES_HPP - Modified: trunk/stdair/stdair/bom/BomManager.cpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/BomManager.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -25,19 +25,8 @@ // Call recursively the display() method on the children objects display (oStream, lCurrentInventory); - } + } - // Browse the Network objects - const NetworkList_T& lNetworkList= iBomRoot.getNetworkList (); - for (NetworkList_T::iterator itInv = lNetworkList.begin(); - itInv != lNetworkList.end(); ++itInv) { - const Network& lCurrentNetwork = *itInv; - - // Call recursively the display() method on the children objects - oStream << std::endl; - display (oStream, lCurrentNetwork); - } - // Reset formatting flags of the given output stream oStream.flags (oldFlags); } @@ -312,94 +301,6 @@ } // //////////////////////////////////////////////////////////////////// - void BomManager::display (std::ostream& oStream, - const Network& iNetwork) { - // Store current formatting flags of the given output stream - std::ios::fmtflags oldFlags = oStream.flags(); - - oStream << "Network: " << std::endl; - - int j = 1; - const NetworkDateList_T& lNetworkDateList = iNetwork.getNetworkDateList(); - for (NetworkDateList_T::iterator itNetworkDate = - lNetworkDateList.begin(); - itNetworkDate != lNetworkDateList.end(); ++itNetworkDate, ++j) { - const NetworkDate& lCurrentNetworkDate = *itNetworkDate; - - - // Call recursively the display() method on the children objects - display (oStream, lCurrentNetworkDate); - } - - // Reset formatting flags of the given output stream - oStream.flags (oldFlags); - } - - // //////////////////////////////////////////////////////////////////// - void BomManager::display (std::ostream& oStream, - const NetworkDate& iNetworkDate) { - // Store current formatting flags of the given output stream - std::ios::fmtflags oldFlags = oStream.flags(); - - oStream << iNetworkDate.describeKey() << std::endl; - - const AirportDateList_T& lAirportDateList= iNetworkDate.getAirportDateList(); - for (AirportDateList_T::iterator itAirportDate = lAirportDateList.begin(); - itAirportDate != lAirportDateList.end(); ++itAirportDate) { - const AirportDate& lCurrentAirportDate = *itAirportDate; - - // Call recursively the display() method on the children objects - display (oStream, lCurrentAirportDate); - } - - // Reset formatting flags of the given output stream - oStream.flags (oldFlags); - } - - // //////////////////////////////////////////////////////////////////// - void BomManager::display (std::ostream& oStream, - const AirportDate& iAirportDate) { - // Store current formatting flags of the given output stream - std::ios::fmtflags oldFlags = oStream.flags(); - - oStream << iAirportDate.describeKey() << std::endl; - - const OutboundPathList_T& lOutboundPathList = - iAirportDate.getOutboundPathList(); - for (OutboundPathList_T::iterator itPath = lOutboundPathList.begin(); - itPath != lOutboundPathList.end(); ++itPath) { - const OutboundPath& lCurrentOutboundPath = *itPath; - - // Call recursively the display() method on the children objects - display (oStream, lCurrentOutboundPath); - } - - // Reset formatting flags of the given output stream - oStream.flags (oldFlags); - } - - // //////////////////////////////////////////////////////////////////// - void BomManager::display (std::ostream& oStream, - const OutboundPath& iOutboundPath) { - // Store current formatting flags of the given output stream - std::ios::fmtflags oldFlags = oStream.flags(); - - oStream << iOutboundPath.describeKey() << std::endl; - - const SegmentDateList_T& lSegmentDateList = - iOutboundPath.getSegmentDateList(); - for (SegmentDateList_T::iterator itSegmentDate = lSegmentDateList.begin(); - itSegmentDate != lSegmentDateList.end(); ++itSegmentDate) { - const SegmentDate& lCurrentSegmentDate = *itSegmentDate; - - oStream << lCurrentSegmentDate.describeKey() << std::endl; - } - - // Reset formatting flags of the given output stream - oStream.flags (oldFlags); - } - - // //////////////////////////////////////////////////////////////////// void BomManager::csvDisplay (std::ostream& oStream, const BookingRequestStruct& iBookingRequest) { // Store current formatting flags of the given output stream Modified: trunk/stdair/stdair/bom/BomManager.hpp =================================================================== --- trunk/stdair/stdair/bom/BomManager.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/BomManager.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -23,10 +23,6 @@ class SegmentPathPeriod; class FlightPeriod; class SegmentPeriod; - class Network; - class NetworkDate; - class AirportDate; - class OutboundPath; struct BookingRequestStruct; /** Utility class for StdAir objects. */ @@ -100,34 +96,6 @@ the objects of the given BOM tree. @param std::ostream& Output stream in which the BOM tree should be logged/dumped. - @param const Network& Root of the BOM tree to be displayed. */ - static void display (std::ostream&, const Network&); - - /** Recursively display (dump in the underlying output log stream) - the objects of the given BOM tree. - @param std::ostream& Output stream in which the BOM tree should be - logged/dumped. - @param const NetworkDate& Root of the BOM tree to be displayed. */ - static void display (std::ostream&, const NetworkDate&); - - /** Recursively display (dump in the underlying output log stream) - the objects of the given BOM tree. - @param std::ostream& Output stream in which the BOM tree should be - logged/dumped. - @param const AirportDate& Root of the BOM tree to be displayed. */ - static void display (std::ostream&, const AirportDate&); - - /** Recursively display (dump in the underlying output log stream) - the objects of the given BOM tree. - @param std::ostream& Output stream in which the BOM tree should be - logged/dumped. - @param const OutboundPath& Root of the BOM tree to be displayed. */ - static void display (std::ostream&, const OutboundPath&); - - /** Recursively display (dump in the underlying output log stream) - the objects of the given BOM tree. - @param std::ostream& Output stream in which the BOM tree should be - logged/dumped. @param const LegCabin& Root of the BOM tree to be displayed. */ static void csvDisplay (std::ostream&, const BookingRequestStruct& iBookingRequest); Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -22,7 +22,6 @@ void BomRoot::init() { _structure.initChildrenHolder<Inventory>(); _structure.initChildrenHolder<ReachableUniverse>(); - _structure.initChildrenHolder<Network>(); _structure.initChildrenHolder<AirlineFeature>(); _structure.initChildrenHolder<DemandStream>(); _structure.initChildrenHolder<YieldStore>(); @@ -47,16 +46,6 @@ ReachableUniverseMap_T BomRoot::getReachableUniverseMap () const { return _structure.getChildrenHolder<ReachableUniverse>(); } - - // //////////////////////////////////////////////////////////////////// - NetworkList_T BomRoot::getNetworkList () const { - return _structure.getChildrenHolder<Network>(); - } - - // //////////////////////////////////////////////////////////////////// - NetworkMap_T BomRoot::getNetworkMap () const { - return _structure.getChildrenHolder<Network>(); - } // //////////////////////////////////////////////////////////////////// DemandStreamList_T BomRoot::getDemandStreamList () const { @@ -100,11 +89,6 @@ } // //////////////////////////////////////////////////////////////////// - Network* BomRoot::getNetwork (const NetworkID_T& iNetworkID) const { - return _structure.getChildPtr<Network> (iNetworkID); - } - - // //////////////////////////////////////////////////////////////////// YieldStore* BomRoot::getYieldStore (const AirlineCode_T& iAirlineCode) const { return _structure.getChildPtr<YieldStore> (iAirlineCode); } Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -16,7 +16,6 @@ #include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/ReachableUniverseTypes.hpp> -#include <stdair/bom/NetworkTypes.hpp> #include <stdair/bom/DemandStreamTypes.hpp> #include <stdair/bom/AirlineFeatureTypes.hpp> #include <stdair/bom/YieldStoreTypes.hpp> @@ -65,7 +64,6 @@ typedef boost::fusion::map< boost::fusion::pair<Inventory, InventoryHolder_T*>, boost::fusion::pair<ReachableUniverse, ReachableUniverseHolder_T*>, - boost::fusion::pair<Network, NetworkHolder_T*>, boost::fusion::pair<AirlineFeature, AirlineFeatureHolder_T*>, boost::fusion::pair<DemandStream, DemandStreamHolder_T*>, boost::fusion::pair<YieldStore, YieldStoreHolder_T*> @@ -82,8 +80,6 @@ InventoryMap_T getInventoryMap () const; ReachableUniverseList_T getReachableUniverseList () const; ReachableUniverseMap_T getReachableUniverseMap () const; - NetworkList_T getNetworkList () const; - NetworkMap_T getNetworkMap () const; DemandStreamList_T getDemandStreamList () const; DemandStreamMap_T getDemandStreamMap () const; AirlineFeatureList_T getAirlineFeatureList () const; @@ -101,11 +97,6 @@ <br>If not existing, return the NULL pointer. */ ReachableUniverse* getReachableUniverse (const AirportCode_T&) const; - /** Retrieve, if existing, the Network corresponding to the - given airline code (Network key). - <br>If not existing, return the NULL pointer. */ - Network* getNetwork (const NetworkID_T&) const; - /** Retrieve, if existing, the YieldStore corresponding to the given airline code (YieldStore key). <br>If not existing, return the NULL pointer. */ Modified: trunk/stdair/stdair/bom/BomSource.hpp =================================================================== --- trunk/stdair/stdair/bom/BomSource.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/BomSource.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -10,10 +10,6 @@ #include <stdair/bom/BomMultimap.hpp> #include <stdair/bom/BomList.hpp> #include <stdair/bom/BomRoot.hpp> -#include <stdair/bom/Network.hpp> -#include <stdair/bom/NetworkDate.hpp> -#include <stdair/bom/AirportDate.hpp> -#include <stdair/bom/OutboundPath.hpp> #include <stdair/bom/Inventory.hpp> #include <stdair/bom/FlightDate.hpp> #include <stdair/bom/SegmentDate.hpp> Modified: trunk/stdair/stdair/bom/BomTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/BomTypes.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/BomTypes.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -5,10 +5,6 @@ // Import section // ////////////////////////////////////////////////////////////////////// #include <stdair/bom/BomRootTypes.hpp> -#include <stdair/bom/NetworkTypes.hpp> -#include <stdair/bom/NetworkDateTypes.hpp> -#include <stdair/bom/AirportDateTypes.hpp> -#include <stdair/bom/OutboundPathTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/FlightDateTypes.hpp> #include <stdair/bom/SegmentDateTypes.hpp> Deleted: trunk/stdair/stdair/bom/Network.cpp =================================================================== --- trunk/stdair/stdair/bom/Network.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/Network.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,66 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// STDAIR -#include <stdair/bom/BomSource.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - Network::Network (const Key_T& iKey, - Structure_T& ioNetworkStructure) - : NetworkContent (iKey), _structure (ioNetworkStructure) { - init (); - } - - // //////////////////////////////////////////////////////////////////// - Network::~Network () { - } - - // //////////////////////////////////////////////////////////////////// - void Network::init () { - _structure.initChildrenHolder<NetworkDate>(); - } - - // //////////////////////////////////////////////////////////////////// - void Network::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // //////////////////////////////////////////////////////////////////// - void Network::fromStream (std::istream& ioIn) { - } - - // //////////////////////////////////////////////////////////////////// - std::string Network::toString() const { - std::ostringstream oStr; - oStr << _key.toString(); - return oStr.str(); - } - - // //////////////////////////////////////////////////////////////////// - const std::string Network::describeKey() const { - return _key.toString(); - } - - // //////////////////////////////////////////////////////////////////// - NetworkDateList_T Network::getNetworkDateList () const { - return _structure.getChildrenHolder<NetworkDate>(); - } - - // //////////////////////////////////////////////////////////////////// - NetworkDateMap_T Network::getNetworkDateMap () const { - return _structure.getChildrenHolder<NetworkDate>(); - } - - // //////////////////////////////////////////////////////////////////// - NetworkDate* Network::getNetworkDate (const Date_T& iDate) const { - std::ostringstream ostr; - ostr << iDate; - return _structure.getChildPtr<NetworkDate> (ostr.str()); - } - -} - Deleted: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/Network.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,104 +0,0 @@ -#ifndef __STDAIR_BOM_NETWORK_HPP -#define __STDAIR_BOM_NETWORK_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// Boost Fusion -#include <boost/version.hpp> -#if BOOST_VERSION >= 103500 -#include <boost/fusion/include/map.hpp> -#else // BOOST_VERSION >= 103500 -#include <boost/mpl/map.hpp> -#endif // BOOST_VERSION >= 103500 -// StdAir -#include <stdair/bom/NetworkContent.hpp> -#include <stdair/bom/NetworkTypes.hpp> -#include <stdair/bom/NetworkDateTypes.hpp> - -namespace stdair { - // Forward declarations - class BomRoot; - class NetworkDate; - - /** Class representing the actual functional/business content for - a network. */ - class Network : public NetworkContent { - friend class FacBomContent; - - public: - // ////////////////////////////////////////////////////////////////// - // See the explanations, within the BomRoot class, for all - // the types which require to be specified below - // ////////////////////////////////////////////////////////////////// - /** Definition allowing to retrieve the associated BOM structure type. */ - typedef NetworkStructure_T Structure_T; - - /** Definition allowing to retrieve the associated parent - BOM content type. */ - typedef BomRoot Parent_T; - - /** Definition allowing to retrieve the map/multimap type using by - BomChildrenHolder. */ - typedef std::map<const MapKey_T, const Structure_T*> Map_T; - - /** Define the list of children holder types. */ -#if BOOST_VERSION >= 103500 - typedef boost::fusion::map< - boost::fusion::pair<NetworkDate, NetworkDateHolder_T*> - > ChildrenHolderMap_T; -#else // BOOST_VERSION >= 103500 - typedef boost::mpl::map< > ChildrenHolderMap_T; -#endif // BOOST_VERSION >= 103500 - // ////////////////////////////////////////////////////////////////// - - public: - // /////////// Getters ///////////// - /** Get a list or map of a children type for iteration methods. */ - NetworkDateList_T getNetworkDateList () const; - NetworkDateMap_T getNetworkDateMap () const; - - /** Retrieve, if existing, the NetworkDate corresponding to the - given Date . - <br>If not existing, return the NULL pointer. */ - NetworkDate* getNetworkDate (const Date_T&) const; - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - void fromStream (std::istream& ioIn); - - /** Get the serialised version of the Business Object. */ - std::string toString() const; - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const; - - protected: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Constructors. */ - Network (const Key_T&, Structure_T&); - /** Destructor. */ - ~Network(); - /** Initialise all the pointers of children holder to NULL. */ - void init(); - /** Default constructors. */ - Network (); - Network (const Network&); - - protected: - // Attributes - /** Reference structure. */ - Structure_T& _structure; - }; - -} -#endif // __STDAIR_BOM_NETWORK_HPP - Deleted: trunk/stdair/stdair/bom/NetworkContent.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkContent.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,20 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// STDAIR -#include <stdair/bom/NetworkContent.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - NetworkContent::NetworkContent (const Key_T& iKey) : _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - NetworkContent::~NetworkContent () { - } - -} - Deleted: trunk/stdair/stdair/bom/NetworkContent.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkContent.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkContent.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,59 +0,0 @@ -#ifndef __STDAIR_BOM_NETWORKCONTENT_HPP -#define __STDAIR_BOM_NETWORKCONTENT_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomContent.hpp> -#include <stdair/bom/NetworkKey.hpp> - -namespace stdair { - - /** Class representing the actual attributes for an airline network. */ - class NetworkContent : public BomContent { - public : - // Type definitions - /** Definition allowing to retrieve the associated BOM key type. */ - typedef NetworkKey_T Key_T; - - public: - // ////////// Getters //////////// - /** Get the network key. */ - const Key_T& getKey() const { - return _key; - } - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - virtual void toStream (std::ostream& ioOut) const = 0; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - virtual void fromStream (std::istream& ioIn) = 0; - - /** Get the serialised version of the Business Object. */ - virtual std::string toString() const = 0; - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - protected: - /** Default constructors. */ - NetworkContent (const Key_T&); - NetworkContent (const NetworkContent&); - /** Destructor. */ - virtual ~NetworkContent(); - - protected: - // Attributes - /** The key of both structure and content objects. */ - Key_T _key; - }; - -} -#endif // __STDAIR_BOM_NETWORKCONTENT_HPP - Deleted: trunk/stdair/stdair/bom/NetworkDate.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkDate.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,66 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// STDAIR -#include <stdair/bom/BomSource.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - NetworkDate::NetworkDate (const Key_T& iKey, - Structure_T& ioNetworkDateStructure) - : NetworkDateContent (iKey), _structure (ioNetworkDateStructure) { - init (); - } - - // //////////////////////////////////////////////////////////////////// - NetworkDate::~NetworkDate () { - } - - // //////////////////////////////////////////////////////////////////// - void NetworkDate::init () { - _structure.initChildrenHolder<AirportDate>(); - } - - // //////////////////////////////////////////////////////////////////// - void NetworkDate::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // //////////////////////////////////////////////////////////////////// - void NetworkDate::fromStream (std::istream& ioIn) { - } - - // //////////////////////////////////////////////////////////////////// - std::string NetworkDate::toString() const { - std::ostringstream oStr; - oStr << _key.toString(); - return oStr.str(); - } - - // //////////////////////////////////////////////////////////////////// - const std::string NetworkDate::describeKey() const { - std::ostringstream oStr; - oStr << _structure.describeParentKey() << ", " << describeShortKey(); - return oStr.str(); - } - - // //////////////////////////////////////////////////////////////////// - AirportDateList_T NetworkDate::getAirportDateList () const { - return _structure.getChildrenHolder<AirportDate>(); - } - - // //////////////////////////////////////////////////////////////////// - AirportDateMap_T NetworkDate::getAirportDateMap () const { - return _structure.getChildrenHolder<AirportDate>(); - } - - // //////////////////////////////////////////////////////////////////// - AirportDate* NetworkDate::getAirportDate (const AirportCode_T& iCode) const { - return _structure.getChildPtr<AirportDate> (iCode); - } - -} - Deleted: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,105 +0,0 @@ -#ifndef __STDAIR_BOM_NETWORKDATE_HPP -#define __STDAIR_BOM_NETWORKDATE_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// Boost Fusion -#include <boost/version.hpp> -#if BOOST_VERSION >= 103500 -#include <boost/fusion/include/map.hpp> -#else // BOOST_VERSION >= 103500 -#include <boost/mpl/map.hpp> -#endif // BOOST_VERSION >= 103500 -// StdAir -#include <stdair/bom/NetworkDateContent.hpp> -#include <stdair/bom/NetworkDateTypes.hpp> -#include <stdair/bom/AirportDateTypes.hpp> - -namespace stdair { - // Forward declarations - class Network; - class AirportDate; - - /** Class representing the actual functional/business content for - a network-date. */ - class NetworkDate : public NetworkDateContent { - friend class FacBomContent; - - public: - // ////////////////////////////////////////////////////////////////// - // See the explanations, within the BomRoot class, for all - // the types which require to be specified below - // ////////////////////////////////////////////////////////////////// - /** Definition allowing to retrieve the associated BOM structure type. */ - typedef NetworkDateStructure_T Structure_T; - - /** Definition allowing to retrieve the associated parent - BOM content type. */ - typedef Network Parent_T; - - /** Definition allowing to retrieve the map/multimap type using by - BomChildrenHolder. */ - typedef std::map<const MapKey_T, const Structure_T*> Map_T; - - /** Define the list of children holder types. */ -#if BOOST_VERSION >= 103500 - typedef boost::fusion::map< - boost::fusion::pair<AirportDate, AirportDateHolder_T*> - > ChildrenHolderMap_T; -#else // BOOST_VERSION >= 103500 - typedef boost::mpl::map< > ChildrenHolderMap_T; -#endif // BOOST_VERSION >= 103500 - // ////////////////////////////////////////////////////////////////// - - public: - // /////////// Getters ///////////// - /** Get a list or map of a children type for iteration methods. */ - AirportDateList_T getAirportDateList () const; - AirportDateMap_T getAirportDateMap () const; - - /** Retrieve, if existing, the AirportDate corresponding to the - given airport-code. - <br>If not existing, return the NULL pointer. */ - AirportDate* getAirportDate (const AirportCode_T&) const; - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - void toStream (std::ostream& ioOut) const; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - void fromStream (std::istream& ioIn); - - /** Get the serialised version of the Business Object. */ - std::string toString() const; - - /** Get a string describing the whole key (differentiating two objects - at any level). */ - const std::string describeKey() const; - - protected: - /** Constructors are private so as to force the usage of the Factory - layer. */ - /** Constructors. */ - NetworkDate (const Key_T&, Structure_T&); - /** Destructor. */ - ~NetworkDate(); - /** Initialise all the pointers of children holder to NULL. */ - void init(); - /** Default constructors. */ - NetworkDate (); - NetworkDate (const NetworkDate&); - - protected: - // Attributes - /** Reference structure. */ - Structure_T& _structure; - - }; - -} -#endif // __STDAIR_BOM_NETWORKDATE_HPP - Deleted: trunk/stdair/stdair/bom/NetworkDateContent.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkDateContent.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,20 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STL -#include <cassert> -// STDAIR -#include <stdair/bom/NetworkDateContent.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - NetworkDateContent::NetworkDateContent (const Key_T& iKey) : _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - NetworkDateContent::~NetworkDateContent () { - } - -} - Deleted: trunk/stdair/stdair/bom/NetworkDateContent.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateContent.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkDateContent.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,59 +0,0 @@ -#ifndef __STDAIR_BOM_NETWORKDATECONTENT_HPP -#define __STDAIR_BOM_NETWORKDATECONTENT_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomContent.hpp> -#include <stdair/bom/NetworkDateKey.hpp> - -namespace stdair { - - /** Class representing the actual attributes for a network-date. */ - class NetworkDateContent : public BomContent { - public : - // Type definitions - /** Definition allowing to retrieve the associated BOM key type. */ - typedef NetworkDateKey_T Key_T; - - public: - // ////////// Getters //////////// - /** Get the network-date key. */ - const Key_T& getKey() const { - return _key; - } - - public: - // /////////// Display support methods ///////// - /** Dump a Business Object into an output stream. - @param ostream& the output stream. */ - virtual void toStream (std::ostream& ioOut) const = 0; - - /** Read a Business Object from an input stream. - @param istream& the input stream. */ - virtual void fromStream (std::istream& ioIn) = 0; - - /** Get the serialised version of the Business Object. */ - virtual std::string toString() const = 0; - - /** Get a string describing the short key (differentiating two objects - at the same level). */ - const std::string describeShortKey() const { return _key.toString(); } - - protected: - /** Default constructors. */ - NetworkDateContent (const Key_T&); - NetworkDateContent (const NetworkDateContent&); - /** Destructor. */ - virtual ~NetworkDateContent(); - - protected: - // Attributes - /** The key of both structure and content objects. */ - Key_T _key; - }; - -} -#endif // __STDAIR_BOM_NETWORKDATECONTENT_HPP - Deleted: trunk/stdair/stdair/bom/NetworkDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateKey.cpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkDateKey.cpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,44 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/NetworkDateKey.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - NetworkDateKey_T::NetworkDateKey_T () - : _referenceDate (Date_T (1970, 01, 01)) { - } - - // //////////////////////////////////////////////////////////////////// - NetworkDateKey_T::NetworkDateKey_T (const Date_T& iReferenceDate) - : _referenceDate (iReferenceDate) { - } - - // //////////////////////////////////////////////////////////////////// - NetworkDateKey_T::NetworkDateKey_T (const NetworkDateKey_T& iKey) - : _referenceDate (iKey._referenceDate) { - } - - // //////////////////////////////////////////////////////////////////// - NetworkDateKey_T::~NetworkDateKey_T () { - } - - // //////////////////////////////////////////////////////////////////// - void NetworkDateKey_T::toStream (std::ostream& ioOut) const { - ioOut << "NetworkDateKey: " << toString() << std::endl; - } - - // //////////////////////////////////////////////////////////////////// - void NetworkDateKey_T::fromStream (std::istream& ioIn) { - } - - // //////////////////////////////////////////////////////////////////// - const std::string NetworkDateKey_T::toString() const { - std::ostringstream oStr; - oStr << _referenceDate; - return oStr.str(); - } - -} Deleted: trunk/stdair/stdair/bom/NetworkDateKey.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDateKey.hpp 2010-07-07 14:07:43 UTC (rev 210) +++ trunk/stdair/stdair/bom/NetworkDateKey.hpp 2010-07-07 15:10:13 UTC (rev 211) @@ -1,61 +0,0 @@ -#ifndef __STDAIR_BOM_NETWORKDATEKEY_HPP -#define __STDAIR_BOM_NETWORKDATEKEY_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// STDAIR -#include <stdair/bom/BomKey.hpp> - -namespace stdair { - /** Key of network-date. */ - struct NetworkDateKey_T : public BomKey_T { - - private: - // /////////// Default constructor ////////// - NetworkDateKey_T (); - - public: - // /////////// Construction /////////// - /** Constructors. */ - NetworkDateKey_T (const Date_T& iReferenceDate); - NetworkDateKey_T (const NetworkDateKey_T&); - - /** Destructor. */ - ~NetworkDat... [truncated message content] |