annotate lib/swig/swigwin-2.0.11/Lib/intrusive_ptr.i @ 2409:b29880e9ee79

function prototypes
author Ritor1
date Mon, 14 Jul 2014 19:48:47 +0600
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 // Allow for different namespaces for shared_ptr / intrusive_ptr - they could be boost or std or std::tr1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 // For example for std::tr1, use:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 // #define SWIG_SHARED_PTR_NAMESPACE std
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 // #define SWIG_SHARED_PTR_SUBNAMESPACE tr1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 // #define SWIG_INTRUSIVE_PTR_NAMESPACE boost
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 // #define SWIG_INTRUSIVE_PTR_SUBNAMESPACE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 #if !defined(SWIG_INTRUSIVE_PTR_NAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 # define SWIG_INTRUSIVE_PTR_NAMESPACE boost
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 #if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 # define SWIG_INTRUSIVE_PTR_QNAMESPACE SWIG_INTRUSIVE_PTR_NAMESPACE::SWIG_INTRUSIVE_PTR_SUBNAMESPACE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 # define SWIG_INTRUSIVE_PTR_QNAMESPACE SWIG_INTRUSIVE_PTR_NAMESPACE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 namespace SWIG_INTRUSIVE_PTR_NAMESPACE {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 #if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 namespace SWIG_INTRUSIVE_PTR_SUBNAMESPACE {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 template <class T> class intrusive_ptr {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 #if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 %fragment("SWIG_intrusive_deleter", "header") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 template<class T> struct SWIG_intrusive_deleter {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 void operator()(T *p) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 if (p)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 intrusive_ptr_release(p);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 %fragment("SWIG_null_deleter", "header") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 struct SWIG_null_deleter {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 void operator() (void const *) const {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 %#define SWIG_NO_NULL_DELETER_0 , SWIG_null_deleter()
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 %#define SWIG_NO_NULL_DELETER_1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 // Workaround empty first macro argument bug
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 #define SWIGEMPTYHACK
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 // Main user macro for defining intrusive_ptr typemaps for both const and non-const pointer types
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 %define %intrusive_ptr(TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 %feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 SWIG_INTRUSIVE_PTR_TYPEMAPS(SWIGEMPTYHACK, TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 SWIG_INTRUSIVE_PTR_TYPEMAPS(const, TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 %define %intrusive_ptr_no_wrap(TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 %feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(SWIGEMPTYHACK, TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(const, TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 // Legacy macros
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 %define SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 #warning "SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE) is deprecated. Please use %intrusive_ptr(TYPE) instead."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 %intrusive_ptr(TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 %define SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 #warning "SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %intrusive_ptr(TYPE) instead."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 %intrusive_ptr(TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73 %define SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 #warning "SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE) is deprecated. Please use %intrusive_ptr_no_wrap(TYPE) instead."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 %intrusive_ptr_no_wrap(TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 %define SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 #warning "SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %intrusive_ptr_no_wrap(TYPE) instead."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 %intrusive_ptr_no_wrap(TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82