annotate lib/swig/swigwin-2.0.11/Lib/shared_ptr.i @ 2327:5e4d90305d06

EventCastSpell removing duplicate code for handling empty pObjectList->pObjects array or not finding the correct value + moving everything into the main switch
author Grumpy7
date Tue, 01 Apr 2014 23:20:15 +0200
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 // This is a helper file for shared_ptr and should not be included directly.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 // The main implementation detail in using this smart pointer of a type is to customise the code generated
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 // to use a pointer to the smart pointer of the type, rather than the usual pointer to the underlying type.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 // So for some type T, shared_ptr<T> * is used rather than T *.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 // shared_ptr namespaces could be boost or std or std::tr1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 // For example for std::tr1, use:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 // #define SWIG_SHARED_PTR_NAMESPACE std
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 // #define SWIG_SHARED_PTR_SUBNAMESPACE tr1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 #if !defined(SWIG_SHARED_PTR_NAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 # define SWIG_SHARED_PTR_NAMESPACE boost
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 #if defined(SWIG_SHARED_PTR_SUBNAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 # define SWIG_SHARED_PTR_QNAMESPACE SWIG_SHARED_PTR_NAMESPACE::SWIG_SHARED_PTR_SUBNAMESPACE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 #else
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 # define SWIG_SHARED_PTR_QNAMESPACE SWIG_SHARED_PTR_NAMESPACE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 namespace SWIG_SHARED_PTR_NAMESPACE {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 #if defined(SWIG_SHARED_PTR_SUBNAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 namespace SWIG_SHARED_PTR_SUBNAMESPACE {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 template <class T> class shared_ptr {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 #if defined(SWIG_SHARED_PTR_SUBNAMESPACE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 #endif
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 %fragment("SWIG_null_deleter", "header") {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 struct SWIG_null_deleter {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 void operator() (void const *) const {
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 %#define SWIG_NO_NULL_DELETER_0 , SWIG_null_deleter()
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 %#define SWIG_NO_NULL_DELETER_1
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 %#define SWIG_NO_NULL_DELETER_SWIG_POINTER_NEW
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 %#define SWIG_NO_NULL_DELETER_SWIG_POINTER_OWN
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 // Workaround empty first macro argument bug
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 #define SWIGEMPTYHACK
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 // Main user macro for defining shared_ptr typemaps for both const and non-const pointer types
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 %define %shared_ptr(TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 %feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 SWIG_SHARED_PTR_TYPEMAPS(SWIGEMPTYHACK, TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 SWIG_SHARED_PTR_TYPEMAPS(const, TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 // Legacy macros
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 %define SWIG_SHARED_PTR(PROXYCLASS, TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 #warning "SWIG_SHARED_PTR(PROXYCLASS, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 %shared_ptr(TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 %define SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 #warning "SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead."
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 %shared_ptr(TYPE)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 %enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64