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

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

#
Swig | 47 lines | 39 code | 8 blank | 0 comment | 0 complexity | 59887d1524df8250e0b1cfb08b5548ee MD5 | raw file
 1%module(directors="1") director_overload
 2
 3%feature("director");
 4
 5#ifdef SWIGPYTHON
 6%feature("director:except") {
 7  if ($error != NULL) {
 8    throw Swig::DirectorMethodException();
 9  }
10}
11#endif
12
13#ifdef SWIGRUBY
14// Catch ruby exceptions in directors
15%feature("director:except") {
16 throw Swig::DirectorMethodException($error);
17}
18#endif
19
20%inline %{
21
22class OverloadedClass
23{
24public:
25  virtual ~OverloadedClass() {}
26  virtual void method1() const {}
27  virtual void method2() const {}
28  virtual void method3() const {}
29  // test overloaded method, but not directly after the first method
30  virtual void method2(bool b) const {}
31};
32
33class OverloadedPointers
34{
35public:
36  virtual ~OverloadedPointers() {}
37  virtual void method(int *p) const {}
38  virtual void method(double *p) const {}
39  virtual void method(bool &r) const {}
40  virtual void method(short &r) const {}
41  virtual void method(OverloadedClass *p) const {}
42  virtual void method(OverloadedPointers *p) const {}
43  virtual void notover(int *p) const {}
44};
45
46%}
47