$treeview $search $mathjax
StdAir Logo  1.00.1
$projectbrief
$projectbrief
$searchbox

stdair/bom/Bucket.hpp

Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_BUCKET_HPP
00002 #define __STDAIR_BOM_BUCKET_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 // StdAir 
00011 #include <stdair/stdair_inventory_types.hpp>
00012 #include <stdair/bom/BomAbstract.hpp>
00013 #include <stdair/bom/BucketKey.hpp>
00014 #include <stdair/bom/BucketTypes.hpp>
00015 
00017 namespace boost {
00018   namespace serialization {
00019     class access;
00020   }
00021 }
00022 
00023 namespace stdair {
00024 
00029   class Bucket : public BomAbstract {
00030     template <typename BOM> friend class FacBom;    
00031     template <typename BOM> friend class FacCloneBom;
00032     friend class FacBomManager;
00033     friend class boost::serialization::access;
00034     
00035   public:
00036     // //////////////// Type definitions //////////////////
00040     typedef BucketKey Key_T;
00041 
00042   public:
00043     // /////////// Getters ////////////
00047     const Key_T& getKey() const {
00048       return _key;
00049     }
00050 
00054     BomAbstract* const getParent() const {
00055       return _parent;
00056     }
00057 
00059     const HolderMap_T& getHolderMap() const {
00060       return _holderMap;
00061     }
00062 
00064     const SeatIndex_T& getSeatIndex() const {
00065       return _key.getSeatIndex();
00066     }
00067 
00069     const Yield_T& getYieldRangeUpperValue() const {
00070       return _yieldRangeUpperValue;
00071     }
00072 
00074     const CabinCapacity_T& getAvailability() const {
00075       return _availability;
00076     }
00077 
00079     const NbOfSeats_T& getSoldSeats() const {
00080       return _soldSeats;
00081     }
00082 
00083 
00084     // /////////// Setters ////////////
00086     void setYieldRangeUpperValue (const Yield_T& iYield) {
00087       _yieldRangeUpperValue = iYield;
00088     }
00089 
00091     void setAvailability (const CabinCapacity_T& iAvl) {
00092       _availability = iAvl;
00093     }
00094 
00096     void setSoldSeats (const NbOfSeats_T& iSoldSeats) {
00097       _soldSeats = iSoldSeats;
00098     }
00099 
00100 
00101   public:
00102     // /////////// Display support methods /////////
00108     void toStream (std::ostream& ioOut) const {
00109       ioOut << toString();
00110     }
00111 
00117     void fromStream (std::istream& ioIn) {
00118     }
00119 
00123     std::string toString() const;
00124     
00128     const std::string describeKey() const {
00129       return _key.toString();
00130     }
00131     
00132 
00133   public:
00134     // /////////// (Boost) Serialisation support methods /////////
00138     template<class Archive>
00139     void serialize (Archive& ar, const unsigned int iFileVersion);
00140 
00141   private:
00146     void serialisationImplementationExport() const;
00147     void serialisationImplementationImport();
00148 
00149 
00150   protected:
00151     // ////////// Constructors and destructors /////////
00155     Bucket (const Key_T&);
00156 
00160     virtual ~Bucket();
00161 
00162   private:
00166     Bucket();
00167 
00171     Bucket (const Bucket&);
00172 
00173 
00174   protected:
00175     // //////////////////// Children ///////////////////
00179     Key_T _key;
00180 
00184     BomAbstract* _parent;
00185 
00189     HolderMap_T _holderMap;
00190 
00191 
00192   protected:
00193     // //////////////////// Attributes ///////////////////
00197     Yield_T _yieldRangeUpperValue;
00198 
00202     CabinCapacity_T _availability;
00203 
00207     NbOfSeats_T _soldSeats;
00208   };
00209 
00210 }
00211 #endif // __STDAIR_BOM_BUCKET_HPP
00212