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

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

#
Swig | 39 lines | 28 code | 11 blank | 0 comment | 0 complexity | ca1aac3113bc8d46e7d3388cc79beffe MD5 | raw file
 1%module template_enum_typedef
 2
 3%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::etraits; /* Ruby, wrong class name */
 4
 5%inline %{
 6 
 7  namespace oss
 8  {
 9    enum Polarization { UnaryPolarization, BinaryPolarization };
10 
11    template <Polarization P>
12    struct Interface_
13    {
14    };
15 
16    struct etraits
17    {
18      static const Polarization  pmode = UnaryPolarization;
19    };
20 
21 
22    template <class Traits>
23    struct Module
24    {
25      typedef Traits traits;
26      static const Polarization P = traits::pmode;
27 
28      void get(Interface_<P> arg) { };   // Here P is only replace by traits::pmode
29 
30    };
31  }
32 
33%}
34 
35namespace oss
36{
37  %template(Interface_UP) Interface_<UnaryPolarization>;
38  %template(Module_UP) Module<etraits>;
39}