NCBI C++ ToolKit
MSMZHit_.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 MSMZHit_.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_MSMZHIT_BASE_HPP
42 #define OBJECTS_OMSSA_MSMZHIT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // forward declarations
60 class CMSIon;
61 class CMSIonAnnot;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_OMSSA
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 /// defines a particular ion
74 ///
75 /// CMSMZHit_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CMSMZHit_Base(void);
84  // destructor
85  virtual ~CMSMZHit_Base(void);
86 
87  // type info
89 
90  // types
91  typedef int TIon;
92  typedef int TCharge;
93  typedef int TNumber;
94  typedef int TMz;
95  typedef int TIndex;
96  typedef CMSIon TMoreion;
98 
99  // member index
100  enum class E_memberIndex {
101  e__allMandatory = 0,
102  e_ion,
103  e_charge,
104  e_number,
105  e_mz,
106  e_index,
107  e_moreion,
108  e_annotation
109  };
111 
112  // getters
113  // setters
114 
115  /// ion type, e.g. b
116  /// Check if a value has been assigned to Ion data member.
117  ///
118  /// Data member Ion is mandatory;
119  /// its type is defined as 'typedef int TIon'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetIon(void) const;
124 
125  /// Check if it is safe to call GetIon method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetIon(void) const;
131 
132  /// Reset Ion data member.
133  void ResetIon(void);
134 
135  /// Get the Ion member data.
136  ///
137  /// @return
138  /// Copy of the member data.
139  TIon GetIon(void) const;
140 
141  /// Assign a value to Ion data member.
142  ///
143  /// @param value
144  /// Value to assign
145  void SetIon(TIon value);
146 
147  /// Assign a value to Ion data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TIon& SetIon(void);
152 
153  /// ion charge
154  /// Check if a value has been assigned to Charge data member.
155  ///
156  /// Data member Charge is mandatory;
157  /// its type is defined as 'typedef int TCharge'
158  /// @return
159  /// - true, if a value has been assigned.
160  /// - false, otherwise.
161  bool IsSetCharge(void) const;
162 
163  /// Check if it is safe to call GetCharge method.
164  ///
165  /// @return
166  /// - true, if the data member is getatable.
167  /// - false, otherwise.
168  bool CanGetCharge(void) const;
169 
170  /// Reset Charge data member.
171  void ResetCharge(void);
172 
173  /// Get the Charge member data.
174  ///
175  /// @return
176  /// Copy of the member data.
177  TCharge GetCharge(void) const;
178 
179  /// Assign a value to Charge data member.
180  ///
181  /// @param value
182  /// Value to assign
183  void SetCharge(TCharge value);
184 
185  /// Assign a value to Charge data member.
186  ///
187  /// @return
188  /// Reference to the data value.
189  TCharge& SetCharge(void);
190 
191  /// the sequential number of the ion
192  /// Check if a value has been assigned to Number data member.
193  ///
194  /// Data member Number is mandatory;
195  /// its type is defined as 'typedef int TNumber'
196  /// @return
197  /// - true, if a value has been assigned.
198  /// - false, otherwise.
199  bool IsSetNumber(void) const;
200 
201  /// Check if it is safe to call GetNumber method.
202  ///
203  /// @return
204  /// - true, if the data member is getatable.
205  /// - false, otherwise.
206  bool CanGetNumber(void) const;
207 
208  /// Reset Number data member.
209  void ResetNumber(void);
210 
211  /// Get the Number member data.
212  ///
213  /// @return
214  /// Copy of the member data.
215  TNumber GetNumber(void) const;
216 
217  /// Assign a value to Number data member.
218  ///
219  /// @param value
220  /// Value to assign
221  void SetNumber(TNumber value);
222 
223  /// Assign a value to Number data member.
224  ///
225  /// @return
226  /// Reference to the data value.
227  TNumber& SetNumber(void);
228 
229  /// scaled m/z value in Da
230  /// Check if a value has been assigned to Mz data member.
231  ///
232  /// Data member Mz is mandatory;
233  /// its type is defined as 'typedef int TMz'
234  /// @return
235  /// - true, if a value has been assigned.
236  /// - false, otherwise.
237  bool IsSetMz(void) const;
238 
239  /// Check if it is safe to call GetMz method.
240  ///
241  /// @return
242  /// - true, if the data member is getatable.
243  /// - false, otherwise.
244  bool CanGetMz(void) const;
245 
246  /// Reset Mz data member.
247  void ResetMz(void);
248 
249  /// Get the Mz member data.
250  ///
251  /// @return
252  /// Copy of the member data.
253  TMz GetMz(void) const;
254 
255  /// Assign a value to Mz data member.
256  ///
257  /// @param value
258  /// Value to assign
259  void SetMz(TMz value);
260 
261  /// Assign a value to Mz data member.
262  ///
263  /// @return
264  /// Reference to the data value.
265  TMz& SetMz(void);
266 
267  /// the index of the peak in the original spectrum
268  /// Check if a value has been assigned to Index data member.
269  ///
270  /// Data member Index is optional;
271  /// its type is defined as 'typedef int TIndex'
272  /// @return
273  /// - true, if a value has been assigned.
274  /// - false, otherwise.
275  bool IsSetIndex(void) const;
276 
277  /// Check if it is safe to call GetIndex method.
278  ///
279  /// @return
280  /// - true, if the data member is getatable.
281  /// - false, otherwise.
282  bool CanGetIndex(void) const;
283 
284  /// Reset Index data member.
285  void ResetIndex(void);
286 
287  /// Get the Index member data.
288  ///
289  /// @return
290  /// Copy of the member data.
291  TIndex GetIndex(void) const;
292 
293  /// Assign a value to Index data member.
294  ///
295  /// @param value
296  /// Value to assign
297  void SetIndex(TIndex value);
298 
299  /// Assign a value to Index data member.
300  ///
301  /// @return
302  /// Reference to the data value.
303  TIndex& SetIndex(void);
304 
305  /// more information about the ion type
306  /// Check if a value has been assigned to Moreion data member.
307  ///
308  /// Data member Moreion is optional;
309  /// its type is defined as 'typedef CMSIon TMoreion'
310  /// @return
311  /// - true, if a value has been assigned.
312  /// - false, otherwise.
313  bool IsSetMoreion(void) const;
314 
315  /// Check if it is safe to call GetMoreion method.
316  ///
317  /// @return
318  /// - true, if the data member is getatable.
319  /// - false, otherwise.
320  bool CanGetMoreion(void) const;
321 
322  /// Reset Moreion data member.
323  void ResetMoreion(void);
324 
325  /// Get the Moreion member data.
326  ///
327  /// @return
328  /// Reference to the member data.
329  const TMoreion& GetMoreion(void) const;
330 
331  /// Assign a value to Moreion data member.
332  ///
333  /// @param value
334  /// Reference to value.
335  void SetMoreion(TMoreion& value);
336 
337  /// Assign a value to Moreion data member.
338  ///
339  /// @return
340  /// Reference to the data value.
341  TMoreion& SetMoreion(void);
342 
343  /// annotations on the ion
344  /// Check if a value has been assigned to Annotation data member.
345  ///
346  /// Data member Annotation is optional;
347  /// its type is defined as 'typedef CMSIonAnnot TAnnotation'
348  /// @return
349  /// - true, if a value has been assigned.
350  /// - false, otherwise.
351  bool IsSetAnnotation(void) const;
352 
353  /// Check if it is safe to call GetAnnotation method.
354  ///
355  /// @return
356  /// - true, if the data member is getatable.
357  /// - false, otherwise.
358  bool CanGetAnnotation(void) const;
359 
360  /// Reset Annotation data member.
361  void ResetAnnotation(void);
362 
363  /// Get the Annotation member data.
364  ///
365  /// @return
366  /// Reference to the member data.
367  const TAnnotation& GetAnnotation(void) const;
368 
369  /// Assign a value to Annotation data member.
370  ///
371  /// @param value
372  /// Reference to value.
373  void SetAnnotation(TAnnotation& value);
374 
375  /// Assign a value to Annotation data member.
376  ///
377  /// @return
378  /// Reference to the data value.
379  TAnnotation& SetAnnotation(void);
380 
381  /// Reset the whole object
382  virtual void Reset(void);
383 
384 
385 private:
386  // Prohibit copy constructor and assignment operator
389 
390  // data
391  Uint4 m_set_State[1];
392  int m_Ion;
393  int m_Charge;
394  int m_Number;
395  int m_Mz;
396  int m_Index;
399 };
400 
401 /* @} */
402 
403 
404 
405 
406 
407 ///////////////////////////////////////////////////////////
408 ///////////////////// inline methods //////////////////////
409 ///////////////////////////////////////////////////////////
410 inline
411 bool CMSMZHit_Base::IsSetIon(void) const
412 {
413  return ((m_set_State[0] & 0x3) != 0);
414 }
415 
416 inline
417 bool CMSMZHit_Base::CanGetIon(void) const
418 {
419  return IsSetIon();
420 }
421 
422 inline
424 {
425  m_Ion = (int)(0);
426  m_set_State[0] &= ~0x3;
427 }
428 
429 inline
431 {
432  if (!CanGetIon()) {
433  ThrowUnassigned(0);
434  }
435  return m_Ion;
436 }
437 
438 inline
440 {
441  m_Ion = value;
442  m_set_State[0] |= 0x3;
443 }
444 
445 inline
447 {
448 #ifdef _DEBUG
449  if (!IsSetIon()) {
450  memset(&m_Ion,UnassignedByte(),sizeof(m_Ion));
451  }
452 #endif
453  m_set_State[0] |= 0x1;
454  return m_Ion;
455 }
456 
457 inline
459 {
460  return ((m_set_State[0] & 0xc) != 0);
461 }
462 
463 inline
465 {
466  return IsSetCharge();
467 }
468 
469 inline
471 {
472  m_Charge = 0;
473  m_set_State[0] &= ~0xc;
474 }
475 
476 inline
478 {
479  if (!CanGetCharge()) {
480  ThrowUnassigned(1);
481  }
482  return m_Charge;
483 }
484 
485 inline
487 {
488  m_Charge = value;
489  m_set_State[0] |= 0xc;
490 }
491 
492 inline
494 {
495 #ifdef _DEBUG
496  if (!IsSetCharge()) {
497  memset(&m_Charge,UnassignedByte(),sizeof(m_Charge));
498  }
499 #endif
500  m_set_State[0] |= 0x4;
501  return m_Charge;
502 }
503 
504 inline
506 {
507  return ((m_set_State[0] & 0x30) != 0);
508 }
509 
510 inline
512 {
513  return IsSetNumber();
514 }
515 
516 inline
518 {
519  m_Number = 0;
520  m_set_State[0] &= ~0x30;
521 }
522 
523 inline
525 {
526  if (!CanGetNumber()) {
527  ThrowUnassigned(2);
528  }
529  return m_Number;
530 }
531 
532 inline
534 {
535  m_Number = value;
536  m_set_State[0] |= 0x30;
537 }
538 
539 inline
541 {
542 #ifdef _DEBUG
543  if (!IsSetNumber()) {
544  memset(&m_Number,UnassignedByte(),sizeof(m_Number));
545  }
546 #endif
547  m_set_State[0] |= 0x10;
548  return m_Number;
549 }
550 
551 inline
552 bool CMSMZHit_Base::IsSetMz(void) const
553 {
554  return ((m_set_State[0] & 0xc0) != 0);
555 }
556 
557 inline
558 bool CMSMZHit_Base::CanGetMz(void) const
559 {
560  return IsSetMz();
561 }
562 
563 inline
565 {
566  m_Mz = 0;
567  m_set_State[0] &= ~0xc0;
568 }
569 
570 inline
572 {
573  if (!CanGetMz()) {
574  ThrowUnassigned(3);
575  }
576  return m_Mz;
577 }
578 
579 inline
581 {
582  m_Mz = value;
583  m_set_State[0] |= 0xc0;
584 }
585 
586 inline
588 {
589 #ifdef _DEBUG
590  if (!IsSetMz()) {
591  memset(&m_Mz,UnassignedByte(),sizeof(m_Mz));
592  }
593 #endif
594  m_set_State[0] |= 0x40;
595  return m_Mz;
596 }
597 
598 inline
600 {
601  return ((m_set_State[0] & 0x300) != 0);
602 }
603 
604 inline
606 {
607  return IsSetIndex();
608 }
609 
610 inline
612 {
613  m_Index = 0;
614  m_set_State[0] &= ~0x300;
615 }
616 
617 inline
619 {
620  if (!CanGetIndex()) {
621  ThrowUnassigned(4);
622  }
623  return m_Index;
624 }
625 
626 inline
628 {
629  m_Index = value;
630  m_set_State[0] |= 0x300;
631 }
632 
633 inline
635 {
636 #ifdef _DEBUG
637  if (!IsSetIndex()) {
638  memset(&m_Index,UnassignedByte(),sizeof(m_Index));
639  }
640 #endif
641  m_set_State[0] |= 0x100;
642  return m_Index;
643 }
644 
645 inline
647 {
648  return m_Moreion.NotEmpty();
649 }
650 
651 inline
653 {
654  return IsSetMoreion();
655 }
656 
657 inline
659 {
660  if (!CanGetMoreion()) {
661  ThrowUnassigned(5);
662  }
663  return (*m_Moreion);
664 }
665 
666 inline
668 {
669  return m_Annotation.NotEmpty();
670 }
671 
672 inline
674 {
675  return IsSetAnnotation();
676 }
677 
678 inline
680 {
681  if (!CanGetAnnotation()) {
682  ThrowUnassigned(6);
683  }
684  return (*m_Annotation);
685 }
686 
687 ///////////////////////////////////////////////////////////
688 ////////////////// end of inline methods //////////////////
689 ///////////////////////////////////////////////////////////
690 
691 
692 
693 
694 
695 END_objects_SCOPE // namespace ncbi::objects::
696 
698 
699 
700 #endif // OBJECTS_OMSSA_MSMZHIT_BASE_HPP
CMSIonAnnot –.
Definition: MSIonAnnot.hpp:66
CMSIon –.
Definition: MSIon.hpp:66
defines a particular ion
Definition: MSMZHit_.hpp:79
CRef –.
Definition: ncbiobj.hpp:618
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
void ResetNumber(void)
Reset Number data member.
Definition: MSMZHit_.hpp:517
bool IsSetIndex(void) const
the index of the peak in the original spectrum Check if a value has been assigned to Index data membe...
Definition: MSMZHit_.hpp:599
TIndex & SetIndex(void)
Assign a value to Index data member.
Definition: MSMZHit_.hpp:634
CSerialObject Tparent
Definition: MSMZHit_.hpp:80
Uint4 m_set_State[1]
Definition: MSMZHit_.hpp:391
bool CanGetCharge(void) const
Check if it is safe to call GetCharge method.
Definition: MSMZHit_.hpp:464
TIon GetIon(void) const
Get the Ion member data.
Definition: MSMZHit_.hpp:430
bool IsSetNumber(void) const
the sequential number of the ion Check if a value has been assigned to Number data member.
Definition: MSMZHit_.hpp:505
bool IsSetCharge(void) const
ion charge Check if a value has been assigned to Charge data member.
Definition: MSMZHit_.hpp:458
bool IsSetMoreion(void) const
more information about the ion type Check if a value has been assigned to Moreion data member.
Definition: MSMZHit_.hpp:646
TCharge GetCharge(void) const
Get the Charge member data.
Definition: MSMZHit_.hpp:477
CMSMZHit_Base & operator=(const CMSMZHit_Base &)
CMSIon TMoreion
Definition: MSMZHit_.hpp:96
bool CanGetNumber(void) const
Check if it is safe to call GetNumber method.
Definition: MSMZHit_.hpp:511
bool IsSetIon(void) const
ion type, e.g.
Definition: MSMZHit_.hpp:411
bool IsSetMz(void) const
scaled m/z value in Da Check if a value has been assigned to Mz data member.
Definition: MSMZHit_.hpp:552
CRef< TMoreion > m_Moreion
Definition: MSMZHit_.hpp:397
bool IsSetAnnotation(void) const
annotations on the ion Check if a value has been assigned to Annotation data member.
Definition: MSMZHit_.hpp:667
TNumber & SetNumber(void)
Assign a value to Number data member.
Definition: MSMZHit_.hpp:540
void ResetIndex(void)
Reset Index data member.
Definition: MSMZHit_.hpp:611
const TMoreion & GetMoreion(void) const
Get the Moreion member data.
Definition: MSMZHit_.hpp:658
bool CanGetMoreion(void) const
Check if it is safe to call GetMoreion method.
Definition: MSMZHit_.hpp:652
TMz & SetMz(void)
Assign a value to Mz data member.
Definition: MSMZHit_.hpp:587
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
Definition: MSMZHit_.hpp:110
void ResetMz(void)
Reset Mz data member.
Definition: MSMZHit_.hpp:564
CRef< TAnnotation > m_Annotation
Definition: MSMZHit_.hpp:398
TIndex GetIndex(void) const
Get the Index member data.
Definition: MSMZHit_.hpp:618
void ResetIon(void)
Reset Ion data member.
Definition: MSMZHit_.hpp:423
void ResetCharge(void)
Reset Charge data member.
Definition: MSMZHit_.hpp:470
CMSMZHit_Base(const CMSMZHit_Base &)
TMz GetMz(void) const
Get the Mz member data.
Definition: MSMZHit_.hpp:571
TIon & SetIon(void)
Assign a value to Ion data member.
Definition: MSMZHit_.hpp:446
const TAnnotation & GetAnnotation(void) const
Get the Annotation member data.
Definition: MSMZHit_.hpp:679
bool CanGetAnnotation(void) const
Check if it is safe to call GetAnnotation method.
Definition: MSMZHit_.hpp:673
TCharge & SetCharge(void)
Assign a value to Charge data member.
Definition: MSMZHit_.hpp:493
CMSIonAnnot TAnnotation
Definition: MSMZHit_.hpp:97
TNumber GetNumber(void) const
Get the Number member data.
Definition: MSMZHit_.hpp:524
bool CanGetIon(void) const
Check if it is safe to call GetIon method.
Definition: MSMZHit_.hpp:417
DECLARE_INTERNAL_TYPE_INFO()
bool CanGetMz(void) const
Check if it is safe to call GetMz method.
Definition: MSMZHit_.hpp:558
bool CanGetIndex(void) const
Check if it is safe to call GetIndex method.
Definition: MSMZHit_.hpp:605
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int GetCharge(char code)
Modified on Fri Sep 20 14:57:49 2024 by modify_doxy.py rev. 669887