PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
libpolybori
include
polybori
common
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
24
BEGIN_NAMESPACE_PBORI
25
27
template
<
class
ValueType>
28
class
CWeakPtr;
29
35
template
<
class
ValueType>
36
class
CWeakPtrFacade
{
38
typedef
CWeakPtrFacade
self
;
39
40
public
:
41
typedef
ValueType
value_type
;
42
typedef
value_type
*
data_type
;
43
typedef
boost::shared_ptr<data_type>
ptr_type
;
44
45
friend
class
CWeakPtr
<
value_type
>;
46
48
CWeakPtrFacade
():
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
:
59
ptr_type
m_data
;
60
};
61
62
END_NAMESPACE_PBORI
63
64
#endif
/* polybori_CWeakPtrFacade_h_ */
Generated by
1.8.3.1