PolyBoRi
CWeakPtrFacade.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_CWeakPtrFacade_h_
17 #define polybori_CWeakPtrFacade_h_
18 
19 // include basic definitions
20 #include <polybori/pbori_defs.h>
21 #include <boost/shared_ptr.hpp>
22 
23 
25 
27 template <class ValueType>
28 class CWeakPtr;
29 
35 template <class ValueType>
38  typedef CWeakPtrFacade self;
39 
40 public:
41  typedef ValueType value_type;
43  typedef boost::shared_ptr<data_type> ptr_type;
44 
45  friend class CWeakPtr<value_type>;
46 
49  m_data(new data_type(static_cast<data_type>(this))) {}
50 
52  CWeakPtrFacade(const self& rhs):
53  m_data(new data_type(static_cast<data_type>(this))) {}
54 
56  ~CWeakPtrFacade() { (*m_data) = NULL; }
57 
58 protected:
60 };
61 
63 
64 #endif /* polybori_CWeakPtrFacade_h_ */