PageRenderTime 13ms CodeModel.GetById 9ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

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

#
Swig | 41 lines | 33 code | 8 blank | 0 comment | 0 complexity | 434401e308efec5e7dae1a2064d74013 MD5 | raw file
 1%module template_opaque
 2%include "std_vector.i"
 3
 4%{
 5  namespace A 
 6  {
 7    struct OpaqueStruct 
 8    {
 9    };
10  }
11
12  enum Hello { hi, hello };
13      
14%}
15
16
17%inline {
18namespace A {
19  struct OpaqueStruct;
20  typedef struct OpaqueStruct OpaqueType;
21  typedef enum Hello Hi;
22  typedef std::vector<OpaqueType> OpaqueVectorType;
23  typedef std::vector<Hi> OpaqueVectorEnum;
24  
25  void FillVector(OpaqueVectorType& v) 
26  {
27    for (size_t i = 0; i < v.size(); ++i) {
28      v[i] = OpaqueStruct();
29    }
30  }
31
32  void FillVector(const OpaqueVectorEnum& v) 
33  {
34  }
35}
36}
37
38#ifndef SWIGCSHARP
39// C# vector typemaps only ready for simple cases right now
40%template(OpaqueVectorType) std::vector<A::OpaqueType>; 
41#endif