File: multiple_inheritance_overload.i

package info (click to toggle)
swig 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 45,980 kB
  • sloc: cpp: 54,284; ansic: 29,022; java: 17,595; python: 12,734; cs: 10,421; ruby: 7,263; yacc: 6,501; makefile: 5,860; javascript: 5,538; sh: 5,422; perl: 4,246; php: 3,733; ml: 2,198; tcl: 2,015; lisp: 1,448; xml: 115
file content (67 lines) | stat: -rw-r--r-- 2,051 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%module(ruby_minherit="1") multiple_inheritance_overload

%warnfilter(SWIGWARN_D_MULTIPLE_INHERITANCE,
	    SWIGWARN_PHP_MULTIPLE_INHERITANCE); /* languages not supporting multiple inheritance */

#if defined(SWIGJAVA) || defined(SWIGCSHARP)
%include <swiginterface.i>
%interface_impl(Space::Base);
%interface_impl(Space::AnotherBase);
#endif

%ignore AnotherSpace::AnotherBase::AnotherMethod(int i) const;
%ignore Space::Base::Method(int i) const;
%ignore Space::Base::NotVirtualMethod(int i) const;
%ignore Space::Base::SimilarOverloadedMethod(unsigned short i);
%rename(MethodForRenamingConst) Space::Base::MethodForRenaming(int i) const;

// Different overloaded warning filters needed for scripting languages (eg Python) and for statically typed languages (eg C#).
%warnfilter(509, 516) Space::Base::MethodWarningSuppressed(int i) const;

%inline %{
namespace AnotherSpace {
class AnotherBase {
public:
  virtual int AnotherMethod(int i) { return 0; }
  virtual int AnotherMethod(int i) const { return 1; }
  virtual ~AnotherBase() {}
};
}

namespace Space {
class Base
{
public:
  virtual int Method(int i) { return 0; }
  virtual int Method(int i) const { return 1; }
  virtual int MethodForRenaming(int i) { return 0; }
  virtual int MethodForRenaming(int i) const { return 1; }
  virtual int MethodWarningSuppressed(int i) { return 0; }
  virtual int MethodWarningSuppressed(int i) const { return 1; }
  int NotVirtualMethod(int i) { return 0; }
  int NotVirtualMethod(int i) const { return 1; }

  typedef int Integer;

  // int and unsigned short are wrapped with a Java int and so would be automatically ignored with a warning
  virtual int SimilarOverloadedMethod(Integer i) { return 0; }
  virtual int SimilarOverloadedMethod(unsigned short i) { return 1; }
  virtual ~Base() {}
  static Base *in_out(Base *p) { return p; }
};

class Derived : public Base, public AnotherSpace::AnotherBase
{
public:
  int member_var;
};
class MoreDerived : public Derived {
};
}

namespace OtherSpace {
class OtherDerived : public Space::Base
{
};
}
%}