PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 49 lines | 39 code | 10 blank | 0 comment | 0 complexity | e96a53630e7492bad1e36d35dd76c564 MD5 | raw file
 1%module template_tbase_template
 2
 3%warnfilter(SWIGWARN_RUBY_WRONG_NAME) traits<Double, Double>;	/* Ruby, wrong class name */
 4
 5%warnfilter(SWIGWARN_PARSE_EXPLICIT_TEMPLATE);
 6
 7%inline %{
 8  typedef double Double;
 9
10 
11  template <class ArgType, class ResType>
12  struct Funktion
13  {
14	char *test() { return (char *) "test"; }
15  };
16
17  template <class ArgType, class ResType>
18  struct traits
19  {
20    typedef ArgType arg_type;
21    typedef ResType res_type;
22    typedef Funktion<ArgType, double> base;	
23  };
24
25  // Egad!
26  template <class AF, class AG>
27  struct Class_
28    : Funktion<typename traits<AF, AG>::arg_type,
29                                typename traits<AF, AG>::res_type>
30  {
31  };
32 
33  template <class AF, class RF>
34  typename traits<AF, RF>::base
35  make_Class()
36  {
37    return Class_<AF, RF>();
38  }
39
40%}
41%{
42  template struct Funktion <Double, Double>;
43  template struct Class_ <Double, Double>; 
44%}
45 
46%template(traits_dd) traits <Double, Double>;
47%template(Funktion_dd) Funktion <Double, Double>;
48%template(Class_dd) Class_ <Double, Double>;
49%template(make_Class_dd) make_Class<Double,Double>;