PageRenderTime 68ms CodeModel.GetById 19ms RepoModel.GetById 1ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module abstract_typedef
  2. %inline %{
  3. struct Engine
  4. {
  5. };
  6. struct AbstractBaseClass
  7. {
  8. virtual ~AbstractBaseClass()
  9. {
  10. }
  11. virtual bool write(Engine& archive) const = 0;
  12. };
  13. typedef Engine PersEngine;
  14. typedef AbstractBaseClass PersClassBase;
  15. class A : public PersClassBase
  16. {
  17. // This works always
  18. // bool write(Engine& archive) const;
  19. // This doesn't with Swig 1.3.17.
  20. // But it works fine with 1.3.16
  21. bool write(PersEngine& archive) const
  22. {
  23. return true;
  24. }
  25. };
  26. %}
  27. /*
  28. Problem related to the direct comparison of strings
  29. in the file allocate.cxx (line 55)
  30. ......
  31. String *local_decl = Getattr(dn,"decl");
  32. if (local_decl && !Strcmp(local_decl, base_decl)) {
  33. ......
  34. with the direct string comparison, no equivalent types
  35. are checked and the two 'write' functions appear to be
  36. different because
  37. "q(const).f(r.bss::PersEngine)." != "q(const).f(r.bss::Engine)."
  38. */