From: <qua...@us...> - 2010-06-08 09:07:46
|
Revision: 191 http://stdair.svn.sourceforge.net/stdair/?rev=191&view=rev Author: quannaus Date: 2010-06-08 09:07:39 +0000 (Tue, 08 Jun 2010) Log Message: ----------- [Dev] Add multimap into BomChildrenHolder. Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/AirportDate.cpp trunk/stdair/stdair/bom/AirportDate.hpp trunk/stdair/stdair/bom/BomChildrenHolder.hpp trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp trunk/stdair/stdair/bom/BomList.hpp trunk/stdair/stdair/bom/BomMap.hpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/BomSource.hpp trunk/stdair/stdair/bom/BookingClass.hpp trunk/stdair/stdair/bom/Bucket.hpp trunk/stdair/stdair/bom/DemandStream.hpp trunk/stdair/stdair/bom/FlightDate.hpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/LegCabin.hpp trunk/stdair/stdair/bom/LegDate.hpp trunk/stdair/stdair/bom/Network.hpp trunk/stdair/stdair/bom/NetworkDate.hpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/OutboundPathTypes.hpp trunk/stdair/stdair/bom/SegmentCabin.hpp trunk/stdair/stdair/bom/SegmentDate.hpp trunk/stdair/stdair/bom/Structure.hpp trunk/stdair/stdair/bom/YieldStore.hpp trunk/stdair/stdair/bom/sources.mk trunk/stdair/stdair/factory/FacBomContent.hpp trunk/stdair/stdair/factory/FacBomStructure.hpp Added Paths: ----------- trunk/stdair/stdair/bom/BomMultimap.hpp Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -29,6 +29,10 @@ 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. */ typedef boost::fusion::map< > ChildrenHolderMap_T; // ////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/AirportDate.cpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.cpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/AirportDate.cpp 2010-06-08 09:07:39 UTC (rev 191) @@ -54,7 +54,7 @@ } // //////////////////////////////////////////////////////////////////// - OutboundPathMap_T AirportDate::getOutboundPathMap () const { + OutboundPathMultimap_T AirportDate::getOutboundPathMultimap () const { return _structure.getChildrenHolder<OutboundPath>(); } Modified: trunk/stdair/stdair/bom/AirportDate.hpp =================================================================== --- trunk/stdair/stdair/bom/AirportDate.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/AirportDate.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -31,6 +31,10 @@ 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. */ typedef boost::fusion::map< boost::fusion::pair<OutboundPath, OutboundPathHolder_T*> @@ -41,7 +45,7 @@ // /////////// Getters ///////////// /** Get a list or map of a children type for iteration methods. */ OutboundPathList_T getOutboundPathList () const; - OutboundPathMap_T getOutboundPathMap () const; + OutboundPathMultimap_T getOutboundPathMultimap () const; /** Get the OutboundPathListList. */ const OutboundPathListList_T& getOutboundPathListList () const { Modified: trunk/stdair/stdair/bom/BomChildrenHolder.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolder.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BomChildrenHolder.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -47,7 +47,6 @@ /** Default constructors. */ BomChildrenHolder () { } BomChildrenHolder (const BomChildrenHolder&); - /** Destructor. */ ~BomChildrenHolder() { } Modified: trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp =================================================================== --- trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BomChildrenHolderImp.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -27,7 +27,8 @@ public: /** Define lists of children BOM structures. */ typedef std::vector<const Structure_T*> BomChildrenList_T; - typedef std::map<const std::string, const Structure_T*> BomChildrenMap_T; + /** Retrieve the map type of children BOM structures. */ + typedef typename CONTENT::Map_T BomChildrenMap_T; /** Define the different types of iterators. */ typedef BomIterator_T<CONTENT, @@ -115,18 +116,44 @@ MapReverseIterator_T mapREnd () const { return _bomChildrenMap.rend(); } - // /////////// Other operators ///////////// /** Get the size of the list. */ const unsigned int size () const { - return _bomChildrenMap.size(); + return _bomChildrenList.size(); } /** Retrieve, if existing, the bom corresponding to the given key. */ MapIterator_T find (const MapKey_T& iKey) const { return _bomChildrenMap.find (iKey); } + + private: + /** Insert an element to the list and the map. */ + const bool insert (const MapKey_T& iKey, const Structure_T& iStructure) { + const bool hasInsertionSuccessful = insert (iKey, iStructure, + _bomChildrenMap); + if (hasInsertionSuccessful == true) { + _bomChildrenList.push_back (&iStructure); + } + + return hasInsertionSuccessful; + } + + /** Internal insertion function into a map. */ + const bool insert (const MapKey_T& iKey, const Structure_T& iStructure, + std::map<const MapKey_T, const Structure_T*>& ioMap) { + return ioMap.insert (typename std::map<const MapKey_T,const Structure_T*>:: + value_type (iKey, &iStructure)).second; + } + + /** Internal insertion function into a multimap. */ + const bool insert (const MapKey_T& iKey, const Structure_T& iStructure, + std::multimap<const MapKey_T, const Structure_T*>& ioMap){ + ioMap.insert (typename std::multimap<const MapKey_T, const Structure_T*>:: + value_type (iKey, &iStructure)); + return true; + } private: /** Constructors are private so as to force the usage of the Factory @@ -140,10 +167,10 @@ private: ///////////// Attributes ////////////// /** List of children BOM structures. */ - BomChildrenMap_T _bomChildrenMap; + BomChildrenList_T _bomChildrenList; /** Map of children BOM structures with their key. */ - BomChildrenList_T _bomChildrenList; + BomChildrenMap_T _bomChildrenMap; }; } Modified: trunk/stdair/stdair/bom/BomList.hpp =================================================================== --- trunk/stdair/stdair/bom/BomList.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BomList.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -61,7 +61,6 @@ BomList_T (); BomList_T (const BomList_T& iBomList) : _bomHolder (iBomList._bomHolder) { } BomList_T (const BomHolder_T& iBomHolder) : _bomHolder (iBomHolder) { } - /** Destructor. */ ~BomList_T() { } Modified: trunk/stdair/stdair/bom/BomMap.hpp =================================================================== --- trunk/stdair/stdair/bom/BomMap.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BomMap.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -57,14 +57,15 @@ /** Retrieve, if existing, the Inventory corresponding to the given key. */ - iterator find (const MapKey_T& iKey) const { return _bomHolder.find (iKey); } + iterator find (const MapKey_T& iKey) const { + return _bomHolder.find (iKey); + } public: /** Default constructors. */ BomMap_T (); BomMap_T (const BomMap_T& iBomMap) : _bomHolder (iBomMap._bomHolder) { } BomMap_T (const BomHolder_T& iBomHolder) : _bomHolder (iBomHolder) { } - /** Destructor. */ ~BomMap_T() { } Copied: trunk/stdair/stdair/bom/BomMultimap.hpp (from rev 190, trunk/stdair/stdair/bom/BomMap.hpp) =================================================================== --- trunk/stdair/stdair/bom/BomMultimap.hpp (rev 0) +++ trunk/stdair/stdair/bom/BomMultimap.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -0,0 +1,82 @@ +#ifndef __STDAIR_BOM_BOMMULTIMAP_HPP +#define __STDAIR_BOM_BOMMULTIMAP_HPP + +// ////////////////////////////////////////////////////////////////////// +// Import section +// ////////////////////////////////////////////////////////////////////// +// STL +#include <map> + +namespace stdair { + + // Forward declarations + template <typename BOM_CONTENT, typename ITERATOR> struct BomIterator_T; + template <typename BOM_CONTENT> class BomChildrenHolderImp; + + /** Structure which handles the iterators for a bom multimap. */ + template <typename BOM> struct BomMultimap_T { + + public: + /** Definition that allows to retrieve the corresponding Structure + associated to the BOM. */ + typedef typename BOM::Structure_T Structure_T; + /** Define the multimap of bom objects. */ + typedef std::multimap<const MapKey_T, + const Structure_T*> StructureMultimap_T; + /** Define the bom holder. */ + typedef BomChildrenHolderImp<BOM> BomHolder_T; + + // ///////////////////////////////////////////////////////////////////////// + // See the explanations, within the stdair::BomContentRoot class, for all + // the iterator types specified below + // ///////////////////////////////////////////////////////////////////////// + /** Define the bom multimap iterators. */ + typedef BomIterator_T<BOM, + typename StructureMultimap_T::const_iterator> iterator; + typedef BomIterator_T<BOM, + typename StructureMultimap_T::const_reverse_iterator + > reverse_iterator; + // ///////////////////////////////////////////////////////////////////////// + + public: + // /////////// Iteration methods ////////// + /** Initialise the internal iterator on flight date: + return the iterator at the begining of the multimap. */ + iterator begin () const { return _bomHolder.mapBegin(); } + + /** Initialise the internal iterator on flight date: + return the iterator at the end of the multimap. */ + iterator end () const { return _bomHolder.mapEnd(); } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the rbegining of the multimap. */ + reverse_iterator rbegin () const { return _bomHolder.mapRBegin(); } + + /** Initialise the internal reverse iterator on flight date: + return the reverse iterator at the end of the multimap. */ + reverse_iterator rend () const { return _bomHolder.mapREnd(); } + + /** Retrieve, if existing, the Inventory corresponding to the + given key. */ + iterator find (const MapKey_T& iKey) const { + return _bomHolder.find (iKey); + } + + public: + /** Default constructors. */ + BomMultimap_T (); + BomMultimap_T (const BomMultimap_T& iBomMultimap) + : _bomHolder (iBomMultimap._bomHolder) { } + BomMultimap_T (const BomHolder_T& iBomHolder) : _bomHolder (iBomHolder) { } + /** Destructor. */ + ~BomMultimap_T() { } + + private: + // Attributes + /** Reference structure. */ + const BomHolder_T& _bomHolder; + }; + +} +#endif // __STDAIR_BOM_BOMMULTIMULTIMAP_HPP + Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -29,6 +29,8 @@ the stdair namespace</li> <li>Parent_T: Type corresponding to the parent BOM class within that namespace (e.g., AIRSCHED here)</li> + <li>Map_T: Type corresponding to the map/multimap type using by the + corresponding BomChildrenHolder <li>ChildrenHolderMap_T: The map between the type of children and a pointer to the bom holder of this type (e.g., AIRSCHED here). All the pointers to the bom holder should be initialised to @@ -46,6 +48,10 @@ /** Definition allowing to retrieve the parent 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. */ typedef boost::fusion::map< boost::fusion::pair<Inventory, InventoryHolder_T*>, Modified: trunk/stdair/stdair/bom/BomSource.hpp =================================================================== --- trunk/stdair/stdair/bom/BomSource.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BomSource.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -7,6 +7,7 @@ #include <stdair/bom/Structure.hpp> #include <stdair/bom/BomChildrenHolderImp.hpp> #include <stdair/bom/BomMap.hpp> +#include <stdair/bom/BomMultimap.hpp> #include <stdair/bom/BomList.hpp> #include <stdair/bom/BomRoot.hpp> #include <stdair/bom/Network.hpp> Modified: trunk/stdair/stdair/bom/BookingClass.hpp =================================================================== --- trunk/stdair/stdair/bom/BookingClass.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/BookingClass.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -29,6 +29,10 @@ BOM content type. */ typedef SegmentCabin 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. */ typedef boost::fusion::map< > ChildrenHolderMap_T; // ////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/Bucket.hpp =================================================================== --- trunk/stdair/stdair/bom/Bucket.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/Bucket.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -27,6 +27,10 @@ /** Definition allowing to retrieve the associated parent. */ typedef LegCabin 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. */ typedef boost::fusion::map< > ChildrenHolderMap_T; Modified: trunk/stdair/stdair/bom/DemandStream.hpp =================================================================== --- trunk/stdair/stdair/bom/DemandStream.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/DemandStream.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -28,6 +28,10 @@ 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. */ typedef boost::fusion::map< > ChildrenHolderMap_T; // ////////////////////////////////////////////////////////////////// Modified: trunk/stdair/stdair/bom/FlightDate.hpp =================================================================== --- trunk/stdair/stdair/bom/FlightDate.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/FlightDate.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -35,6 +35,10 @@ BOM content type. */ typedef Inventory 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. */ typedef boost::fusion::map< boost::fusion::pair<LegDate, LegDateHolder_T*>, Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/Inventory.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -33,6 +33,10 @@ 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. */ typedef boost::fusion::map< boost::fusion::pair<FlightDate, FlightDateHolder_T*> Modified: trunk/stdair/stdair/bom/LegCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/LegCabin.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/LegCabin.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -33,6 +33,10 @@ BOM content type. */ typedef LegDate 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. */ typedef boost::fusion::map< boost::fusion::pair<Bucket, BucketHolder_T*>, Modified: trunk/stdair/stdair/bom/LegDate.hpp =================================================================== --- trunk/stdair/stdair/bom/LegDate.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/LegDate.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -33,6 +33,10 @@ BOM content type. */ typedef FlightDate 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. */ typedef boost::fusion::map< boost::fusion::pair<LegCabin, LegCabinHolder_T*>, Modified: trunk/stdair/stdair/bom/Network.hpp =================================================================== --- trunk/stdair/stdair/bom/Network.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/Network.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -31,6 +31,10 @@ 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. */ typedef boost::fusion::map< boost::fusion::pair<NetworkDate, NetworkDateHolder_T*> Modified: trunk/stdair/stdair/bom/NetworkDate.hpp =================================================================== --- trunk/stdair/stdair/bom/NetworkDate.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/NetworkDate.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -31,6 +31,10 @@ 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. */ typedef boost::fusion::map< boost::fusion::pair<AirportDate, AirportDateHolder_T*> Modified: trunk/stdair/stdair/bom/OutboundPath.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -31,6 +31,10 @@ BOM content type. */ typedef AirportDate Parent_T; + /** Definition allowing to retrieve the map/multimap type using by + BomChildrenHolder. */ + typedef std::multimap<const MapKey_T, const Structure_T*> Map_T; + /** Define the list of children holder types. */ typedef boost::fusion::map< boost::fusion::pair<SegmentDate, SegmentDateHolder_T*> Modified: trunk/stdair/stdair/bom/OutboundPathTypes.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPathTypes.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/OutboundPathTypes.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -15,7 +15,7 @@ template <typename CONTENT> class Structure; template <typename CONTENT> class BomChildrenHolderImp; template <typename BOM> struct BomList_T; - template <typename BOM> struct BomMap_T; + template <typename BOM> struct BomMultimap_T; class OutboundPath; /** Define the outbound path structure. */ @@ -28,7 +28,7 @@ typedef BomList_T<OutboundPath> OutboundPathList_T; /** Define the outbound path map. */ - typedef BomMap_T<OutboundPath> OutboundPathMap_T; + typedef BomMultimap_T<OutboundPath> OutboundPathMultimap_T; typedef std::vector<std::vector<stdair::OutboundPath*> >OutboundPathListList_T; typedef std::vector<stdair::OutboundPath*> OutboundPathLightList_T; Modified: trunk/stdair/stdair/bom/SegmentCabin.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/SegmentCabin.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -33,6 +33,10 @@ BOM content type. */ typedef SegmentDate 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. */ typedef boost::fusion::map< boost::fusion::pair<BookingClass, BookingClassHolder_T*>, Modified: trunk/stdair/stdair/bom/SegmentDate.hpp =================================================================== --- trunk/stdair/stdair/bom/SegmentDate.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/SegmentDate.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -33,6 +33,10 @@ BOM content type. */ typedef FlightDate 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. */ typedef boost::fusion::map< boost::fusion::pair<SegmentCabin, SegmentCabinHolder_T*>, Modified: trunk/stdair/stdair/bom/Structure.hpp =================================================================== --- trunk/stdair/stdair/bom/Structure.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/Structure.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -16,6 +16,7 @@ // Forward declarations. template <typename CONTENT> class BomChildrenHolderImp; template <typename CONTENT> class BomMap_T; + template <typename CONTENT> class BomMultimap_T; template <typename CONTENT> class BomList_T; /** Wrapper class aimed at holding the actual content, modeled @@ -80,9 +81,10 @@ boost::fusion::at_key<CHILD> (_holderMap); if (lHolder_ptr != NULL) { + // Look for the child in the map, then in the multimap BomMap_T<CHILD> lChildrenMap (*lHolder_ptr); typename BomMap_T<CHILD>::iterator itContentChild = - lChildrenMap.find (iKey); + lChildrenMap.find (iKey); if (itContentChild != lChildrenMap.end()) { oContentChild_ptr = itContentChild->second; } @@ -95,15 +97,17 @@ template <typename CHILD> CHILD& getChild (const MapKey_T& iKey) const { CHILD* lChild_ptr = NULL; - - BomMap_T<CHILD> lChildrenMap (getChildrenHolder<CHILD>()); + const BomChildrenHolderImp<CHILD>& lHolder = getChildrenHolder<CHILD>(); + BomMap_T<CHILD> lChildrenMap (lHolder); + typename BomMap_T<CHILD>::iterator itContentChild = lChildrenMap.find (iKey); if (itContentChild != lChildrenMap.end()) { lChild_ptr = itContentChild->second; } + assert (lChild_ptr != NULL); return *lChild_ptr; } Modified: trunk/stdair/stdair/bom/YieldStore.hpp =================================================================== --- trunk/stdair/stdair/bom/YieldStore.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/YieldStore.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -28,6 +28,10 @@ /** Definition allowing to retrieve the associated parent. */ 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. */ typedef boost::fusion::map< > ChildrenHolderMap_T; Modified: trunk/stdair/stdair/bom/sources.mk =================================================================== --- trunk/stdair/stdair/bom/sources.mk 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/bom/sources.mk 2010-06-08 09:07:39 UTC (rev 191) @@ -10,6 +10,7 @@ $(top_srcdir)/stdair/bom/BomChildrenHolderImp.hpp \ $(top_srcdir)/stdair/bom/BomList.hpp \ $(top_srcdir)/stdair/bom/BomMap.hpp \ + $(top_srcdir)/stdair/bom/BomMultimap.hpp \ $(top_srcdir)/stdair/bom/BomIterator.hpp \ $(top_srcdir)/stdair/bom/BomRootKey.hpp \ $(top_srcdir)/stdair/bom/YieldStoreKey.hpp \ Modified: trunk/stdair/stdair/factory/FacBomContent.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomContent.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/factory/FacBomContent.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -68,9 +68,6 @@ ioChild._structure); if (hasLinkBeenSuccessful == false) { - std::cout << "link with parent" << std::endl; - std::cout << ioParent.describeKey() << std::endl; - std::cout << ioChild.describeShortKey() << std::endl; throw ObjectLinkingException(); } } @@ -173,7 +170,7 @@ <br>This constructor is protected to ensure the class is content. */ FacBomContent() {} /** Destructor. */ - virtual ~FacBomContent(); + ~FacBomContent(); /** Destroyed all the object instantiated by this factory. */ void clean(); Modified: trunk/stdair/stdair/factory/FacBomStructure.hpp =================================================================== --- trunk/stdair/stdair/factory/FacBomStructure.hpp 2010-05-26 13:13:51 UTC (rev 190) +++ trunk/stdair/stdair/factory/FacBomStructure.hpp 2010-06-08 09:07:39 UTC (rev 191) @@ -122,16 +122,9 @@ // Insert the structure object in the dedicated lists typedef typename HOLDER_T::BomChildrenMap_T BOM_MAP_T; - const bool hasInsertBeenSuccessful = ioHolder._bomChildrenMap. - insert (typename BOM_MAP_T::value_type (lKeyStr, &iStructure)).second; - - if (hasInsertBeenSuccessful == false) { - return hasInsertBeenSuccessful; - } - - ioHolder._bomChildrenList.push_back (&iStructure); - - return true; + const bool hasInsertBeenSuccessful = ioHolder.insert (lKeyStr, iStructure); + + return hasInsertBeenSuccessful; } // ////////////////////////////////////////////////////////////////// @@ -150,16 +143,9 @@ // Insert the structure object in the dedicated lists typedef typename HOLDER_T::BomChildrenMap_T BOM_MAP_T; - const bool hasInsertBeenSuccessful = ioHolder._bomChildrenMap. - insert (typename BOM_MAP_T::value_type (lKeyStr, &iStructure)).second; - - if (hasInsertBeenSuccessful == false) { - return hasInsertBeenSuccessful; - } - - ioHolder._bomChildrenList.push_back (&iStructure); - - return true; + const bool hasInsertBeenSuccessful = ioHolder.insert (lKeyStr, iStructure); + + return hasInsertBeenSuccessful; } // ////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |