Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

  1. /* -----------------------------------------------------------------------------
  2. * See the LICENSE file for information on copyright, usage and redistribution
  3. * of SWIG, and the README file for authors - http://www.swig.org/release.html.
  4. *
  5. * director.swg
  6. *
  7. * This file contains support for director classes so that C# proxy
  8. * methods can be called from C++.
  9. * ----------------------------------------------------------------------------- */
  10. #ifdef __cplusplus
  11. #if defined(DEBUG_DIRECTOR_OWNED)
  12. #include <iostream>
  13. #endif
  14. #include <string>
  15. namespace Swig {
  16. /* Director base class - not currently used in C# directors */
  17. class Director {
  18. };
  19. /* Base class for director exceptions */
  20. class DirectorException {
  21. protected:
  22. std::string swig_msg;
  23. public:
  24. DirectorException(const char* msg) : swig_msg(msg) {
  25. }
  26. DirectorException(const std::string &msg) : swig_msg(msg) {
  27. }
  28. const std::string& what() const {
  29. return swig_msg;
  30. }
  31. virtual ~DirectorException() {
  32. }
  33. };
  34. /* Pure virtual method exception */
  35. class DirectorPureVirtualException : public Swig::DirectorException {
  36. public:
  37. DirectorPureVirtualException(const char* msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) {
  38. }
  39. };
  40. }
  41. #endif /* __cplusplus */