Merge commit 'v0.1.2'
[greylag.git] / cgreylag.i
blob642a173a11936a98e69ddbaed8de10987eae9bb1
1 // SWIG interface definition for module cgreylag
3 // greylag, a collection of programs for MS/MS protein analysis
4 // Copyright (C) 2006-2008 Stowers Institute for Medical Research
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 // Contact: Mike Coleman
20 // Stowers Institute for Medical Research
21 // 1000 East 50th Street
22 // Kansas City, Missouri 64110
23 // USA
26 %module cgreylag
29 %feature("autodoc");
32 #include "cgreylag.hpp"
36 // catch STL exceptions, etc
37 %include "exception.i"
38 %exception {
39 try {
40 $action
41 } catch (const std::exception& e) {
42 SWIG_exception(SWIG_RuntimeError, e.what());
43 } catch (...) {
44 PyErr_SetString(PyExc_RuntimeError,"unknown C++ (swig) exception");
45 return NULL;
50 %include std_string.i
51 %apply const std::string & { std::string *name };
53 // %include std_list.i
54 %include std_vector.i
56 // Note: SWIG currently only exposes the outermost vector (in a vector of
57 // vector of X) as a modifiable object. Inner vectors appear as tuples, and
58 // are thus unmodifiable. They must therefore be assigned all at once. This
59 // shortcoming will probably be fixed in a future version of SWIG.
61 %template(vector_int) std::vector<int>;
62 %template(vector_double) std::vector<double>;
63 %template(vector_sequence_run) std::vector<sequence_run>;
64 %template(vector_peak) std::vector<peak>;
65 %template(vector_spectrum) std::vector<spectrum>;
66 %template(vector_match) std::vector<match>;
67 %template(vector_mass_regime_parameters) std::vector<mass_regime_parameters>;
68 %template(vector_mass_trace_item) std::vector<mass_trace_item>;
69 %template(vector_string) std::vector<std::string>;
70 %template(vector_vector_int) std::vector< std::vector<int> >;
71 %template(vector_vector_double) std::vector< std::vector<double> >;
72 %template(vector_vector_match) std::vector< std::vector<match> >;
75 %include std_pair.i
76 %include std_map.i
77 %include std_multimap.i
79 %template(pair_double_vector_size_type)
80 std::pair<double, std::vector<spectrum>::size_type>;
82 // These two lines seem to be required to make the multimap template work.
83 // The multimap is only exposed for debugging purposes, anyway, though.
84 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
85 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
87 %template(multimap_double_vector_size_type)
88 std::multimap<double, std::vector<spectrum>::size_type>;
91 %include file.i
94 %naturalvar search_context::pca_residues;
96 %include "cgreylag.hpp"