From: <den...@us...> - 2009-10-02 08:32:23
|
Revision: 9 http://stdair.svn.sourceforge.net/stdair/?rev=9&view=rev Author: denis_arnaud Date: 2009-10-02 08:32:09 +0000 (Fri, 02 Oct 2009) Log Message: ----------- [Dev] Imported the last updates from the stdair library embedded in the Air-Sched project. Modified Paths: -------------- trunk/stdair/doc/images/Makefile.am trunk/stdair/doc/local/stdair_header.html trunk/stdair/stdair/bom/BomIterator.hpp Removed Paths: ------------- trunk/stdair/stdair/bom/BomContentRoot.cpp trunk/stdair/stdair/bom/BomStructureRoot.cpp trunk/stdair/stdair/bom/BomStructureRootKey.cpp trunk/stdair/stdair/bom/FlightDate.cpp trunk/stdair/stdair/bom/FlightDateKey.cpp trunk/stdair/stdair/bom/Inventory.cpp trunk/stdair/stdair/bom/InventoryKey.cpp trunk/stdair/stdair/bom/LegDate.cpp trunk/stdair/stdair/bom/LegDateKey.cpp trunk/stdair/stdair/bom/PrintBomContent.cpp trunk/stdair/stdair/bom/PrintBomContent.hpp trunk/stdair/stdair/bom/SegmentDate.cpp trunk/stdair/stdair/bom/SegmentDateKey.cpp Modified: trunk/stdair/doc/images/Makefile.am =================================================================== --- trunk/stdair/doc/images/Makefile.am 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/doc/images/Makefile.am 2009-10-02 08:32:09 UTC (rev 9) @@ -1,3 +1,3 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = airsched_logo.png sfx_logo.png favicon.ico +EXTRA_DIST = stdair_logo.png sfx_logo.png favicon.ico Modified: trunk/stdair/doc/local/stdair_header.html =================================================================== --- trunk/stdair/doc/local/stdair_header.html 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/doc/local/stdair_header.html 2009-10-02 08:32:09 UTC (rev 9) @@ -11,7 +11,7 @@ <div style="width: 100%; height: 40px; background-color: #ffff00; border: 1px solid #b0b0b0; margin: 5px 5px 5px 0; padding: 2px;"> <a href="http://stdair.sourceforge.net"><img width="150" height="40" - src="airsched_logo.png" alt="StdAir Logo" + src="stdair_logo.png" alt="StdAir Logo" style="float: left; border: 0;"></a> <a href="http://www.sourceforge.net/projects/stdair"><img width="150" height="40" src="sfx_logo.png" alt="Sourceforge Logo" Deleted: trunk/stdair/stdair/bom/BomContentRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomContentRoot.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/BomContentRoot.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,70 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/BomStructureRoot.hpp> -#include <stdair/bom/BomContentRoot.hpp> -#include <stdair/bom/Inventory.hpp> -#include <stdair/bom/InventoryList.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - BomContentRoot::BomContentRoot (const BomStructure_T& iBomStructure) - : _bomStructure (iBomStructure) { - } - - // //////////////////////////////////////////////////////////////////// - BomContentRoot::~BomContentRoot () { - } - - // ////////////////////////////////////////////////////////////////////// - void BomContentRoot::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void BomContentRoot::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string BomContentRoot::toString() const { - std::ostringstream oStr; - - // First, put the key of that level - oStr << describeShortKey() << std::endl; - - // Retrieve the list of inventory holders - const InventoryList_T& lInventoryList = _bomStructure.getInventoryList(); - - // Browse the tree structure, i.e., the inventories - unsigned short idx = 0; - for (InventoryList_T::const_iterator itInventory = lInventoryList.begin(); - itInventory != lInventoryList.end(); ++itInventory, ++idx) { - const Inventory* lInventoryStructure_ptr = itInventory->second; - assert (lInventoryStructure_ptr != NULL); - - // Get the content out of the structure/holder - const Inventory& lInventory = - lInventoryStructure_ptr->getContent<Inventory>(); - - oStr << "[" << idx << "]: " << lInventory.toString() << std::endl; - } - - return oStr.str(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string BomContentRoot::describeKey() const { - return _bomStructure.describeKey(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string BomContentRoot::describeShortKey() const { - return _bomStructure.describeShortKey(); - } - -} - Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2009-10-02 08:32:09 UTC (rev 9) @@ -56,6 +56,21 @@ return _itBomStructureObject != iIt._itBomStructureObject; } + /** Relational operators. */ + bool operator< (const BomIteratorAbstract& iIt) { + return _itBomStructureObject < iIt._itBomStructureObject; + } + bool operator> (const BomIteratorAbstract& iIt) { + return _itBomStructureObject > iIt._itBomStructureObject; + } + bool operator<= (const BomIteratorAbstract& iIt) { + return _itBomStructureObject <= iIt._itBomStructureObject; + } + bool operator>= (const BomIteratorAbstract& iIt) { + return _itBomStructureObject >= iIt._itBomStructureObject; + } + + public: ///////////// Attributes ////////////// /** Iterator for the current BOM structure on the non-ordered list. */ @@ -74,8 +89,8 @@ const BomIteratorAbstract<ITERATOR>& r) { return l._itBomStructureObject - r._itBomStructureObject; } + - /** Template class aimed at iterating a list or a map of children BOM structure of a dedicated type using const iterators. <br> This class aimed at implementing the specific operators for @@ -169,6 +184,20 @@ value_type _intermediateValue; }; - + + /** + Operators for BomConstIterator_T that need to be implemented outside + of BomConstIterator_T scope. + */ + template<typename BOM_CONTENT, typename ITERATOR> + inline BomConstIterator_T<BOM_CONTENT, ITERATOR> + operator+(const typename ITERATOR::difference_type n, + const BomConstIterator_T<BOM_CONTENT, ITERATOR>& r) { + // Definition allowing to retrieve the Parent_T of BomConstIterator_T. + typedef typename BomConstIterator_T<BOM_CONTENT,ITERATOR>::Parent_T Parent_T; + return BomConstIterator_T<BOM_CONTENT, ITERATOR> + (n+r.Parent_T::_itBomStructureObject); + } + } #endif // __STDAIR_BOM_BOMITERATOR_T_HPP Deleted: trunk/stdair/stdair/bom/BomStructureRoot.cpp =================================================================== --- trunk/stdair/stdair/bom/BomStructureRoot.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/BomStructureRoot.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,45 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/BomStructureRoot.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - BomStructureRoot::BomStructureRoot (const BomKey_T& iKey) - : _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - BomStructureRoot::~BomStructureRoot () { - } - - // ////////////////////////////////////////////////////////////////////// - void BomStructureRoot::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void BomStructureRoot::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string BomStructureRoot::toString() const { - return describeKey(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string BomStructureRoot::describeKey() const { - return _key.toString(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string BomStructureRoot::describeShortKey() const { - return _key.toString(); - } - -} - Deleted: trunk/stdair/stdair/bom/BomStructureRootKey.cpp =================================================================== --- trunk/stdair/stdair/bom/BomStructureRootKey.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/BomStructureRootKey.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,27 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/BomStructureRootKey.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - void BomStructureRootKey::toStream (std::ostream& ioOut) const { - ioOut << "BomStructureRootKey: " << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void BomStructureRootKey::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string BomStructureRootKey::toString() const { - std::ostringstream oStr; - oStr << " -- ROOT -- "; - return oStr.str(); - } - -} Deleted: trunk/stdair/stdair/bom/FlightDate.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/FlightDate.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,51 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/FlightDate.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - FlightDate::FlightDate (const BomKey_T& iKey) - : _parent (NULL), _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - FlightDate::~FlightDate () { - } - - // ////////////////////////////////////////////////////////////////////// - FlightDate::ParentBomStructure_T& FlightDate::getInventory() const { - assert (_parent != NULL); - return *_parent; - } - - // ////////////////////////////////////////////////////////////////////// - void FlightDate::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void FlightDate::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string FlightDate::toString() const { - return describeKey(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string FlightDate::describeKey() const { - return _key.toString(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string FlightDate::describeShortKey() const { - return _key.toString(); - } - -} - Deleted: trunk/stdair/stdair/bom/FlightDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/FlightDateKey.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/FlightDateKey.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,27 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/FlightDateKey.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - void FlightDateKey::toStream (std::ostream& ioOut) const { - ioOut << "FlightDateKey: " << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void FlightDateKey::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string FlightDateKey::toString() const { - std::ostringstream oStr; - oStr << _flightNumber << ", " << _flightDate; - return oStr.str(); - } - -} Deleted: trunk/stdair/stdair/bom/Inventory.cpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/Inventory.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,51 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/Inventory.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - Inventory::Inventory (const BomKey_T& iKey) - : _parent (NULL), _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - Inventory::~Inventory () { - } - - // ////////////////////////////////////////////////////////////////////// - Inventory::ParentBomStructure_T& Inventory::getBomStructureRoot() const { - assert (_parent != NULL); - return *_parent; - } - - // ////////////////////////////////////////////////////////////////////// - void Inventory::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void Inventory::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string Inventory::toString() const { - return describeKey(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string Inventory::describeKey() const { - return _key.toString(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string Inventory::describeShortKey() const { - return _key.toString(); - } - -} - Deleted: trunk/stdair/stdair/bom/InventoryKey.cpp =================================================================== --- trunk/stdair/stdair/bom/InventoryKey.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/InventoryKey.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,27 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/InventoryKey.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - void InventoryKey::toStream (std::ostream& ioOut) const { - ioOut << "InventoryKey: " << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void InventoryKey::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string InventoryKey::toString() const { - std::ostringstream oStr; - oStr << _airlineCode; - return oStr.str(); - } - -} Deleted: trunk/stdair/stdair/bom/LegDate.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/LegDate.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,51 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/LegDate.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - LegDate::LegDate (const BomKey_T& iKey) - : _parent (NULL), _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - LegDate::~LegDate () { - } - - // ////////////////////////////////////////////////////////////////////// - LegDate::ParentBomStructure_T& LegDate::getFlightDate() const { - assert (_parent != NULL); - return *_parent; - } - - // ////////////////////////////////////////////////////////////////////// - void LegDate::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void LegDate::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string LegDate::toString() const { - return describeKey(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string LegDate::describeKey() const { - return _key.toString(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string LegDate::describeShortKey() const { - return _key.toString(); - } - -} - Deleted: trunk/stdair/stdair/bom/LegDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/LegDateKey.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/LegDateKey.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,27 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/LegDateKey.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - void LegDateKey::toStream (std::ostream& ioOut) const { - ioOut << "LegDateKey: " << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void LegDateKey::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string LegDateKey::toString() const { - std::ostringstream oStr; - oStr << _boardPoint; - return oStr.str(); - } - -} Deleted: trunk/stdair/stdair/bom/PrintBomContent.cpp =================================================================== --- trunk/stdair/stdair/bom/PrintBomContent.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/PrintBomContent.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,21 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STL -#include <iostream> -// STDAIR -#include <stdair/bom/SegmentDate.hpp> -#include <stdair/bom/PrintBomContent.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - PrintBomContent::PrintBomContent (std::ostringstream& ioStr, - unsigned short& idx) : - _str (&ioStr), _idx (&idx) { - } - -} - Deleted: trunk/stdair/stdair/bom/PrintBomContent.hpp =================================================================== --- trunk/stdair/stdair/bom/PrintBomContent.hpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/PrintBomContent.hpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,66 +0,0 @@ -#ifndef __STDAIR_BOM_PRINTBOMCONTENT_HPP -#define __STDAIR_BOM_PRINTBOMCONTENT_HPP - -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/BomStructureList.hpp> - -namespace stdair { - - /** . */ - struct PrintBomContent { - - public: - /** Dump a BomContent object into an output stream. */ - template <typename BOM_STRUCTURE, typename BOM_CONTENT> - void printBomContent (const BomStructureList_T::value_type& iIte) const { - std::ostringstream& str = getStringStream(); - unsigned short& idx = getIndex(); - - const BomStructure* lBomStructure_ptr = iIte.second; - - const BOM_STRUCTURE* lStructure_ptr = - dynamic_cast<const BOM_STRUCTURE*> (lBomStructure_ptr); - - if (lStructure_ptr != NULL) { - // Get the content out of the structure/holder - const BOM_CONTENT& lContent = - lStructure_ptr->BomStructure::getContent<BOM_CONTENT>(); - str << "[" << idx << "]: " << lContent.toString(); - ++idx; - } - } - - ////////////// Getters ///////////// - /** Get the stringstream. */ - std::ostringstream& getStringStream () const { - assert (_str != NULL); - return *_str; - } - - /** Get the index. */ - unsigned short& getIndex () const { - assert (_idx != NULL); - return *_idx; - } - - /** Constructors. */ - PrintBomContent (); - PrintBomContent (std::ostringstream&, unsigned short&); - - private: - ///////////// Attributes ////////////// - /** Output stream. */ - std::ostringstream* _str; - - /** Index of the object. */ - unsigned short* _idx; - }; - -} -#endif // __STDAIR_BOM_PRINTBOMCONTENT_HPP - Deleted: trunk/stdair/stdair/bom/SegmentDate.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/SegmentDate.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,51 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/SegmentDate.hpp> - -namespace stdair { - - // //////////////////////////////////////////////////////////////////// - SegmentDate::SegmentDate (const BomKey_T& iKey) - : _parent (NULL), _key (iKey) { - } - - // //////////////////////////////////////////////////////////////////// - SegmentDate::~SegmentDate () { - } - - // ////////////////////////////////////////////////////////////////////// - SegmentDate::ParentBomStructure_T& SegmentDate::getFlightDate() const { - assert (_parent != NULL); - return *_parent; - } - - // ////////////////////////////////////////////////////////////////////// - void SegmentDate::toStream (std::ostream& ioOut) const { - ioOut << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void SegmentDate::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string SegmentDate::toString() const { - return describeKey(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string SegmentDate::describeKey() const { - return _key.toString(); - } - - // ////////////////////////////////////////////////////////////////////// - const std::string SegmentDate::describeShortKey() const { - return _key.toString(); - } - -} - Deleted: trunk/stdair/stdair/bom/SegmentDateKey.cpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDateKey.cpp 2009-10-01 16:49:36 UTC (rev 8) +++ trunk/stdair/stdair/bom/SegmentDateKey.cpp 2009-10-02 08:32:09 UTC (rev 9) @@ -1,27 +0,0 @@ -// ////////////////////////////////////////////////////////////////////// -// Import section -// ////////////////////////////////////////////////////////////////////// -// C -#include <assert.h> -// STDAIR -#include <stdair/bom/SegmentDateKey.hpp> - -namespace stdair { - - // ////////////////////////////////////////////////////////////////////// - void SegmentDateKey::toStream (std::ostream& ioOut) const { - ioOut << "SegmentDateKey: " << toString() << std::endl; - } - - // ////////////////////////////////////////////////////////////////////// - void SegmentDateKey::fromStream (std::istream& ioIn) { - } - - // ////////////////////////////////////////////////////////////////////// - std::string SegmentDateKey::toString() const { - std::ostringstream oStr; - oStr << _boardPoint << "-" << _offPoint; - return oStr.str(); - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |