comparison lib/swig/swigwin-2.0.11/Lib/lua/factory.i @ 1899:b3009adc0e2f

Adding swig, gitignore, hgignore
author Nomad
date Mon, 21 Oct 2013 10:42:27 +0200
parents
children
comparison
equal deleted inserted replaced
1867:eb580660bbbb 1899:b3009adc0e2f
1 /*
2 A modification of factory.swg from the generic UTL library.
3 */
4
5 %include <typemaps/swigmacros.swg>
6
7 %define %_factory_dispatch(Type)
8 if (!dcast) {
9 Type *dobj = dynamic_cast<Type *>($1);
10 if (dobj) {
11 dcast = 1;
12 SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++;
13 }
14 }%enddef
15
16 %define %factory(Method,Types...)
17 %typemap(out) Method {
18 int dcast = 0;
19 %formacro(%_factory_dispatch, Types)
20 if (!dcast) {
21 SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++;
22 }
23 }%enddef