Cleanups: dead code removal/etc.
[greylag.git] / cgreylag.i
blobd0b8b64f0ad6a851cd55969e83873aae5237da6c
1 // SWIG interface definition for module cgreylag
3 // Copyright (C) 2006-2007, Stowers Institute for Medical Research
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License along
16 // with this program; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 %module cgreylag
23 %feature("autodoc");
26 #include "cgreylag.hpp"
30 // catch STL exceptions, etc
31 %include "exception.i"
32 %exception {
33 try {
34 $action
35 } catch (const std::exception& e) {
36 SWIG_exception(SWIG_RuntimeError, e.what());
37 } catch (...) {
38 PyErr_SetString(PyExc_RuntimeError,"unknown C++ (swig) exception");
39 return NULL;
43 // not sure these are useful--just avoiding SWIG warning
44 %rename(ion_increment) operator++(ion &);
45 %rename(ion_post_increment) operator++(ion &, int);
48 %include std_string.i
49 %apply const std::string & { std::string *name };
51 // %include std_list.i
52 %include std_vector.i
54 // Note: SWIG currently only exposes the outermost vector (in a vector of
55 // vector of X) as a modifiable object. Inner vectors appear as tuples, and
56 // are thus unmodifiable. They must therefore be assigned all at once. This
57 // shortcoming will probably be fixed in a future version of SWIG.
59 %template(vector_int) std::vector<int>;
60 %template(vector_double) std::vector<double>;
61 %template(vector_sequence_run) std::vector<sequence_run>;
62 %template(vector_peak) std::vector<peak>;
63 %template(vector_spectrum) std::vector<spectrum>;
64 %template(vector_match) std::vector<match>;
65 %template(vector_mass_regime_parameters) std::vector<mass_regime_parameters>;
66 %template(vector_mass_trace_item) std::vector<mass_trace_item>;
67 %template(vector_string) std::vector<std::string>;
68 %template(vector_vector_int) std::vector< std::vector<int> >;
69 %template(vector_vector_double) std::vector< std::vector<double> >;
70 %template(vector_vector_match) std::vector< std::vector<match> >;
73 %include std_pair.i
74 %include std_map.i
75 %include std_multimap.i
77 %template(pair_double_vector_size_type)
78 std::pair<double, std::vector<spectrum>::size_type>;
80 // These two lines seem to be required to make the multimap template work.
81 // The multimap is only exposed for debugging purposes, anyway, though.
82 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
83 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
85 %template(multimap_double_vector_size_type)
86 std::multimap<double, std::vector<spectrum>::size_type>;
89 %include file.i
92 %naturalvar search_context::pca_residues;
94 %include "cgreylag.hpp"