Initial import from RCS
[greylag.git] / cgreylag.i
blobd190036d041d13aa1df8c4013d2cb16856eb3663
1 // SWIG interface definition for module cgreylag
3 // $Id: cgreylag.i,v 1.4 2006/09/26 16:16:51 mkc Exp $
6 %module cgreylag
8 %feature("autodoc");
11 #include "cgreylag.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_mass_regime_parameters) std::vector<mass_regime_parameters>;
45 %template(vector_vector_int) std::vector< std::vector<int> >;
46 %template(vector_vector_double) std::vector< std::vector<double> >;
47 %template(vector_vector_match) std::vector< std::vector<match> >;
50 %include std_pair.i
51 %include std_map.i
52 %include std_multimap.i
54 %template(pair_double_vector_size_type)
55 std::pair<double, std::vector<spectrum>::size_type>;
57 // These two lines seem to be required to make the multimap template work.
58 // The multimap is only exposed for debugging purposes, anyway, though.
59 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
60 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
62 %template(multimap_double_vector_size_type)
63 std::multimap<double, std::vector<spectrum>::size_type>;
65 // currently unused
66 //%template(pair_char_int) std::pair<char, int>;
67 //%template(pair_char_double) std::pair<char, double>;
69 //%template(map_char_int) std::map<char, int>;
70 //%template(map_char_double) std::map<char, double>;
73 %include "typemaps.i"
74 %apply int *OUTPUT { int *peak_count };
77 %include file.i
80 %include "cgreylag.hpp"