PageRenderTime 13ms CodeModel.GetById 11ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Lib/csharp/director.swg

#
Unknown | 47 lines | 38 code | 9 blank | 0 comment | 0 complexity | 51acddf09c3ab9f5d5ed9a7efec30d21 MD5 | raw file
 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
15namespace 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