1 %module template_opaque 2 %include "std_vector.i" 3 4 %{ 5 namespace A 6 { 7 struct OpaqueStruct 8 { 9 int x; 10 }; 11 } 12 13 enum Hello { hi, hello }; 14 15 %} 16 17 18 %inline { 19 namespace A { 20 struct OpaqueStruct; 21 typedef struct OpaqueStruct OpaqueType; 22 typedef enum Hello Hi; 23 typedef std::vector<OpaqueType> OpaqueVectorType; 24 typedef std::vector<Hi> OpaqueVectorEnum; 25 FillVector(OpaqueVectorType & v)26 void FillVector(OpaqueVectorType& v) 27 { 28 for (size_t i = 0; i < v.size(); ++i) { 29 v[i] = OpaqueStruct(); 30 } 31 } 32 FillVector(const OpaqueVectorEnum & v)33 void FillVector(const OpaqueVectorEnum& v) 34 { 35 } 36 } 37 } 38 39 %template(OpaqueVectorType) std::vector<A::OpaqueType>; 40