checkpoint before working on differential mod stuff
[greylag.git] / cgreylag.i
blob9f4ab769f3d61736f56e1ecbab68566df7f10afe
1 // SWIG interface definition for module cxtpy
3 // $Id$
6 %module cxtpy
8 %feature("autodoc");
11 #include "cxtpy.hpp"
15 // catch STL exceptions, etc
16 %include "exception.i"
17 %exception {
18 try {
19 $action
20 } catch (const std::exception& e) {
21 SWIG_exception(SWIG_RuntimeError, e.what());
22 } catch (...) {
23 PyErr_SetString(PyExc_RuntimeError,"unknown C++ (swig) exception");
24 return NULL;
28 // not sure these are useful--just avoiding SWIG warning
29 %rename(ion_increment) operator++(ion &);
30 %rename(ion_post_increment) operator++(ion &, int);
33 %include std_string.i
34 %apply const std::string & { std::string *name };
36 %include std_list.i
37 %include std_vector.i
39 %template(vector_int) std::vector<int>;
40 %template(vector_double) std::vector<double>;
41 %template(vector_peak) std::vector<peak>;
42 %template(vector_spectrum) std::vector<spectrum>;
43 %template(vector_match) std::vector<match>;
44 %template(vector_vector_int) std::vector< std::vector<int> >;
45 %template(vector_vector_double) std::vector< std::vector<double> >;
46 %template(vector_vector_match) std::vector< std::vector<match> >;
49 %include std_pair.i
50 %include std_map.i
51 %include std_multimap.i
53 %template(pair_double_vector_size_type)
54 std::pair<double, std::vector<spectrum>::size_type>;
56 // These two lines seem to be required to make the multimap template work.
57 // The multimap is only exposed for debugging purposes, anyway, though.
58 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
59 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
61 %template(multimap_double_vector_size_type)
62 std::multimap<double, std::vector<spectrum>::size_type>;
64 // currently unused
65 //%template(pair_char_int) std::pair<char, int>;
66 //%template(pair_char_double) std::pair<char, double>;
68 //%template(map_char_int) std::map<char, int>;
69 //%template(map_char_double) std::map<char, double>;
72 %include "typemaps.i"
73 %apply int *OUTPUT { int *peak_count };
76 %include file.i
79 %include "cxtpy.hpp"