PageRenderTime 23ms CodeModel.GetById 21ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/rel-1-3-29/SWIG/Examples/test-suite/constructor_copy.i

#
Swig | 154 lines | 105 code | 48 blank | 1 comment | 0 complexity | 39c6fd583f7502ad72a9056d5ecacfad MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1%module constructor_copy
  2
  3%copyctor;
  4%nocopyctor Foo8;
  5%nocopyctor Bar<double>;
  6
  7%inline %{
  8  
  9struct Foo1 {
 10  int x;
 11
 12  Foo1(int _x = 2) : x(_x)
 13  {
 14  }  
 15};
 16
 17struct Foo2 {
 18  Foo2() { }
 19};
 20
 21struct Foo3 {
 22  Foo3() { }
 23  Foo3(const Foo3& ) { }
 24};
 25
 26struct Foo4 {
 27  Foo4() { }
 28  
 29protected:
 30  Foo4(const Foo4& ) { }
 31};
 32
 33
 34struct Foo4a {
 35  Foo4a() { }
 36  
 37private:
 38  Foo4a(const Foo4a& ) { }
 39};
 40
 41
 42struct Foo5 : Foo4 {
 43};
 44
 45struct Foo6 : Foo4 {
 46  Foo6(const Foo6& f) : Foo4(f) { }
 47};
 48
 49struct Foo7 : Foo5 {
 50};
 51
 52struct Foo8 {
 53};
 54
 55template <class T>
 56class Bar 
 57{
 58public:
 59  int x;
 60
 61  Bar(int _x = 0) : x(_x)
 62  {
 63  }
 64};
 65%}
 66
 67%template(Bari) Bar<int>;
 68%template(Bard) Bar<double>;
 69
 70
 71#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGUTL)
 72
 73
 74%include "std_vector.i"
 75
 76#if defined(SWIGCSHARP)
 77SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(Flow, Space::Flow)
 78#endif
 79
 80#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON)
 81#define SWIG_GOOD_VECTOR
 82%ignore std::vector<Space::Flow>::vector(size_type);
 83%ignore std::vector<Space::Flow>::resize(size_type);
 84#endif
 85
 86#if defined(SWIGTCL) || defined(SWIGPERL) || defined(SWIGRUBY) 
 87#define SWIG_GOOD_VECTOR
 88/* here, for languages with bad declaration */
 89%ignore std::vector<Space::Flow>::vector(unsigned int);
 90%ignore std::vector<Space::Flow>::resize(unsigned int);
 91#endif
 92
 93%copyctor;
 94
 95
 96%inline %{
 97
 98namespace Space {
 99class Flow {
100public:
101  Flow(int i) {}
102};
103}
104
105%}
106
107%template (VectFlow) std::vector<Space::Flow>;
108
109#endif
110
111
112%rename(ABC_Libor_ModelUtils) ABC_Nam::ABC_Libor::ModelUtils;
113
114%copyctor;
115%inline %{
116  namespace ABC_Nam {
117    namespace ABC_Libor {
118      struct ModelUtils {};
119
120      template <class T>
121      struct ModelUtils_T {};
122
123    }    
124  }
125%}
126
127%template(ModelUtils_i) ABC_Nam::ABC_Libor::ModelUtils_T<int>;
128
129
130%rename(Space1Space2_TotalReturnSwap) Space1::Space2::TotalReturnSwap;
131
132%copyctor;
133
134%inline %{
135namespace Space1 {
136  namespace Space2 {
137
138    class TotalReturnSwap {
139    public:
140      TotalReturnSwap() {}
141    };    
142
143    template <class T>
144    class TotalReturnSwap_T {
145    public:
146      TotalReturnSwap_T() {}
147    };    
148
149  }
150}
151%}
152
153%template(Total_i) Space1::Space2::TotalReturnSwap_T<int>;
154