PageRenderTime 42ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/csharp/director.swg

#
Unknown | 47 lines | 38 code | 9 blank | 0 comment | 0 complexity | 51acddf09c3ab9f5d5ed9a7efec30d21 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* -----------------------------------------------------------------------------
  2. * director.swg
  3. *
  4. * This file contains support for director classes so that C# proxy
  5. * methods can be called from C++.
  6. * ----------------------------------------------------------------------------- */
  7. #ifdef __cplusplus
  8. #if defined(DEBUG_DIRECTOR_OWNED)
  9. #include <iostream>
  10. #endif
  11. #include <string>
  12. namespace Swig {
  13. /* Director base class - not currently used in C# directors */
  14. class Director {
  15. };
  16. /* Base class for director exceptions */
  17. class DirectorException {
  18. protected:
  19. std::string swig_msg;
  20. public:
  21. DirectorException(const char* msg) : swig_msg(msg) {
  22. }
  23. DirectorException(const std::string &msg) : swig_msg(msg) {
  24. }
  25. const std::string& what() const {
  26. return swig_msg;
  27. }
  28. virtual ~DirectorException() {
  29. }
  30. };
  31. /* Pure virtual method exception */
  32. class DirectorPureVirtualException : public Swig::DirectorException {
  33. public:
  34. DirectorPureVirtualException(const char* msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) {
  35. }
  36. };
  37. }
  38. #endif /* __cplusplus */