NCBI C++ ToolKit
Asapratio_contribution_.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 Asapratio_contribution_.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/algo/ms/formats/pepxml/pepXML.xsd">pepXML.xsd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/algo/ms/formats/pepxml/pepXML.def">pepXML.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 ALGO_MS_FORMATS_PEPXML_ASAPRATIO_CONTRIBUTION_BASE_HPP
42 #define ALGO_MS_FORMATS_PEPXML_ASAPRATIO_CONTRIBUTION_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 // forward declarations
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_pepXML
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///
70 /// CAsapratio_contribution_Base --
71 ///
72 
74 {
76 public:
77  // constructor
79  // destructor
80  virtual ~CAsapratio_contribution_Base(void);
81 
82  // type info
84 
85  /////////////////////////////////////////////////////////////////////////////
86  ///
87  /// C_Attlist --
88  ///
89 
91  {
93  public:
94  // constructor
95  C_Attlist(void);
96  // destructor
97  ~C_Attlist(void);
98 
99  // type info
101 
102  // types
103  typedef double TRatio;
104  typedef double TError;
105  typedef int TCharge;
106  typedef int TUse;
107 
108  // member index
109  enum class E_memberIndex {
110  e__allMandatory = 0,
111  e_ratio,
112  e_error,
113  e_charge,
114  e_use
115  };
117 
118  // getters
119  // setters
120 
121  /// Check if a value has been assigned to Ratio data member.
122  ///
123  /// Data member Ratio is mandatory;
124  /// its type is defined as 'typedef double TRatio'
125  /// @return
126  /// - true, if a value has been assigned.
127  /// - false, otherwise.
128  bool IsSetRatio(void) const;
129 
130  /// Check if it is safe to call GetRatio method.
131  ///
132  /// @return
133  /// - true, if the data member is getatable.
134  /// - false, otherwise.
135  bool CanGetRatio(void) const;
136 
137  /// Reset Ratio data member.
138  void ResetRatio(void);
139 
140  /// Get the Ratio member data.
141  ///
142  /// @return
143  /// Copy of the member data.
144  TRatio GetRatio(void) const;
145 
146  /// Assign a value to Ratio data member.
147  ///
148  /// @param value
149  /// Value to assign
150  void SetRatio(TRatio value);
151 
152  /// Assign a value to Ratio data member.
153  ///
154  /// @return
155  /// Reference to the data value.
156  TRatio& SetRatio(void);
157 
158  /// Check if a value has been assigned to Error data member.
159  ///
160  /// Data member Error is mandatory;
161  /// its type is defined as 'typedef double TError'
162  /// @return
163  /// - true, if a value has been assigned.
164  /// - false, otherwise.
165  bool IsSetError(void) const;
166 
167  /// Check if it is safe to call GetError method.
168  ///
169  /// @return
170  /// - true, if the data member is getatable.
171  /// - false, otherwise.
172  bool CanGetError(void) const;
173 
174  /// Reset Error data member.
175  void ResetError(void);
176 
177  /// Get the Error member data.
178  ///
179  /// @return
180  /// Copy of the member data.
181  TError GetError(void) const;
182 
183  /// Assign a value to Error data member.
184  ///
185  /// @param value
186  /// Value to assign
187  void SetError(TError value);
188 
189  /// Assign a value to Error data member.
190  ///
191  /// @return
192  /// Reference to the data value.
193  TError& SetError(void);
194 
195  /// Check if a value has been assigned to Charge data member.
196  ///
197  /// Data member Charge is mandatory;
198  /// its type is defined as 'typedef int TCharge'
199  /// @return
200  /// - true, if a value has been assigned.
201  /// - false, otherwise.
202  bool IsSetCharge(void) const;
203 
204  /// Check if it is safe to call GetCharge method.
205  ///
206  /// @return
207  /// - true, if the data member is getatable.
208  /// - false, otherwise.
209  bool CanGetCharge(void) const;
210 
211  /// Reset Charge data member.
212  void ResetCharge(void);
213 
214  /// Get the Charge member data.
215  ///
216  /// @return
217  /// Copy of the member data.
218  TCharge GetCharge(void) const;
219 
220  /// Assign a value to Charge data member.
221  ///
222  /// @param value
223  /// Value to assign
224  void SetCharge(TCharge value);
225 
226  /// Assign a value to Charge data member.
227  ///
228  /// @return
229  /// Reference to the data value.
230  TCharge& SetCharge(void);
231 
232  /// Check if a value has been assigned to Use data member.
233  ///
234  /// Data member Use is mandatory;
235  /// its type is defined as 'typedef int TUse'
236  /// @return
237  /// - true, if a value has been assigned.
238  /// - false, otherwise.
239  bool IsSetUse(void) const;
240 
241  /// Check if it is safe to call GetUse method.
242  ///
243  /// @return
244  /// - true, if the data member is getatable.
245  /// - false, otherwise.
246  bool CanGetUse(void) const;
247 
248  /// Reset Use data member.
249  void ResetUse(void);
250 
251  /// Get the Use member data.
252  ///
253  /// @return
254  /// Copy of the member data.
255  TUse GetUse(void) const;
256 
257  /// Assign a value to Use data member.
258  ///
259  /// @param value
260  /// Value to assign
261  void SetUse(TUse value);
262 
263  /// Assign a value to Use data member.
264  ///
265  /// @return
266  /// Reference to the data value.
267  TUse& SetUse(void);
268 
269  /// Reset the whole object
270  void Reset(void);
271 
272 
273  private:
274  // Prohibit copy constructor and assignment operator
277 
278  // data
279  Uint4 m_set_State[1];
280  double m_Ratio;
281  double m_Error;
282  int m_Charge;
283  int m_Use;
284  };
285  // types
289 
290  // member index
291  enum class E_memberIndex {
292  e__allMandatory = 0,
293  e_Attlist,
294  e_asapratio_lc_lightpeak,
295  e_asapratio_lc_heavypeak
296  };
298 
299  // getters
300  // setters
301 
302  /// Check if a value has been assigned to Attlist data member.
303  ///
304  /// Data member Attlist is mandatory;
305  /// its type is defined as 'typedef C_Attlist TAttlist'
306  /// @return
307  /// - true, if a value has been assigned.
308  /// - false, otherwise.
309  bool IsSetAttlist(void) const;
310 
311  /// Check if it is safe to call GetAttlist method.
312  ///
313  /// @return
314  /// - true, if the data member is getatable.
315  /// - false, otherwise.
316  bool CanGetAttlist(void) const;
317 
318  /// Reset Attlist data member.
319  void ResetAttlist(void);
320 
321  /// Get the Attlist member data.
322  ///
323  /// @return
324  /// Reference to the member data.
325  const TAttlist& GetAttlist(void) const;
326 
327  /// Assign a value to Attlist data member.
328  ///
329  /// @param value
330  /// Reference to value.
331  void SetAttlist(TAttlist& value);
332 
333  /// Assign a value to Attlist data member.
334  ///
335  /// @return
336  /// Reference to the data value.
337  TAttlist& SetAttlist(void);
338 
339  /// Check if a value has been assigned to Asapratio_lc_lightpeak data member.
340  ///
341  /// Data member Asapratio_lc_lightpeak is mandatory;
342  /// its type is defined as 'typedef CAsapratio_lc_lightpeak TAsapratio_lc_lightpeak'
343  /// @return
344  /// - true, if a value has been assigned.
345  /// - false, otherwise.
346  bool IsSetAsapratio_lc_lightpeak(void) const;
347 
348  /// Check if value of Asapratio_lc_lightpeak member is getatable.
349  ///
350  /// @return
351  /// - false; the data member of type 'NULL' has no value.
352  bool CanGetAsapratio_lc_lightpeak(void) const;
353 
354  /// Reset Asapratio_lc_lightpeak data member.
355  void ResetAsapratio_lc_lightpeak(void);
356 
357  /// Get the Asapratio_lc_lightpeak member data.
358  ///
359  /// @return
360  /// Reference to the member data.
361  const TAsapratio_lc_lightpeak& GetAsapratio_lc_lightpeak(void) const;
362 
363  /// Assign a value to Asapratio_lc_lightpeak data member.
364  ///
365  /// @param value
366  /// Reference to value.
367  void SetAsapratio_lc_lightpeak(TAsapratio_lc_lightpeak& value);
368 
369  /// Assign a value to Asapratio_lc_lightpeak data member.
370  ///
371  /// @return
372  /// Reference to the data value.
373  TAsapratio_lc_lightpeak& SetAsapratio_lc_lightpeak(void);
374 
375  /// Check if a value has been assigned to Asapratio_lc_heavypeak data member.
376  ///
377  /// Data member Asapratio_lc_heavypeak is mandatory;
378  /// its type is defined as 'typedef CAsapratio_lc_heavypeak TAsapratio_lc_heavypeak'
379  /// @return
380  /// - true, if a value has been assigned.
381  /// - false, otherwise.
382  bool IsSetAsapratio_lc_heavypeak(void) const;
383 
384  /// Check if value of Asapratio_lc_heavypeak member is getatable.
385  ///
386  /// @return
387  /// - false; the data member of type 'NULL' has no value.
388  bool CanGetAsapratio_lc_heavypeak(void) const;
389 
390  /// Reset Asapratio_lc_heavypeak data member.
391  void ResetAsapratio_lc_heavypeak(void);
392 
393  /// Get the Asapratio_lc_heavypeak member data.
394  ///
395  /// @return
396  /// Reference to the member data.
397  const TAsapratio_lc_heavypeak& GetAsapratio_lc_heavypeak(void) const;
398 
399  /// Assign a value to Asapratio_lc_heavypeak data member.
400  ///
401  /// @param value
402  /// Reference to value.
403  void SetAsapratio_lc_heavypeak(TAsapratio_lc_heavypeak& value);
404 
405  /// Assign a value to Asapratio_lc_heavypeak data member.
406  ///
407  /// @return
408  /// Reference to the data value.
409  TAsapratio_lc_heavypeak& SetAsapratio_lc_heavypeak(void);
410 
411  /// Reset the whole object
412  virtual void Reset(void);
413 
414 
415 private:
416  // Prohibit copy constructor and assignment operator
419 
420  // data
421  Uint4 m_set_State[1];
425 };
426 
427 /* @} */
428 
429 
430 
431 
432 
433 ///////////////////////////////////////////////////////////
434 ///////////////////// inline methods //////////////////////
435 ///////////////////////////////////////////////////////////
436 inline
438 {
439  return ((m_set_State[0] & 0x3) != 0);
440 }
441 
442 inline
444 {
445  return IsSetRatio();
446 }
447 
448 inline
450 {
451  m_Ratio = 0;
452  m_set_State[0] &= ~0x3;
453 }
454 
455 inline
457 {
458  if (!CanGetRatio()) {
459  ThrowUnassigned(0);
460  }
461  return m_Ratio;
462 }
463 
464 inline
466 {
467  m_Ratio = value;
468  m_set_State[0] |= 0x3;
469 }
470 
471 inline
473 {
474 #ifdef _DEBUG
475  if (!IsSetRatio()) {
476  memset(&m_Ratio,UnassignedByte(),sizeof(m_Ratio));
477  }
478 #endif
479  m_set_State[0] |= 0x1;
480  return m_Ratio;
481 }
482 
483 inline
485 {
486  return ((m_set_State[0] & 0xc) != 0);
487 }
488 
489 inline
491 {
492  return IsSetError();
493 }
494 
495 inline
497 {
498  m_Error = 0;
499  m_set_State[0] &= ~0xc;
500 }
501 
502 inline
504 {
505  if (!CanGetError()) {
506  ThrowUnassigned(1);
507  }
508  return m_Error;
509 }
510 
511 inline
513 {
514  m_Error = value;
515  m_set_State[0] |= 0xc;
516 }
517 
518 inline
520 {
521 #ifdef _DEBUG
522  if (!IsSetError()) {
523  memset(&m_Error,UnassignedByte(),sizeof(m_Error));
524  }
525 #endif
526  m_set_State[0] |= 0x4;
527  return m_Error;
528 }
529 
530 inline
532 {
533  return ((m_set_State[0] & 0x30) != 0);
534 }
535 
536 inline
538 {
539  return IsSetCharge();
540 }
541 
542 inline
544 {
545  m_Charge = 0;
546  m_set_State[0] &= ~0x30;
547 }
548 
549 inline
551 {
552  if (!CanGetCharge()) {
553  ThrowUnassigned(2);
554  }
555  return m_Charge;
556 }
557 
558 inline
560 {
561  m_Charge = value;
562  m_set_State[0] |= 0x30;
563 }
564 
565 inline
567 {
568 #ifdef _DEBUG
569  if (!IsSetCharge()) {
570  memset(&m_Charge,UnassignedByte(),sizeof(m_Charge));
571  }
572 #endif
573  m_set_State[0] |= 0x10;
574  return m_Charge;
575 }
576 
577 inline
579 {
580  return ((m_set_State[0] & 0xc0) != 0);
581 }
582 
583 inline
585 {
586  return IsSetUse();
587 }
588 
589 inline
591 {
592  m_Use = 0;
593  m_set_State[0] &= ~0xc0;
594 }
595 
596 inline
598 {
599  if (!CanGetUse()) {
600  ThrowUnassigned(3);
601  }
602  return m_Use;
603 }
604 
605 inline
607 {
608  m_Use = value;
609  m_set_State[0] |= 0xc0;
610 }
611 
612 inline
614 {
615 #ifdef _DEBUG
616  if (!IsSetUse()) {
617  memset(&m_Use,UnassignedByte(),sizeof(m_Use));
618  }
619 #endif
620  m_set_State[0] |= 0x40;
621  return m_Use;
622 }
623 
624 inline
626 {
627  return m_Attlist.NotEmpty();
628 }
629 
630 inline
632 {
633  return true;
634 }
635 
636 inline
638 {
639  if ( !m_Attlist ) {
640  const_cast<CAsapratio_contribution_Base*>(this)->ResetAttlist();
641  }
642  return (*m_Attlist);
643 }
644 
645 inline
647 {
648  if ( !m_Attlist ) {
649  ResetAttlist();
650  }
651  return (*m_Attlist);
652 }
653 
654 inline
656 {
657  return true;
658 }
659 
660 inline
662 {
663  if ( !m_Asapratio_lc_lightpeak ) {
665  }
666  return (*m_Asapratio_lc_lightpeak);
667 }
668 
669 inline
671 {
672  return true;
673 }
674 
675 inline
677 {
678  if ( !m_Asapratio_lc_heavypeak ) {
680  }
681  return (*m_Asapratio_lc_heavypeak);
682 }
683 
684 ///////////////////////////////////////////////////////////
685 ////////////////// end of inline methods //////////////////
686 ///////////////////////////////////////////////////////////
687 
688 
689 
690 
691 
692 END_objects_SCOPE // namespace ncbi::objects::
693 
695 
696 
697 #endif // ALGO_MS_FORMATS_PEPXML_ASAPRATIO_CONTRIBUTION_BASE_HPP
CAsapratio_contribution_Base –.
CAsapratio_lc_heavypeak –.
CAsapratio_lc_lightpeak –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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_PEPXML_EXPORT
Definition: ncbi_export.h:696
bool IsSetCharge(void) const
Check if a value has been assigned to Charge data member.
bool CanGetUse(void) const
Check if it is safe to call GetUse method.
CAsapratio_lc_lightpeak TAsapratio_lc_lightpeak
CAsapratio_contribution_Base & operator=(const CAsapratio_contribution_Base &)
TCharge GetCharge(void) const
Get the Charge member data.
bool CanGetCharge(void) const
Check if it is safe to call GetCharge method.
void ResetError(void)
Reset Error data member.
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
CRef< TAsapratio_lc_heavypeak > m_Asapratio_lc_heavypeak
void ResetAttlist(void)
Reset Attlist data member.
bool IsSetUse(void) const
Check if a value has been assigned to Use data member.
void ResetAsapratio_lc_heavypeak(void)
Reset Asapratio_lc_heavypeak data member.
void ResetCharge(void)
Reset Charge data member.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
TUse GetUse(void) const
Get the Use member data.
CRef< TAsapratio_lc_lightpeak > m_Asapratio_lc_lightpeak
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
void ResetAsapratio_lc_lightpeak(void)
Reset Asapratio_lc_lightpeak data member.
TCharge & SetCharge(void)
Assign a value to Charge data member.
bool CanGetError(void) const
Check if it is safe to call GetError method.
TRatio GetRatio(void) const
Get the Ratio member data.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
C_Attlist & operator=(const C_Attlist &)
CAsapratio_contribution_Base(const CAsapratio_contribution_Base &)
TError GetError(void) const
Get the Error member data.
const TAsapratio_lc_lightpeak & GetAsapratio_lc_lightpeak(void) const
Get the Asapratio_lc_lightpeak member data.
TRatio & SetRatio(void)
Assign a value to Ratio data member.
void ResetRatio(void)
Reset Ratio data member.
bool CanGetAsapratio_lc_heavypeak(void) const
Check if value of Asapratio_lc_heavypeak member is getatable.
const TAsapratio_lc_heavypeak & GetAsapratio_lc_heavypeak(void) const
Get the Asapratio_lc_heavypeak member data.
bool CanGetAsapratio_lc_lightpeak(void) const
Check if value of Asapratio_lc_lightpeak member is getatable.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
CAsapratio_lc_heavypeak TAsapratio_lc_heavypeak
bool IsSetRatio(void) const
Check if a value has been assigned to Ratio data member.
TUse & SetUse(void)
Assign a value to Use data member.
bool CanGetRatio(void) const
Check if it is safe to call GetRatio method.
TError & SetError(void)
Assign a value to Error data member.
bool IsSetError(void) const
Check if a value has been assigned to Error data member.
int GetCharge(char code)
Modified on Sat Dec 02 09:24:13 2023 by modify_doxy.py rev. 669887