summaryrefslogtreecommitdiff
path: root/Examples/test-suite/constructor_copy.i
blob: 8e92e7840b7ca8b7a9f8ad06077c98eea41b9299 (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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
%module constructor_copy

%copyctor;
%nocopyctor Foo8;
%nocopyctor Bar<double>;

%inline %{
  
struct Foo1 {
  int x;

  Foo1(int _x = 2) : x(_x)
  {
  }  
};

struct Foo2 {
  Foo2() { }
};

struct Foo3 {
  Foo3() { }
  Foo3(const Foo3& ) { }
};

struct Foo4 {
  Foo4() { }
  
protected:
  Foo4(const Foo4& ) { }
};


struct Foo4a {
  Foo4a() { }
  
private:
  Foo4a(const Foo4a& ) { }
};


struct Foo5 : Foo4 {
};

struct Foo6 : Foo4 {
  Foo6(const Foo6& f) : Foo4(f) { }
};

struct Foo7 : Foo5 {
};

struct Foo8 {
};

template <class T>
class Bar 
{
public:
  int x;

  Bar(int _x = 0) : x(_x)
  {
  }
};
%}

%template(Bari) Bar<int>;
%template(Bard) Bar<double>;


#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGUTL)


%include "std_vector.i"

#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON) || defined(SWIGR) || defined(SWIGOCTAVE) || defined(SWIGRUBY) || defined(SWIGJAVASCRIPT)
#define SWIG_GOOD_VECTOR
%ignore std::vector<Space::Flow>::vector(size_type);
%ignore std::vector<Space::Flow>::resize(size_type);
#endif

#if defined(SWIGTCL) || defined(SWIGPERL)
#define SWIG_GOOD_VECTOR
/* here, for languages with bad declaration */
%ignore std::vector<Space::Flow>::vector(unsigned int);
%ignore std::vector<Space::Flow>::resize(unsigned int);
#endif

%copyctor;

%ignore FlowFlow::FlowFlow;

%inline %{

namespace Space {
class Flow {
int x;
public:
 Flow(int i) : x(i) {}
};


class FlowFlow {
int x;
public:
 FlowFlow(int i) : x(i) {}
};

}

%}

%template (VectFlow) std::vector<Space::Flow>;

#endif


%rename(ABC_Libor_ModelUtils) ABC_Nam::ABC_Libor::ModelUtils;

%copyctor;
%inline %{
  namespace ABC_Nam {
    namespace ABC_Libor {
      struct ModelUtils {};

      template <class T>
      struct ModelUtils_T {};

    }    
  }
%}

%template(ModelUtils_i) ABC_Nam::ABC_Libor::ModelUtils_T<int>;


%rename(Space1Space2_TotalReturnSwap) Space1::Space2::TotalReturnSwap;

%copyctor;

%inline %{
namespace Space1 {
  namespace Space2 {

    class TotalReturnSwap {
    public:
      TotalReturnSwap() {}
    };    

    template <class T>
    class TotalReturnSwap_T {
    public:
      TotalReturnSwap_T() {}
    };    

  }
}
%}

%template(Total_i) Space1::Space2::TotalReturnSwap_T<int>;