NCBI C++ ToolKit
MSIonAnnot_.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id$
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  */
27 
28 /// @file MSIonAnnot_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/omssa/omssa.asn">omssa.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/omssa/omssa.def">omssa.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef OBJECTS_OMSSA_MSIONANNOT_BASE_HPP
42 #define OBJECTS_OMSSA_MSIONANNOT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // generated classes
56 
57 
58 /** @addtogroup dataspec_OMSSA
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 /// annotated comments about the ion
65 ///
66 /// CMSIonAnnot_Base --
67 ///
68 
70 {
72 public:
73  // constructor
74  CMSIonAnnot_Base(void);
75  // destructor
76  virtual ~CMSIonAnnot_Base(void);
77 
78  // type info
80 
81  // types
82  typedef bool TSuspect;
83  typedef double TMassdiff;
84  typedef bool TMissingisotope;
85 
86  // member index
87  enum class E_memberIndex {
88  e__allMandatory = 0,
89  e_suspect,
90  e_massdiff,
91  e_missingisotope
92  };
94 
95  // getters
96  // setters
97 
98  /// is this peak suspect?
99  /// Check if a value has been assigned to Suspect data member.
100  ///
101  /// Data member Suspect is optional;
102  /// its type is defined as 'typedef bool TSuspect'
103  /// @return
104  /// - true, if a value has been assigned.
105  /// - false, otherwise.
106  bool IsSetSuspect(void) const;
107 
108  /// Check if it is safe to call GetSuspect method.
109  ///
110  /// @return
111  /// - true, if the data member is getatable.
112  /// - false, otherwise.
113  bool CanGetSuspect(void) const;
114 
115  /// Reset Suspect data member.
116  void ResetSuspect(void);
117 
118  /// Get the Suspect member data.
119  ///
120  /// @return
121  /// Copy of the member data.
122  TSuspect GetSuspect(void) const;
123 
124  /// Assign a value to Suspect data member.
125  ///
126  /// @param value
127  /// Value to assign
128  void SetSuspect(TSuspect value);
129 
130  /// Assign a value to Suspect data member.
131  ///
132  /// @return
133  /// Reference to the data value.
134  TSuspect& SetSuspect(void);
135 
136  /// what is the difference in mass from library spectrum?
137  /// Check if a value has been assigned to Massdiff data member.
138  ///
139  /// Data member Massdiff is optional;
140  /// its type is defined as 'typedef double TMassdiff'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetMassdiff(void) const;
145 
146  /// Check if it is safe to call GetMassdiff method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetMassdiff(void) const;
152 
153  /// Reset Massdiff data member.
154  void ResetMassdiff(void);
155 
156  /// Get the Massdiff member data.
157  ///
158  /// @return
159  /// Copy of the member data.
160  TMassdiff GetMassdiff(void) const;
161 
162  /// Assign a value to Massdiff data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetMassdiff(TMassdiff value);
167 
168  /// Assign a value to Massdiff data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TMassdiff& SetMassdiff(void);
173 
174  /// are the lower mass peaks missing?
175  /// Check if a value has been assigned to Missingisotope data member.
176  ///
177  /// Data member Missingisotope is optional;
178  /// its type is defined as 'typedef bool TMissingisotope'
179  /// @return
180  /// - true, if a value has been assigned.
181  /// - false, otherwise.
182  bool IsSetMissingisotope(void) const;
183 
184  /// Check if it is safe to call GetMissingisotope method.
185  ///
186  /// @return
187  /// - true, if the data member is getatable.
188  /// - false, otherwise.
189  bool CanGetMissingisotope(void) const;
190 
191  /// Reset Missingisotope data member.
192  void ResetMissingisotope(void);
193 
194  /// Get the Missingisotope member data.
195  ///
196  /// @return
197  /// Copy of the member data.
198  TMissingisotope GetMissingisotope(void) const;
199 
200  /// Assign a value to Missingisotope data member.
201  ///
202  /// @param value
203  /// Value to assign
204  void SetMissingisotope(TMissingisotope value);
205 
206  /// Assign a value to Missingisotope data member.
207  ///
208  /// @return
209  /// Reference to the data value.
210  TMissingisotope& SetMissingisotope(void);
211 
212  /// Reset the whole object
213  virtual void Reset(void);
214 
215 
216 private:
217  // Prohibit copy constructor and assignment operator
220 
221  // data
222  Uint4 m_set_State[1];
223  bool m_Suspect;
224  double m_Massdiff;
226 };
227 
228 /* @} */
229 
230 
231 
232 
233 
234 ///////////////////////////////////////////////////////////
235 ///////////////////// inline methods //////////////////////
236 ///////////////////////////////////////////////////////////
237 inline
239 {
240  return ((m_set_State[0] & 0x3) != 0);
241 }
242 
243 inline
245 {
246  return IsSetSuspect();
247 }
248 
249 inline
251 {
252  m_Suspect = 0;
253  m_set_State[0] &= ~0x3;
254 }
255 
256 inline
258 {
259  if (!CanGetSuspect()) {
260  ThrowUnassigned(0);
261  }
262  return m_Suspect;
263 }
264 
265 inline
267 {
268  m_Suspect = value;
269  m_set_State[0] |= 0x3;
270 }
271 
272 inline
274 {
275 #ifdef _DEBUG
276  if (!IsSetSuspect()) {
277  memset(&m_Suspect,UnassignedByte(),sizeof(m_Suspect));
278  }
279 #endif
280  m_set_State[0] |= 0x1;
281  return m_Suspect;
282 }
283 
284 inline
286 {
287  return ((m_set_State[0] & 0xc) != 0);
288 }
289 
290 inline
292 {
293  return IsSetMassdiff();
294 }
295 
296 inline
298 {
299  m_Massdiff = 0;
300  m_set_State[0] &= ~0xc;
301 }
302 
303 inline
305 {
306  if (!CanGetMassdiff()) {
307  ThrowUnassigned(1);
308  }
309  return m_Massdiff;
310 }
311 
312 inline
314 {
315  m_Massdiff = value;
316  m_set_State[0] |= 0xc;
317 }
318 
319 inline
321 {
322 #ifdef _DEBUG
323  if (!IsSetMassdiff()) {
324  memset(&m_Massdiff,UnassignedByte(),sizeof(m_Massdiff));
325  }
326 #endif
327  m_set_State[0] |= 0x4;
328  return m_Massdiff;
329 }
330 
331 inline
333 {
334  return ((m_set_State[0] & 0x30) != 0);
335 }
336 
337 inline
339 {
340  return IsSetMissingisotope();
341 }
342 
343 inline
345 {
346  m_Missingisotope = 0;
347  m_set_State[0] &= ~0x30;
348 }
349 
350 inline
352 {
353  if (!CanGetMissingisotope()) {
354  ThrowUnassigned(2);
355  }
356  return m_Missingisotope;
357 }
358 
359 inline
361 {
363  m_set_State[0] |= 0x30;
364 }
365 
366 inline
368 {
369 #ifdef _DEBUG
370  if (!IsSetMissingisotope()) {
372  }
373 #endif
374  m_set_State[0] |= 0x10;
375  return m_Missingisotope;
376 }
377 
378 ///////////////////////////////////////////////////////////
379 ////////////////// end of inline methods //////////////////
380 ///////////////////////////////////////////////////////////
381 
382 
383 
384 
385 
386 END_objects_SCOPE // namespace ncbi::objects::
387 
389 
390 
391 #endif // OBJECTS_OMSSA_MSIONANNOT_BASE_HPP
annotated comments about the ion
Definition: MSIonAnnot_.hpp:70
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_OMSSA_EXPORT
Definition: ncbi_export.h:672
TSuspect & SetSuspect(void)
Assign a value to Suspect data member.
void ResetMassdiff(void)
Reset Massdiff data member.
bool CanGetMissingisotope(void) const
Check if it is safe to call GetMissingisotope method.
bool IsSetSuspect(void) const
is this peak suspect? Check if a value has been assigned to Suspect data member.
bool CanGetSuspect(void) const
Check if it is safe to call GetSuspect method.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: MSIonAnnot_.hpp:93
bool IsSetMassdiff(void) const
what is the difference in mass from library spectrum? Check if a value has been assigned to Massdiff ...
TMissingisotope & SetMissingisotope(void)
Assign a value to Missingisotope data member.
bool IsSetMissingisotope(void) const
are the lower mass peaks missing? Check if a value has been assigned to Missingisotope data member.
bool CanGetMassdiff(void) const
Check if it is safe to call GetMassdiff method.
TMassdiff GetMassdiff(void) const
Get the Massdiff member data.
CSerialObject Tparent
Definition: MSIonAnnot_.hpp:71
void ResetMissingisotope(void)
Reset Missingisotope data member.
TMissingisotope GetMissingisotope(void) const
Get the Missingisotope member data.
CMSIonAnnot_Base & operator=(const CMSIonAnnot_Base &)
TMassdiff & SetMassdiff(void)
Assign a value to Massdiff data member.
CMSIonAnnot_Base(const CMSIonAnnot_Base &)
Uint4 m_set_State[1]
void ResetSuspect(void)
Reset Suspect data member.
TSuspect GetSuspect(void) const
Get the Suspect member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Mon Jun 17 05:08:18 2024 by modify_doxy.py rev. 669887