summaryrefslogtreecommitdiff
path: root/Examples/test-suite/director_ignore.i
blob: edb657320621f09b95ecd3412dca7dcd454e7b11 (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
%module(directors="1") director_ignore

%warnfilter(SWIGWARN_LANG_DIRECTOR_ABSTRACT) DIgnoreOnlyConstructor;

%include "std_string.i"

%feature("director");

%ignore OverloadedMethod(int n, int xoffset = 0, int yoffset = 0);
%ignore OverloadedProtectedMethod(int n, int xoffset = 0, int yoffset = 0);
%ignore DIgnoreConstructor(bool b);
%ignore DIgnoreOnlyConstructor(bool b);
%ignore DIgnoreDestructor::~DIgnoreDestructor;
%ignore Pointers;
%ignore References;
%ignore PublicMethod1;
%ignore PublicMethod2;
%ignore PublicPureVirtualMethod1;
%ignore PublicPureVirtualMethod2;
%ignore ProtectedMethod1;
%ignore ProtectedMethod2;
%ignore ProtectedPureVirtualMethod1;
%ignore ProtectedPureVirtualMethod2;

%typemap(imtype,
  inattributes="[inattributes should not be used]",
  outattributes="[outattributes should not be used]",
  directorinattributes="[directorinattributes should not be used]",
  directoroutattributes="[directoroutattributes should not be used]"
 ) int& "imtype should not be used"

%inline %{

#include <string>
class DIgnores
{
  public:
    virtual ~DIgnores() {}
    virtual void OverloadedMethod(int n, int xoffset = 0, int yoffset = 0) {}
    virtual void OverloadedMethod(bool b) {}
    virtual int Triple(int n) { return n*3; }
    virtual int& References(int& n) { static int nn; nn=n; return nn; }
    virtual int* Pointers(int* n) { static int nn; nn=*n; return &nn; }
    virtual double PublicMethod1() { return 0.0; }
    virtual double PublicPureVirtualMethod1() = 0;
    virtual void PublicMethod2() {}
    virtual void PublicPureVirtualMethod2() = 0;
    virtual void TempMethod() = 0;
  protected:
    virtual void OverloadedProtectedMethod(int n, int xoffset = 0, int yoffset = 0) {}
    virtual void OverloadedProtectedMethod() {}
    virtual double ProtectedMethod1() { return 0.0; }
    virtual double ProtectedPureVirtualMethod1() = 0;
    virtual void ProtectedMethod2() {}
    virtual void ProtectedPureVirtualMethod2() = 0;
};

class DAbstractIgnores
{
  public:
    virtual ~DAbstractIgnores() {}
    virtual double OverloadedMethod(int n, int xoffset = 0, int yoffset = 0) = 0;
    virtual double OverloadedMethod(bool b) = 0;
    virtual int Quadruple(int n) { return n*4; }
    virtual int& References(int& n) { static int nn; nn=n; return nn; }
    virtual int* Pointers(int* n) { static int nn; nn=*n; return &nn; }
  protected:
    virtual double OverloadedProtectedMethod(int n, int xoffset = 0, int yoffset = 0) = 0;
    virtual double OverloadedProtectedMethod() = 0;
};

template <typename T> class DTemplateAbstractIgnores
{
  T t;
  public:
    virtual ~DTemplateAbstractIgnores() {}
    virtual double OverloadedMethod(int n, int xoffset = 0, int yoffset = 0) = 0;
    virtual double OverloadedMethod(bool b) = 0;
    virtual int Quadruple(int n) { return n*4; }
    virtual int& References(int& n) { static int nn; nn=n; return nn; }
    virtual int* Pointers(int* n) { static int nn; nn=*n; return &nn; }
  protected:
    virtual double OverloadedProtectedMethod(int n, int xoffset = 0, int yoffset = 0) = 0;
    virtual double OverloadedProtectedMethod() = 0;
};
%}

%template(DTemplateAbstractIgnoresInt) DTemplateAbstractIgnores<int>;

class DIgnoreConstructor
{
  public:
    virtual ~DIgnoreConstructor() {}
    DIgnoreConstructor(std::string s, int i) {}
    DIgnoreConstructor(bool b) {}
};

class DIgnoreOnlyConstructor
{
  public:
    virtual ~DIgnoreOnlyConstructor() {}
    DIgnoreOnlyConstructor(bool b) {}
};

class DIgnoreDestructor
{
 public:
  DIgnoreDestructor() {}
  virtual ~DIgnoreDestructor() {}
};

%{
class DIgnoreConstructor
{
  public:
    virtual ~DIgnoreConstructor() {}
    DIgnoreConstructor(std::string s, int i) {}
  private: // Hide constructor
    DIgnoreConstructor(bool b) {}
};

class DIgnoreOnlyConstructor
{
  public:
    virtual ~DIgnoreOnlyConstructor() {}
  private: // Hide constructor
    DIgnoreOnlyConstructor(bool b) {}
};

class DIgnoreDestructor
{
 public:
  DIgnoreDestructor() {}
  virtual ~DIgnoreDestructor() {}
};

%}