annotate lib/swig/swigwin-2.0.11/Lib/lua/factory.i @ 2353:bb9f180d50f6

Removing a few unsorted_subs includes
author Grumpy7
date Wed, 09 Apr 2014 21:58:09 +0200
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 /*
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 A modification of factory.swg from the generic UTL library.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 %include <typemaps/swigmacros.swg>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 %define %_factory_dispatch(Type)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 if (!dcast) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 Type *dobj = dynamic_cast<Type *>($1);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 if (dobj) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 dcast = 1;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 }%enddef
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 %define %factory(Method,Types...)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 %typemap(out) Method {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 int dcast = 0;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 %formacro(%_factory_dispatch, Types)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 if (!dcast) {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++;
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 }%enddef