Check sequence db locus name uniqueness
[greylag.git] / cgreylag.i
blobc524f4bcd0aae07d5ddc3d161a6589c361f3532e
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 // Declare this read-only, to suppress a warning about a possible memory leak.
24 %immutable mass_trace_item::description;
27 %feature("autodoc");
30 #include "cgreylag.hpp"
34 // catch STL exceptions, etc
35 %include "exception.i"
36 %exception {
37 try {
38 $action
39 } catch (const std::exception& e) {
40 SWIG_exception(SWIG_RuntimeError, e.what());
41 } catch (...) {
42 PyErr_SetString(PyExc_RuntimeError,"unknown C++ (swig) exception");
43 return NULL;
47 // not sure these are useful--just avoiding SWIG warning
48 %rename(ion_increment) operator++(ion &);
49 %rename(ion_post_increment) operator++(ion &, int);
52 %include std_string.i
53 %apply const std::string & { std::string *name };
55 // %include std_list.i
56 %include std_vector.i
58 // Note: SWIG currently only exposes the outermost vector (in a vector of
59 // vector of X) as a modifiable object. Inner vectors appear as tuples, and
60 // are thus unmodifiable. They must therefore be assigned all at once. This
61 // shortcoming will probably be fixed in a future version of SWIG.
63 %template(vector_int) std::vector<int>;
64 %template(vector_double) std::vector<double>;
65 %template(vector_sequence_run) std::vector<sequence_run>;
66 %template(vector_peak) std::vector<peak>;
67 %template(vector_spectrum) std::vector<spectrum>;
68 %template(vector_match) std::vector<match>;
69 %template(vector_mass_regime_parameters) std::vector<mass_regime_parameters>;
70 %template(vector_mass_trace_item) std::vector<mass_trace_item>;
71 %template(vector_vector_int) std::vector< std::vector<int> >;
72 %template(vector_vector_double) std::vector< std::vector<double> >;
73 %template(vector_vector_match) std::vector< std::vector<match> >;
74 %template(vector_vector_vector_double) std::vector< std::vector< std::vector<double> > >;
77 %include std_pair.i
78 %include std_map.i
79 %include std_multimap.i
81 %template(pair_double_vector_size_type)
82 std::pair<double, std::vector<spectrum>::size_type>;
84 // These two lines seem to be required to make the multimap template work.
85 // The multimap is only exposed for debugging purposes, anyway, though.
86 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
87 %template(pymap) std::map<swig::PyObject_ptr, swig::PyObject_ptr>;
89 %template(multimap_double_vector_size_type)
90 std::multimap<double, std::vector<spectrum>::size_type>;
92 // currently unused
93 //%template(pair_char_int) std::pair<char, int>;
94 //%template(pair_char_double) std::pair<char, double>;
96 //%template(map_char_int) std::map<char, int>;
97 //%template(map_char_double) std::map<char, double>;
100 %include "typemaps.i"
101 %apply int *OUTPUT { int *peak_count };
104 %include file.i
107 %naturalvar search_context::pca_residues;
109 %include "cgreylag.hpp"