PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/director_wombat.i

#
Swig | 49 lines | 41 code | 8 blank | 0 comment | 0 complexity | cb5c6a2a3b6dbf17c7ce002a9ef50c19 MD5 | raw file
 1%module(directors="1") director_wombat
 2#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR
 3
 4%feature(director) Bar;
 5%feature(director) Foo<int>;
 6
 7%inline %{
 8template<typename T> class Foo
 9{
10public:
11                        Foo()
12                        { /* NOP */ }
13  virtual              ~Foo()
14                        { /* NOP */ }
15  virtual int           meth(T param)
16                        { return param; }
17};
18
19typedef Foo<int>        Foo_int;
20
21class Bar
22{
23public:
24  virtual              ~Bar();
25  virtual Foo_int      *meth();
26  virtual void          foo_meth_ref(Foo_int &, int);
27  virtual void          foo_meth_ptr(Foo_int *, int);
28  virtual void          foo_meth_val(Foo_int, int);
29  virtual void          foo_meth_cref(const Foo_int &, int);
30  virtual void          foo_meth_cptr(const Foo_int *, int);
31};
32
33Bar::~Bar()
34{ /* NOP */ }
35
36Foo_int *
37Bar::meth()
38{
39  return new Foo_int();
40}
41
42void Bar::foo_meth_ref(Foo_int &arg, int param) { }
43void Bar::foo_meth_ptr(Foo_int *arg, int param) { }
44void Bar::foo_meth_val(Foo_int arg, int param) { }
45void Bar::foo_meth_cref(const Foo_int &arg, int param) { }
46void Bar::foo_meth_cptr(const Foo_int *arg, int param) { }
47%}
48
49%template(Foo_integers) Foo<int>;