From: <qua...@us...> - 2010-02-15 12:53:39
|
Revision: 136 http://stdair.svn.sourceforge.net/stdair/?rev=136&view=rev Author: quannaus Date: 2010-02-15 12:53:32 +0000 (Mon, 15 Feb 2010) Log Message: ----------- [dev] Some small changes. Modified Paths: -------------- trunk/stdair/stdair/STDAIR_Types.hpp trunk/stdair/stdair/basic/DemandCharacteristics.hpp trunk/stdair/stdair/bom/BomRoot.cpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/DemandStream.hpp trunk/stdair/stdair/bom/DemandStreamTypes.hpp trunk/stdair/stdair/bom/EventStruct.cpp trunk/stdair/stdair/bom/EventStruct.hpp trunk/stdair/stdair/command/CmdBomManager.cpp Modified: trunk/stdair/stdair/STDAIR_Types.hpp =================================================================== --- trunk/stdair/stdair/STDAIR_Types.hpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/STDAIR_Types.hpp 2010-02-15 12:53:32 UTC (rev 136) @@ -447,5 +447,8 @@ /** Real number */ typedef double RealNumber_T; + + /** Type definition for the hashed key of the DemandStreamKey object. */ + typedef std::string DemandStreamKeyStr_T; } #endif // __STDAIR_STDAIR_TYPES_HPP Modified: trunk/stdair/stdair/basic/DemandCharacteristics.hpp =================================================================== --- trunk/stdair/stdair/basic/DemandCharacteristics.hpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/basic/DemandCharacteristics.hpp 2010-02-15 12:53:32 UTC (rev 136) @@ -75,7 +75,7 @@ private: // //////////////////// Attributes ///////////////////// /** DemandStream Key */ - const DemandStreamKey_T& _key; + const DemandStreamKey_T _key; /** Arrival pattern (cumulative distribution of timing of arrival of requests (negative number of days between departure date Modified: trunk/stdair/stdair/bom/BomRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.cpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/bom/BomRoot.cpp 2010-02-15 12:53:32 UTC (rev 136) @@ -79,23 +79,13 @@ } // //////////////////////////////////////////////////////////////////// - DemandStreamList_T& BomRoot::getDemandStreamListRef() const { - // TODO: check that the Boost smart pointer is not NULL - STDAIR_LOG_ERROR ("!!!!TODO: check that the Boost smart pointer is not NULL!!!!"); - return *_demandStreamList; - } - - // //////////////////////////////////////////////////////////////////// void BomRoot::addDemandStream (const DemandStreamKeyStr_T& iKeyStr, DemandStream& ioDemandStream) { - // TODO: check that the Boost smart pointer is not NULL - STDAIR_LOG_ERROR ("!!!!TODO: check that the Boost smart pointer is not NULL!!!!"); - // Insert the reference on the given DemandStream object into the // dedicated list const bool hasInsertBeenSuccessfull = - _demandStreamList->insert (DemandStreamList_T:: - value_type (iKeyStr, &ioDemandStream)).second; + _demandStreamList.insert (DemandStreamList_T:: + value_type (iKeyStr, &ioDemandStream)).second; if (hasInsertBeenSuccessfull == false) { STDAIR_LOG_ERROR ("The DemandStream object with key: " << iKeyStr << " can not be inserted into the dedicated list"); Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-02-15 12:53:32 UTC (rev 136) @@ -122,13 +122,10 @@ AirlineFeatureSet& getAirlineFeatureSet() const; /** Get the reference of the list of DemandStream objects. */ - DemandStreamListPtr_T getDemandStreamList() const { - return _demandStreamList; + DemandStreamList_T& getDemandStreamList() { + return _demandStreamList; } - /** Get the reference of the list of DemandStream objects. */ - DemandStreamList_T& getDemandStreamListRef() const; - /** Retrieve, if existing, the Inventory corresponding to the given airline code (Inventory key). <br>If not existing, return the NULL pointer. */ @@ -147,11 +144,6 @@ _airlineFeatureSet = ioAirlineFeatureSet_ptr; } - /** Set the reference to the DemandStreamList object. */ - void setDemandStreamList (DemandStreamListPtr_T ioDemandStreamList_ptr) { - _demandStreamList = ioDemandStreamList_ptr; - } - /** Add a demand stream object to the dedicated list. @param const DemandStreamKeyStr_T& (String) Key of the DemandStream object to be added. @@ -183,7 +175,7 @@ AirlineFeatureSet* _airlineFeatureSet; /** Set of all DemandStream objects. */ - DemandStreamListPtr_T _demandStreamList; + DemandStreamList_T _demandStreamList; }; } Modified: trunk/stdair/stdair/bom/DemandStream.hpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.hpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/bom/DemandStream.hpp 2010-02-15 12:53:32 UTC (rev 136) @@ -18,6 +18,7 @@ #include <stdair/bom/BookingRequestTypes.hpp> #include <stdair/bom/DemandStreamKey.hpp> #include <stdair/bom/DemandStreamTypes.hpp> +#include <stdair/service/Logger.hpp> namespace stdair { Modified: trunk/stdair/stdair/bom/DemandStreamTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/DemandStreamTypes.hpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/bom/DemandStreamTypes.hpp 2010-02-15 12:53:32 UTC (rev 136) @@ -16,13 +16,9 @@ // Forward declaration class DemandStream; - /** Type definition for the hashed key of the DemandStreamKey object. */ - typedef std::string DemandStreamKeyStr_T; /** Define a map of demand strams. */ typedef std::map<const DemandStreamKeyStr_T, DemandStream*> DemandStreamList_T; - /** Type definition for a reference on a list of DemandStream objects. */ - typedef boost::shared_ptr<DemandStreamList_T> DemandStreamListPtr_T; } #endif // __STDAIR_BOM_DEMANDSTREAMTYPES_HPP Modified: trunk/stdair/stdair/bom/EventStruct.cpp =================================================================== --- trunk/stdair/stdair/bom/EventStruct.cpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/bom/EventStruct.cpp 2010-02-15 12:53:32 UTC (rev 136) @@ -11,7 +11,7 @@ // ////////////////////////////////////////////////////////////////////// EventStruct:: EventStruct(const EventType_T& iEventType, const DateTime_T& iDateTime, - const DemandStreamKey_T& iDemandStreamKey, + const DemandStreamKeyStr_T& iDemandStreamKey, BookingRequestPtr_T ioRequestPtr) : _eventType (iEventType), _eventDateTime (iDateTime), _demandStreamKey (iDemandStreamKey) { @@ -30,7 +30,7 @@ // ////////////////////////////////////////////////////////////////////// EventStruct::EventStruct (const DateTime_T& iDateTime) : _eventType (""), _eventDateTime (iDateTime), - _demandStreamKey ("", "", DEFAULT_DATE, PassengerType::LAST_VALUE) { + _demandStreamKey ("") { } // ////////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/EventStruct.hpp =================================================================== --- trunk/stdair/stdair/bom/EventStruct.hpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/bom/EventStruct.hpp 2010-02-15 12:53:32 UTC (rev 136) @@ -33,7 +33,7 @@ } /** Get the demand stream of the event. */ - const DemandStreamKey_T& getDemandStreamKey () const { + const DemandStreamKeyStr_T& getDemandStreamKey () const { return _demandStreamKey; } @@ -45,7 +45,7 @@ // ////////// Constructors and destructors ///////// /** Constructor. */ EventStruct (const EventType_T&, const DateTime_T&, - const DemandStreamKey_T&, BookingRequestPtr_T); + const DemandStreamKeyStr_T&, BookingRequestPtr_T); EventStruct (const DateTime_T&); /** Copy constructor. */ @@ -69,7 +69,7 @@ DateTime_T _eventDateTime; /** The demand stream which generated this event. */ - DemandStreamKey_T _demandStreamKey; + DemandStreamKeyStr_T _demandStreamKey; /** Pointer to Request event */ BookingRequestPtr_T _request; Modified: trunk/stdair/stdair/command/CmdBomManager.cpp =================================================================== --- trunk/stdair/stdair/command/CmdBomManager.cpp 2010-02-15 12:35:06 UTC (rev 135) +++ trunk/stdair/stdair/command/CmdBomManager.cpp 2010-02-15 12:53:32 UTC (rev 136) @@ -51,12 +51,6 @@ // ////////////////////////////////////////////////////////////////////// void CmdBomManager::initDemandStreamList (BomRoot& ioBomRoot) { - // Initialise the set of required airline features - DemandStreamListPtr_T lDemandStreamList_ptr = - boost::make_shared<DemandStreamList_T>(); - - // Set the AirlineFeatureSet for the BomRoot. - ioBomRoot.setDemandStreamList (lDemandStreamList_ptr); } // ////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |