update README and TODO
[greylag.git] / cgreylag.i
blob3598a8b965f36f1cedcdbbf1966a112de861d552
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;
44 %include std_string.i
45 %apply const std::string & { std::string *name };
47 // %include std_list.i
48 %include std_vector.i
50 // Note: SWIG currently only exposes the outermost vector (in a vector of
51 // vector of X) as a modifiable object. Inner vectors appear as tuples, and
52 // are thus unmodifiable. They must therefore be assigned all at once. This
53 // shortcoming will probably be fixed in a future version of SWIG.
55 %template(vector_int) std::vector<int>;
56 %template(vector_double) std::vector<double>;
57 %template(vector_sequence_run) std::vector<sequence_run>;
58 %template(vector_peak) std::vector<peak>;
59 %template(vector_spectrum) std::vector<spectrum>;
60 %template(vector_match) std::vector<match>;
61 %template(vector_mass_regime_parameters) std::vector<mass_regime_parameters>;
62 %template(vector_mass_trace_item) std::vector<mass_trace_item>;
63 %template(vector_string) std::vector<std::string>;
64 %template(vector_vector_int) std::vector< std::vector<int> >;
65 %template(vector_vector_double) std::vector< std::vector<double> >;
66 %template(vector_vector_match) std::vector< std::vector<match> >;
69 %include std_pair.i
70 %include std_map.i
71 %include std_multimap.i
73 %template(pair_double_vector_size_type)
74 std::pair<double, std::vector<spectrum>::size_type>;
76 // These two lines seem to be required to make the multimap template work.
77 // The multimap is only exposed for debugging purposes, anyway, though.
78 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
79 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
81 %template(multimap_double_vector_size_type)
82 std::multimap<double, std::vector<spectrum>::size_type>;
85 %include file.i
88 %naturalvar search_context::pca_residues;
90 %include "cgreylag.hpp"