bbtkPimpl.h

Go to the documentation of this file.
00001 #ifndef __bbtkPimpl_h_INCLUDED__
00002 #define __bbtkPimpl_h_INCLUDED__
00003 
00004 
00012 #define BBTK_DECLARE_PIMPL(CLASS)                                     \
00013   private:                                                            \
00014   /* The Pimpl struct forward definition */                           \
00015   class Pimpl;                                                        \
00016   /* The Pimpl pointer */                                             \
00017   Pimpl* p;                                                           \
00018   /* Constructs the Pimpl (to be called in all Ctors) */              \
00019   void PimplConstruct();                                              \
00020   /* Copy constructs the Pimpl (to be called in copy Ctor) */         \
00021   void PimplCopyConstruct(const CLASS&);                              \
00022   /* Destructs the Pimpl (to be called in Dtor) */                    \
00023   void PimplDestruct();
00024 
00025 #endif
00026 
00028 #define BBTK_IMPL_PIMPL(CLASS)                                          \
00029   void CLASS::PimplConstruct()                                          \
00030   {                                                                     \
00031     p = new Pimpl;                                                      \
00032   }                                                                     \
00033   void CLASS::PimplCopyConstruct(const CLASS& o)                        \
00034   {                                                                     \
00035     p = new Pimpl(*(o.p));                                              \
00036   }                                                                     \
00037   void CLASS::PimplDestruct()                                           \
00038   {                                                                     \
00039     delete p;                                                           \
00040   }                                                                     
00041 
00042 

Generated on Mon Jul 27 14:59:14 2009 for BBTK by  doxygen 1.5.3