annotate lib/swig/swigwin-2.0.11/Lib/lua/std_except.i @ 1899:b3009adc0e2f

Adding swig, gitignore, hgignore
author Nomad
date Mon, 21 Oct 2013 10:42:27 +0200
parents
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 /* -----------------------------------------------------------------------------
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 * Typemaps used by the STL wrappers that throw exceptions.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 * These typemaps are used when methods are declared with an STL exception
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 * specification, such as:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 * size_t at() const throw (std::out_of_range);
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 *
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 * std_except.i
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 * ----------------------------------------------------------------------------- */
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 %{
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 #include <stdexcept>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 %}
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 %include <exception.i>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 namespace std
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 %ignore exception; // not sure if I should ignore this...
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 class exception
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 {
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 public:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 exception() throw() { }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 virtual ~exception() throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 virtual const char* what() const throw();
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 };
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 }
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 // normally objects which are thrown are returned to the interpreter as errors
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 // (which potentially may have problems if they are not copied)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 // therefore all classes based upon std::exception are converted to their strings & returned as errors
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 %typemap(throws) std::bad_exception "SWIG_exception(SWIG_RuntimeError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 %typemap(throws) std::domain_error "SWIG_exception(SWIG_ValueError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 %typemap(throws) std::exception "SWIG_exception(SWIG_SystemError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 %typemap(throws) std::invalid_argument "SWIG_exception(SWIG_ValueError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 %typemap(throws) std::length_error "SWIG_exception(SWIG_IndexError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 %typemap(throws) std::logic_error "SWIG_exception(SWIG_RuntimeError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 %typemap(throws) std::out_of_range "SWIG_exception(SWIG_IndexError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 %typemap(throws) std::overflow_error "SWIG_exception(SWIG_OverflowError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 %typemap(throws) std::range_error "SWIG_exception(SWIG_IndexError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 %typemap(throws) std::runtime_error "SWIG_exception(SWIG_RuntimeError, $1.what());"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 %typemap(throws) std::underflow_error "SWIG_exception(SWIG_RuntimeError, $1.what());"