add COPYING and --copyright flag
[greylag.git] / cgreylag.i
blob71c922bb1931d466b5ffada523cd0f90f2d3ebbb
1 // SWIG interface definition for module cgreylag
3 // $Id$
6 %module cgreylag
9 // Declare this read-only, to suppress a warning about a possible memory leak.
10 %immutable mass_trace_item::description;
13 %feature("autodoc");
16 #include "cgreylag.hpp"
20 // catch STL exceptions, etc
21 %include "exception.i"
22 %exception {
23 try {
24 $action
25 } catch (const std::exception& e) {
26 SWIG_exception(SWIG_RuntimeError, e.what());
27 } catch (...) {
28 PyErr_SetString(PyExc_RuntimeError,"unknown C++ (swig) exception");
29 return NULL;
33 // not sure these are useful--just avoiding SWIG warning
34 %rename(ion_increment) operator++(ion &);
35 %rename(ion_post_increment) operator++(ion &, int);
38 %include std_string.i
39 %apply const std::string & { std::string *name };
41 // %include std_list.i
42 %include std_vector.i
44 %template(vector_int) std::vector<int>;
45 %template(vector_double) std::vector<double>;
46 %template(vector_peak) std::vector<peak>;
47 %template(vector_spectrum) std::vector<spectrum>;
48 %template(vector_match) std::vector<match>;
49 %template(vector_mass_regime_parameters) std::vector<mass_regime_parameters>;
50 %template(vector_mass_trace_item) std::vector<mass_trace_item>;
51 %template(vector_vector_int) std::vector< std::vector<int> >;
52 %template(vector_vector_double) std::vector< std::vector<double> >;
53 %template(vector_vector_match) std::vector< std::vector<match> >;
54 %template(vector_vector_vector_double) std::vector< std::vector< std::vector<double> > >;
57 %include std_pair.i
58 %include std_map.i
59 %include std_multimap.i
61 %template(pair_double_vector_size_type)
62 std::pair<double, std::vector<spectrum>::size_type>;
64 // These two lines seem to be required to make the multimap template work.
65 // The multimap is only exposed for debugging purposes, anyway, though.
66 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
67 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
69 %template(multimap_double_vector_size_type)
70 std::multimap<double, std::vector<spectrum>::size_type>;
72 // currently unused
73 //%template(pair_char_int) std::pair<char, int>;
74 //%template(pair_char_double) std::pair<char, double>;
76 //%template(map_char_int) std::map<char, int>;
77 //%template(map_char_double) std::map<char, double>;
80 %include "typemaps.i"
81 %apply int *OUTPUT { int *peak_count };
84 %include file.i
87 %include "cgreylag.hpp"