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