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

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

#
Swig | 56 lines | 26 code | 13 blank | 17 comment | 0 complexity | da45fec1c8f19018af53d4a11f23ed06 MD5 | raw file
 1%module abstract_typedef
 2
 3
 4%inline %{
 5    struct Engine
 6    {
 7    };
 8
 9    struct AbstractBaseClass
10    {
11      virtual ~AbstractBaseClass()
12      {
13      }
14      
15      virtual bool write(Engine& archive) const = 0;
16    };    
17
18    typedef Engine PersEngine;
19    typedef AbstractBaseClass PersClassBase;      
20
21    
22    class A : public PersClassBase
23    {
24      // This works always
25      // bool write(Engine& archive) const;
26
27      // This doesn't with Swig 1.3.17.
28      // But it works fine with 1.3.16
29      bool write(PersEngine& archive) const
30      {
31	return true;
32      }
33      
34    
35    };
36      
37%}
38
39
40/*
41
42Problem related to the direct comparison of strings
43in the file allocate.cxx (line 55)
44
45          ......
46	  String *local_decl = Getattr(dn,"decl");
47	  if (local_decl && !Strcmp(local_decl, base_decl)) {
48          ......
49
50with the direct string comparison, no equivalent types
51are checked and the two 'write' functions appear to be
52different because
53
54  "q(const).f(r.bss::PersEngine)." != "q(const).f(r.bss::Engine)."
55
56*/