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

stdair/bom/BomID.hpp

Go to the documentation of this file.
00001 #ifndef __STDAIR_BOM_BOMID_HPP
00002 #define __STDAIR_BOM_BOMID_HPP
00003 
00004 // //////////////////////////////////////////////////////////////////////
00005 // Import section
00006 // //////////////////////////////////////////////////////////////////////
00007 // STL
00008 #include <iosfwd>
00009 #include <string>
00010 
00011 namespace stdair {
00012 
00016   template <typename BOM>
00017   struct BomID {
00018     
00019   public:
00020     // ////////// Getters ////////////
00024     BOM& getObject () const;
00025 
00026   public:
00027     // ////////// Constructors and destructors /////////
00031     BomID (BOM& iBOM);
00032     
00036     BomID (const BomID&);
00037 
00041     ~BomID();
00042 
00043   private:
00047     BomID();
00048 
00049   private:
00050     // /////////////// Attributes ////////////////
00054     BOM* _id;
00055   };
00056 
00057   // ////////////////////////////////////////////////////////////////////
00058   template <typename BOM> BomID<BOM>::BomID (BOM& iBOM): _id (&iBOM) { }
00059 
00060   // ////////////////////////////////////////////////////////////////////
00061   template <typename BOM> BomID<BOM>::BomID (const BomID& iBomID)
00062     : _id (iBomID._id) { }
00063 
00064   // ////////////////////////////////////////////////////////////////////
00065   template <typename BOM> BomID<BOM>::~BomID () { }
00066 
00067   // ////////////////////////////////////////////////////////////////////
00068   template <typename BOM> BOM& BomID<BOM>::getObject () const {
00069     assert (_id != NULL);
00070     return *_id;
00071   }
00072 }
00073 #endif // __STDAIR_BOM_BOMID_HPP