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 8 #ifdef __cplusplus 9 10 #if defined(DEBUG_DIRECTOR_OWNED) 11 #include <iostream> 12 #endif 13 #include <string> 14 15 namespace Swig { 16 /* Director base class - not currently used in C# directors */ 17 class Director { 18 }; 19 20 /* Base class for director exceptions */ 21 class DirectorException { 22 protected: 23 std::string swig_msg; 24 25 public: 26 DirectorException(const char* msg) : swig_msg(msg) { 27 } 28 DirectorException(const std::string &msg) : swig_msg(msg) { 29 } 30 const std::string& what() const { 31 return swig_msg; 32 } 33 virtual ~DirectorException() { 34 } 35 }; 36 37 /* Pure virtual method exception */ 38 class DirectorPureVirtualException : public Swig::DirectorException { 39 public: 40 DirectorPureVirtualException(const char* msg) : DirectorException(std::string("Attempt to invoke pure virtual method ") + msg) { 41 } 42 }; 43 } 44 45 #endif /* __cplusplus */ 46 47 48