From: <den...@us...> - 2010-06-27 14:27:17
|
Revision: 199 http://stdair.svn.sourceforge.net/stdair/?rev=199&view=rev Author: denis_arnaud Date: 2010-06-27 14:27:11 +0000 (Sun, 27 Jun 2010) Log Message: ----------- [Dev] Added pragma directives to support Boost versions lower than 1.35 (e.g., for RedHat/CentOS 5). Modified Paths: -------------- trunk/stdair/stdair/bom/AirlineFeature.hpp trunk/stdair/stdair/bom/BomRoot.hpp trunk/stdair/stdair/bom/Inventory.hpp trunk/stdair/stdair/bom/OutboundPath.hpp trunk/stdair/stdair/bom/Structure.hpp Modified: trunk/stdair/stdair/bom/AirlineFeature.hpp =================================================================== --- trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/AirlineFeature.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -5,7 +5,11 @@ // Import section // ////////////////////////////////////////////////////////////////////// // Boost Fusion +#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/AirlineFeatureContent.hpp> #include <stdair/bom/AirlineFeatureTypes.hpp> @@ -36,7 +40,11 @@ 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< > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/BomRoot.hpp =================================================================== --- trunk/stdair/stdair/bom/BomRoot.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/BomRoot.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#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/BomRootContent.hpp> #include <stdair/bom/BomRootTypes.hpp> #include <stdair/bom/InventoryTypes.hpp> @@ -53,6 +59,7 @@ 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<Inventory, InventoryHolder_T*>, boost::fusion::pair<Network, NetworkHolder_T*>, @@ -60,6 +67,9 @@ boost::fusion::pair<DemandStream, DemandStreamHolder_T*>, boost::fusion::pair<YieldStore, YieldStoreHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/Inventory.hpp =================================================================== --- trunk/stdair/stdair/bom/Inventory.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/Inventory.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -4,7 +4,13 @@ // ////////////////////////////////////////////////////////////////////// // Import section // ////////////////////////////////////////////////////////////////////// -// STDAIR +// Boost Fusion +#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/InventoryContent.hpp> #include <stdair/bom/InventoryTypes.hpp> #include <stdair/bom/FlightDateTypes.hpp> @@ -38,9 +44,13 @@ 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<FlightDate, FlightDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/OutboundPath.hpp =================================================================== --- trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/OutboundPath.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -5,7 +5,11 @@ // Import section // ////////////////////////////////////////////////////////////////////// // Boost Fusion +#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/OutboundPathContent.hpp> #include <stdair/bom/OutboundPathTypes.hpp> @@ -38,9 +42,13 @@ typedef std::multimap<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<SegmentDate, SegmentDateHolder_T*> > ChildrenHolderMap_T; +#else // BOOST_VERSION >= 103500 + typedef boost::mpl::map< > ChildrenHolderMap_T; +#endif // BOOST_VERSION >= 103500 // ////////////////////////////////////////////////////////////////// public: Modified: trunk/stdair/stdair/bom/Structure.hpp =================================================================== --- trunk/stdair/stdair/bom/Structure.hpp 2010-06-27 13:20:26 UTC (rev 198) +++ trunk/stdair/stdair/bom/Structure.hpp 2010-06-27 14:27:11 UTC (rev 199) @@ -6,9 +6,12 @@ // ////////////////////////////////////////////////////////////////////// // STL #include <cassert> -// BOOST Fusion +// Boost Fusion +#include <boost/version.hpp> +#if BOOST_VERSION >= 103500 #include <boost/fusion/include/map.hpp> #include <boost/fusion/sequence/intrinsic/at_key.hpp> +#endif // BOOST_VERSION >= 103500 // STDAIR #include <stdair/bom/BomStructure.hpp> @@ -64,8 +67,16 @@ /** The the holder which corresponds to the CHILD type. */ template <typename CHILD> BomChildrenHolderImp<CHILD>& getChildrenHolder () const { + +#if BOOST_VERSION >= 103500 BomChildrenHolderImp<CHILD>* lHolder_ptr = boost::fusion::at_key<CHILD> (_holderMap); + +#else // BOOST_VERSION >= 103500 + BomChildrenHolderImp<CHILD>* lHolder_ptr = NULL; + +#endif // BOOST_VERSION >= 103500 + assert (lHolder_ptr != NULL); return *lHolder_ptr; } @@ -77,9 +88,15 @@ CHILD* getChildPtr (const MapKey_T& iKey) const { CHILD* oContentChild_ptr = NULL; +#if BOOST_VERSION >= 103500 BomChildrenHolderImp<CHILD>* lHolder_ptr = boost::fusion::at_key<CHILD> (_holderMap); +#else // BOOST_VERSION >= 103500 + BomChildrenHolderImp<CHILD>* lHolder_ptr = NULL; + +#endif // BOOST_VERSION >= 103500 + if (lHolder_ptr != NULL) { // Look for the child in the map, then in the multimap BomMap_T<CHILD> lChildrenMap (*lHolder_ptr); @@ -116,9 +133,12 @@ /** Initialise the pointer of children holder to NULL. */ template <typename CHILD> void initChildrenHolder() { + +#if BOOST_VERSION >= 103500 BomChildrenHolderImp<CHILD>*& lHolder_ptr = boost::fusion::at_key<CHILD> (_holderMap); lHolder_ptr = NULL; +#endif // BOOST_VERSION >= 103500 } public: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |