Menu

[r13978]: / branches / gsoc2012-doxygen / Lib / lua / factory.i  Maximize  Restore  History

Download this file

24 lines (20 with data), 519 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
A modification of factory.swg from the generic UTL library.
*/
%include <typemaps/swigmacros.swg>
%define %_factory_dispatch(Type)
if (!dcast) {
Type *dobj = dynamic_cast<Type *>($1);
if (dobj) {
dcast = 1;
SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++;
}
}%enddef
%define %factory(Method,Types...)
%typemap(out) Method {
int dcast = 0;
%formacro(%_factory_dispatch, Types)
if (!dcast) {
SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++;
}
}%enddef
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.