File: IMSAlphabetParser_8h_source.html

package info (click to toggle)
openms 1.11.1-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 436,688 kB
  • ctags: 150,907
  • sloc: cpp: 387,126; xml: 71,547; python: 7,764; ansic: 2,626; php: 2,499; sql: 737; ruby: 342; sh: 325; makefile: 128
file content (128 lines) | stat: -rw-r--r-- 18,558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<HTML>
<HEAD>
<TITLE>IMSAlphabetParser.h Source File</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
<LINK HREF="style_ini.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<A href="index.html">Home</A> &nbsp;&middot;
<A href="classes.html">Classes</A> &nbsp;&middot;
<A href="annotated.html">Annotated Classes</A> &nbsp;&middot;
<A href="modules.html">Modules</A> &nbsp;&middot;
<A href="functions_func.html">Members</A> &nbsp;&middot;
<A href="namespaces.html">Namespaces</A> &nbsp;&middot;
<A href="pages.html">Related Pages</A>
<HR style="height:1px; border:none; border-top:1px solid #c0c0c0;">
<!-- Generated by Doxygen 1.8.5 -->
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_e770f0cf77e550adde3f44739ef529fe.html">include</a></li><li class="navelem"><a class="el" href="dir_6a63c4937d4da007e55fff5dcf71e0f8.html">OpenMS</a></li><li class="navelem"><a class="el" href="dir_5f4b1c13d07405f47ee611fa1c92df17.html">CHEMISTRY</a></li><li class="navelem"><a class="el" href="dir_b0236496b069f9a5bb167765bff837cf.html">MASSDECOMPOSITION</a></li><li class="navelem"><a class="el" href="dir_e5ce06617876553ec904e1435a0fb40c.html">IMS</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">IMSAlphabetParser.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="IMSAlphabetParser_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">// --------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//                   OpenMS -- Open-Source Mass Spectrometry</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">// --------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// ETH Zurich, and Freie Universitaet Berlin 2002-2013.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">// This software is released under a three-clause BSD license:</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">//  * Redistributions of source code must retain the above copyright</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">//    notice, this list of conditions and the following disclaimer.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">//  * Redistributions in binary form must reproduce the above copyright</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">//    notice, this list of conditions and the following disclaimer in the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">//    documentation and/or other materials provided with the distribution.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">//  * Neither the name of any author or any participating institution</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">//    may be used to endorse or promote products derived from this software</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">//    without specific prior written permission.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">// For a full list of authors, refer to the file AUTHORS.</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">// --------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">// INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment">// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment">// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment">// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">// --------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="comment">// $Maintainer: Stephan Aiche $</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">// $Authors: Anton Pervukhin &lt;Anton.Pervukhin@CeBiTec.Uni-Bielefeld.DE&gt; $</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="comment">// --------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#ifndef OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_IMSALPHABETPARSER_H</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_IMSALPHABETPARSER_H</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;fstream&gt;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;istream&gt;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="Exception_8h.html">OpenMS/CONCEPT/Exception.h</a>&gt;</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">namespace </span>OpenMS</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;{</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  <span class="keyword">namespace </span>ims</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  {</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> AlphabetElementType = <a class="code" href="classdouble.html">double</a>,</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;              <span class="keyword">typename</span> Container = std::map&lt;std::string, AlphabetElementType&gt;,</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;              <span class="keyword">typename</span> InputSource = std::istream&gt;</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html">   64</a></span>&#160;    <span class="keyword">class </span><a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html">IMSAlphabetParser</a></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    {</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ab6acf6aaa4bab8b5a1349a7318aa9ad4">   70</a></span>&#160;      <span class="keyword">typedef</span> Container <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ab6acf6aaa4bab8b5a1349a7318aa9ad4">ContainerType</a>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;      <span class="keywordtype">void</span> <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ae242eda4bd468cf17a0d503f13add026">load</a>(<span class="keyword">const</span> std::string &amp; fname);</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;      <span class="keyword">virtual</span> <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ab6acf6aaa4bab8b5a1349a7318aa9ad4">ContainerType</a> &amp; <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#a1df0ceed98c6c369158f1761effb7035">getElements</a>() = 0;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;      <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ade573b26af8953d802a34ed40aef4e7d">parse</a>(InputSource &amp; is) = 0;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#a9f3c7268f0ee25dff8c0703da0e58f8e">   96</a></span>&#160;      <span class="keyword">virtual</span> <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#a9f3c7268f0ee25dff8c0703da0e58f8e">~IMSAlphabetParser</a>() {}</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    };</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> AlphabetElementType, <span class="keyword">typename</span> Container, <span class="keyword">typename</span> InputSource&gt;</div>
<div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ae242eda4bd468cf17a0d503f13add026">  100</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ae242eda4bd468cf17a0d503f13add026">IMSAlphabetParser&lt;AlphabetElementType, Container, InputSource&gt;::load</a>(<span class="keyword">const</span> std::string &amp; fname)</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;      std::ifstream ifs(fname.c_str());</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;      <span class="keywordflow">if</span> (!ifs)</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;      {</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <span class="keywordflow">throw</span> <a class="code" href="classOpenMS_1_1Exception_1_1IOException.html">Exception::IOException</a>(__FILE__, __LINE__, __PRETTY_FUNCTION__, fname);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;      }</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;      this-&gt;parse(ifs);</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  } <span class="comment">// namespace ims</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;} <span class="comment">// namespace OpenMS</span></div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="preprocessor">#endif // OPENMS_CHEMISTRY_MASSDECOMPOSITION_IMS_ALPHABETPARSER_H</span></div>
<div class="ttc" id="classOpenMS_1_1ims_1_1IMSAlphabetParser_html_a1df0ceed98c6c369158f1761effb7035"><div class="ttname"><a href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#a1df0ceed98c6c369158f1761effb7035">OpenMS::ims::IMSAlphabetParser::getElements</a></div><div class="ttdeci">virtual ContainerType &amp; getElements()=0</div></div>
<div class="ttc" id="classOpenMS_1_1ims_1_1IMSAlphabetParser_html_ade573b26af8953d802a34ed40aef4e7d"><div class="ttname"><a href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ade573b26af8953d802a34ed40aef4e7d">OpenMS::ims::IMSAlphabetParser::parse</a></div><div class="ttdeci">virtual void parse(InputSource &amp;is)=0</div></div>
<div class="ttc" id="classdouble_html"><div class="ttname"><a href="classdouble.html">double</a></div></div>
<div class="ttc" id="classOpenMS_1_1ims_1_1IMSAlphabetParser_html_ae242eda4bd468cf17a0d503f13add026"><div class="ttname"><a href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ae242eda4bd468cf17a0d503f13add026">OpenMS::ims::IMSAlphabetParser::load</a></div><div class="ttdeci">void load(const std::string &amp;fname)</div><div class="ttdef"><b>Definition:</b> IMSAlphabetParser.h:100</div></div>
<div class="ttc" id="classOpenMS_1_1ims_1_1IMSAlphabetParser_html_ab6acf6aaa4bab8b5a1349a7318aa9ad4"><div class="ttname"><a href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#ab6acf6aaa4bab8b5a1349a7318aa9ad4">OpenMS::ims::IMSAlphabetParser::ContainerType</a></div><div class="ttdeci">Container ContainerType</div><div class="ttdef"><b>Definition:</b> IMSAlphabetParser.h:70</div></div>
<div class="ttc" id="classOpenMS_1_1ims_1_1IMSAlphabetParser_html_a9f3c7268f0ee25dff8c0703da0e58f8e"><div class="ttname"><a href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html#a9f3c7268f0ee25dff8c0703da0e58f8e">OpenMS::ims::IMSAlphabetParser::~IMSAlphabetParser</a></div><div class="ttdeci">virtual ~IMSAlphabetParser()</div><div class="ttdoc">Destructor. </div><div class="ttdef"><b>Definition:</b> IMSAlphabetParser.h:96</div></div>
<div class="ttc" id="classOpenMS_1_1Exception_1_1IOException_html"><div class="ttname"><a href="classOpenMS_1_1Exception_1_1IOException.html">OpenMS::Exception::IOException</a></div><div class="ttdoc">General IOException. </div><div class="ttdef"><b>Definition:</b> Exception.h:566</div></div>
<div class="ttc" id="classOpenMS_1_1ims_1_1IMSAlphabetParser_html"><div class="ttname"><a href="classOpenMS_1_1ims_1_1IMSAlphabetParser.html">OpenMS::ims::IMSAlphabetParser</a></div><div class="ttdoc">An abstract templatized parser to load the data that is used to initialize Alphabet objects...</div><div class="ttdef"><b>Definition:</b> IMSAlphabetParser.h:64</div></div>
<div class="ttc" id="Exception_8h_html"><div class="ttname"><a href="Exception_8h.html">Exception.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<HR style="height:1px; border:none; border-top:1px solid #c0c0c0;">
<TABLE width="100%" border="0">
<TR>
<TD><font color="#c0c0c0">OpenMS / TOPP release 1.11.1</font></TD>
<TD align="right"><font color="#c0c0c0">Documentation generated on Thu Nov 14 2013 11:19:15 using doxygen 1.8.5</font></TD>
</TR>
</TABLE>
</BODY>
</HTML>