NCBI C++ ToolKit
Statistics_.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 Statistics_.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/blastxml/blastxml.asn">blastxml.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/blastxml/blastxml.def">blastxml.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_BLASTXML_STATISTICS_BASE_HPP
42 #define OBJECTS_BLASTXML_STATISTICS_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_NCBI_BlastOutput
59  *
60  * @{
61  */
62 
63 /////////////////////////////////////////////////////////////////////////////
64 ///
65 /// CStatistics_Base --
66 ///
67 
69 {
71 public:
72  // constructor
73  CStatistics_Base(void);
74  // destructor
75  virtual ~CStatistics_Base(void);
76 
77  // type info
79 
80  // types
81  typedef int TDb_num;
82  typedef Int8 TDb_len;
83  typedef int THsp_len;
84  typedef double TEff_space;
85  typedef double TKappa;
86  typedef double TLambda;
87  typedef double TEntropy;
88 
89  // member index
90  enum class E_memberIndex {
91  e__allMandatory = 0,
92  e_db_num,
93  e_db_len,
94  e_hsp_len,
95  e_eff_space,
96  e_kappa,
97  e_lambda,
98  e_entropy
99  };
101 
102  // getters
103  // setters
104 
105  /// Number of sequences in BLAST db
106  /// Check if a value has been assigned to Db_num data member.
107  ///
108  /// Data member Db_num is mandatory;
109  /// its type is defined as 'typedef int TDb_num'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetDb_num(void) const;
114 
115  /// Check if it is safe to call GetDb_num method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetDb_num(void) const;
121 
122  /// Reset Db_num data member.
123  void ResetDb_num(void);
124 
125  /// Get the Db_num member data.
126  ///
127  /// @return
128  /// Copy of the member data.
129  TDb_num GetDb_num(void) const;
130 
131  /// Assign a value to Db_num data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetDb_num(TDb_num value);
136 
137  /// Assign a value to Db_num data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TDb_num& SetDb_num(void);
142 
143  /// Length of BLAST db
144  /// Check if a value has been assigned to Db_len data member.
145  ///
146  /// Data member Db_len is mandatory;
147  /// its type is defined as 'typedef Int8 TDb_len'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetDb_len(void) const;
152 
153  /// Check if it is safe to call GetDb_len method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetDb_len(void) const;
159 
160  /// Reset Db_len data member.
161  void ResetDb_len(void);
162 
163  /// Get the Db_len member data.
164  ///
165  /// @return
166  /// Copy of the member data.
167  TDb_len GetDb_len(void) const;
168 
169  /// Assign a value to Db_len data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetDb_len(TDb_len value);
174 
175  /// Assign a value to Db_len data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TDb_len& SetDb_len(void);
180 
181  /// Effective HSP length
182  /// Check if a value has been assigned to Hsp_len data member.
183  ///
184  /// Data member Hsp_len is mandatory;
185  /// its type is defined as 'typedef int THsp_len'
186  /// @return
187  /// - true, if a value has been assigned.
188  /// - false, otherwise.
189  bool IsSetHsp_len(void) const;
190 
191  /// Check if it is safe to call GetHsp_len method.
192  ///
193  /// @return
194  /// - true, if the data member is getatable.
195  /// - false, otherwise.
196  bool CanGetHsp_len(void) const;
197 
198  /// Reset Hsp_len data member.
199  void ResetHsp_len(void);
200 
201  /// Get the Hsp_len member data.
202  ///
203  /// @return
204  /// Copy of the member data.
205  THsp_len GetHsp_len(void) const;
206 
207  /// Assign a value to Hsp_len data member.
208  ///
209  /// @param value
210  /// Value to assign
211  void SetHsp_len(THsp_len value);
212 
213  /// Assign a value to Hsp_len data member.
214  ///
215  /// @return
216  /// Reference to the data value.
217  THsp_len& SetHsp_len(void);
218 
219  /// Effective search space
220  /// Check if a value has been assigned to Eff_space data member.
221  ///
222  /// Data member Eff_space is mandatory;
223  /// its type is defined as 'typedef double TEff_space'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetEff_space(void) const;
228 
229  /// Check if it is safe to call GetEff_space method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetEff_space(void) const;
235 
236  /// Reset Eff_space data member.
237  void ResetEff_space(void);
238 
239  /// Get the Eff_space member data.
240  ///
241  /// @return
242  /// Copy of the member data.
243  TEff_space GetEff_space(void) const;
244 
245  /// Assign a value to Eff_space data member.
246  ///
247  /// @param value
248  /// Value to assign
249  void SetEff_space(TEff_space value);
250 
251  /// Assign a value to Eff_space data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  TEff_space& SetEff_space(void);
256 
257  /// Karlin-Altschul parameter K
258  /// Check if a value has been assigned to Kappa data member.
259  ///
260  /// Data member Kappa is mandatory;
261  /// its type is defined as 'typedef double TKappa'
262  /// @return
263  /// - true, if a value has been assigned.
264  /// - false, otherwise.
265  bool IsSetKappa(void) const;
266 
267  /// Check if it is safe to call GetKappa method.
268  ///
269  /// @return
270  /// - true, if the data member is getatable.
271  /// - false, otherwise.
272  bool CanGetKappa(void) const;
273 
274  /// Reset Kappa data member.
275  void ResetKappa(void);
276 
277  /// Get the Kappa member data.
278  ///
279  /// @return
280  /// Copy of the member data.
281  TKappa GetKappa(void) const;
282 
283  /// Assign a value to Kappa data member.
284  ///
285  /// @param value
286  /// Value to assign
287  void SetKappa(TKappa value);
288 
289  /// Assign a value to Kappa data member.
290  ///
291  /// @return
292  /// Reference to the data value.
293  TKappa& SetKappa(void);
294 
295  /// Karlin-Altschul parameter Lambda
296  /// Check if a value has been assigned to Lambda data member.
297  ///
298  /// Data member Lambda is mandatory;
299  /// its type is defined as 'typedef double TLambda'
300  /// @return
301  /// - true, if a value has been assigned.
302  /// - false, otherwise.
303  bool IsSetLambda(void) const;
304 
305  /// Check if it is safe to call GetLambda method.
306  ///
307  /// @return
308  /// - true, if the data member is getatable.
309  /// - false, otherwise.
310  bool CanGetLambda(void) const;
311 
312  /// Reset Lambda data member.
313  void ResetLambda(void);
314 
315  /// Get the Lambda member data.
316  ///
317  /// @return
318  /// Copy of the member data.
319  TLambda GetLambda(void) const;
320 
321  /// Assign a value to Lambda data member.
322  ///
323  /// @param value
324  /// Value to assign
325  void SetLambda(TLambda value);
326 
327  /// Assign a value to Lambda data member.
328  ///
329  /// @return
330  /// Reference to the data value.
331  TLambda& SetLambda(void);
332 
333  /// Karlin-Altschul parameter H
334  /// Check if a value has been assigned to Entropy data member.
335  ///
336  /// Data member Entropy is mandatory;
337  /// its type is defined as 'typedef double TEntropy'
338  /// @return
339  /// - true, if a value has been assigned.
340  /// - false, otherwise.
341  bool IsSetEntropy(void) const;
342 
343  /// Check if it is safe to call GetEntropy method.
344  ///
345  /// @return
346  /// - true, if the data member is getatable.
347  /// - false, otherwise.
348  bool CanGetEntropy(void) const;
349 
350  /// Reset Entropy data member.
351  void ResetEntropy(void);
352 
353  /// Get the Entropy member data.
354  ///
355  /// @return
356  /// Copy of the member data.
357  TEntropy GetEntropy(void) const;
358 
359  /// Assign a value to Entropy data member.
360  ///
361  /// @param value
362  /// Value to assign
363  void SetEntropy(TEntropy value);
364 
365  /// Assign a value to Entropy data member.
366  ///
367  /// @return
368  /// Reference to the data value.
369  TEntropy& SetEntropy(void);
370 
371  /// Reset the whole object
372  virtual void Reset(void);
373 
374 
375 private:
376  // Prohibit copy constructor and assignment operator
379 
380  // data
381  Uint4 m_set_State[1];
382  int m_Db_num;
385  double m_Eff_space;
386  double m_Kappa;
387  double m_Lambda;
388  double m_Entropy;
389 };
390 
391 /* @} */
392 
393 
394 
395 
396 
397 ///////////////////////////////////////////////////////////
398 ///////////////////// inline methods //////////////////////
399 ///////////////////////////////////////////////////////////
400 inline
402 {
403  return ((m_set_State[0] & 0x3) != 0);
404 }
405 
406 inline
408 {
409  return IsSetDb_num();
410 }
411 
412 inline
414 {
415  m_Db_num = 0;
416  m_set_State[0] &= ~0x3;
417 }
418 
419 inline
421 {
422  if (!CanGetDb_num()) {
423  ThrowUnassigned(0);
424  }
425  return m_Db_num;
426 }
427 
428 inline
430 {
431  m_Db_num = value;
432  m_set_State[0] |= 0x3;
433 }
434 
435 inline
437 {
438 #ifdef _DEBUG
439  if (!IsSetDb_num()) {
440  memset(&m_Db_num,UnassignedByte(),sizeof(m_Db_num));
441  }
442 #endif
443  m_set_State[0] |= 0x1;
444  return m_Db_num;
445 }
446 
447 inline
449 {
450  return ((m_set_State[0] & 0xc) != 0);
451 }
452 
453 inline
455 {
456  return IsSetDb_len();
457 }
458 
459 inline
461 {
462  m_Db_len = 0;
463  m_set_State[0] &= ~0xc;
464 }
465 
466 inline
468 {
469  if (!CanGetDb_len()) {
470  ThrowUnassigned(1);
471  }
472  return m_Db_len;
473 }
474 
475 inline
477 {
478  m_Db_len = value;
479  m_set_State[0] |= 0xc;
480 }
481 
482 inline
484 {
485 #ifdef _DEBUG
486  if (!IsSetDb_len()) {
487  memset(&m_Db_len,UnassignedByte(),sizeof(m_Db_len));
488  }
489 #endif
490  m_set_State[0] |= 0x4;
491  return m_Db_len;
492 }
493 
494 inline
496 {
497  return ((m_set_State[0] & 0x30) != 0);
498 }
499 
500 inline
502 {
503  return IsSetHsp_len();
504 }
505 
506 inline
508 {
509  m_Hsp_len = 0;
510  m_set_State[0] &= ~0x30;
511 }
512 
513 inline
515 {
516  if (!CanGetHsp_len()) {
517  ThrowUnassigned(2);
518  }
519  return m_Hsp_len;
520 }
521 
522 inline
524 {
525  m_Hsp_len = value;
526  m_set_State[0] |= 0x30;
527 }
528 
529 inline
531 {
532 #ifdef _DEBUG
533  if (!IsSetHsp_len()) {
534  memset(&m_Hsp_len,UnassignedByte(),sizeof(m_Hsp_len));
535  }
536 #endif
537  m_set_State[0] |= 0x10;
538  return m_Hsp_len;
539 }
540 
541 inline
543 {
544  return ((m_set_State[0] & 0xc0) != 0);
545 }
546 
547 inline
549 {
550  return IsSetEff_space();
551 }
552 
553 inline
555 {
556  m_Eff_space = 0;
557  m_set_State[0] &= ~0xc0;
558 }
559 
560 inline
562 {
563  if (!CanGetEff_space()) {
564  ThrowUnassigned(3);
565  }
566  return m_Eff_space;
567 }
568 
569 inline
571 {
572  m_Eff_space = value;
573  m_set_State[0] |= 0xc0;
574 }
575 
576 inline
578 {
579 #ifdef _DEBUG
580  if (!IsSetEff_space()) {
581  memset(&m_Eff_space,UnassignedByte(),sizeof(m_Eff_space));
582  }
583 #endif
584  m_set_State[0] |= 0x40;
585  return m_Eff_space;
586 }
587 
588 inline
590 {
591  return ((m_set_State[0] & 0x300) != 0);
592 }
593 
594 inline
596 {
597  return IsSetKappa();
598 }
599 
600 inline
602 {
603  m_Kappa = 0;
604  m_set_State[0] &= ~0x300;
605 }
606 
607 inline
609 {
610  if (!CanGetKappa()) {
611  ThrowUnassigned(4);
612  }
613  return m_Kappa;
614 }
615 
616 inline
618 {
619  m_Kappa = value;
620  m_set_State[0] |= 0x300;
621 }
622 
623 inline
625 {
626 #ifdef _DEBUG
627  if (!IsSetKappa()) {
628  memset(&m_Kappa,UnassignedByte(),sizeof(m_Kappa));
629  }
630 #endif
631  m_set_State[0] |= 0x100;
632  return m_Kappa;
633 }
634 
635 inline
637 {
638  return ((m_set_State[0] & 0xc00) != 0);
639 }
640 
641 inline
643 {
644  return IsSetLambda();
645 }
646 
647 inline
649 {
650  m_Lambda = 0;
651  m_set_State[0] &= ~0xc00;
652 }
653 
654 inline
656 {
657  if (!CanGetLambda()) {
658  ThrowUnassigned(5);
659  }
660  return m_Lambda;
661 }
662 
663 inline
665 {
666  m_Lambda = value;
667  m_set_State[0] |= 0xc00;
668 }
669 
670 inline
672 {
673 #ifdef _DEBUG
674  if (!IsSetLambda()) {
675  memset(&m_Lambda,UnassignedByte(),sizeof(m_Lambda));
676  }
677 #endif
678  m_set_State[0] |= 0x400;
679  return m_Lambda;
680 }
681 
682 inline
684 {
685  return ((m_set_State[0] & 0x3000) != 0);
686 }
687 
688 inline
690 {
691  return IsSetEntropy();
692 }
693 
694 inline
696 {
697  m_Entropy = 0;
698  m_set_State[0] &= ~0x3000;
699 }
700 
701 inline
703 {
704  if (!CanGetEntropy()) {
705  ThrowUnassigned(6);
706  }
707  return m_Entropy;
708 }
709 
710 inline
712 {
713  m_Entropy = value;
714  m_set_State[0] |= 0x3000;
715 }
716 
717 inline
719 {
720 #ifdef _DEBUG
721  if (!IsSetEntropy()) {
722  memset(&m_Entropy,UnassignedByte(),sizeof(m_Entropy));
723  }
724 #endif
725  m_set_State[0] |= 0x1000;
726  return m_Entropy;
727 }
728 
729 ///////////////////////////////////////////////////////////
730 ////////////////// end of inline methods //////////////////
731 ///////////////////////////////////////////////////////////
732 
733 
734 
735 
736 
737 END_objects_SCOPE // namespace ncbi::objects::
738 
740 
741 
742 #endif // OBJECTS_BLASTXML_STATISTICS_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CStatistics_Base –.
Definition: Statistics_.hpp:69
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
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
#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_BLASTXML_EXPORT
Definition: ncbi_export.h:344
TDb_len GetDb_len(void) const
Get the Db_len member data.
bool IsSetKappa(void) const
Karlin-Altschul parameter K Check if a value has been assigned to Kappa data member.
bool IsSetHsp_len(void) const
Effective HSP length Check if a value has been assigned to Hsp_len data member.
void ResetDb_len(void)
Reset Db_len data member.
THsp_len & SetHsp_len(void)
Assign a value to Hsp_len data member.
void ResetEff_space(void)
Reset Eff_space data member.
bool IsSetEntropy(void) const
Karlin-Altschul parameter H Check if a value has been assigned to Entropy data member.
TKappa & SetKappa(void)
Assign a value to Kappa data member.
CSerialObject Tparent
Definition: Statistics_.hpp:70
TKappa GetKappa(void) const
Get the Kappa member data.
bool CanGetHsp_len(void) const
Check if it is safe to call GetHsp_len method.
bool IsSetDb_num(void) const
Number of sequences in BLAST db Check if a value has been assigned to Db_num data member.
bool IsSetDb_len(void) const
Length of BLAST db Check if a value has been assigned to Db_len data member.
bool CanGetDb_num(void) const
Check if it is safe to call GetDb_num method.
void ResetDb_num(void)
Reset Db_num data member.
bool CanGetKappa(void) const
Check if it is safe to call GetKappa method.
bool IsSetEff_space(void) const
Effective search space Check if a value has been assigned to Eff_space data member.
TEff_space GetEff_space(void) const
Get the Eff_space member data.
TDb_num GetDb_num(void) const
Get the Db_num member data.
void ResetLambda(void)
Reset Lambda data member.
bool CanGetLambda(void) const
Check if it is safe to call GetLambda method.
Uint4 m_set_State[1]
TDb_num & SetDb_num(void)
Assign a value to Db_num data member.
bool IsSetLambda(void) const
Karlin-Altschul parameter Lambda Check if a value has been assigned to Lambda data member.
bool CanGetEff_space(void) const
Check if it is safe to call GetEff_space method.
TEntropy & SetEntropy(void)
Assign a value to Entropy data member.
void ResetEntropy(void)
Reset Entropy data member.
TLambda & SetLambda(void)
Assign a value to Lambda data member.
bool CanGetDb_len(void) const
Check if it is safe to call GetDb_len method.
TEntropy GetEntropy(void) const
Get the Entropy member data.
TDb_len & SetDb_len(void)
Assign a value to Db_len data member.
THsp_len GetHsp_len(void) const
Get the Hsp_len member data.
void ResetKappa(void)
Reset Kappa data member.
void ResetHsp_len(void)
Reset Hsp_len data member.
TLambda GetLambda(void) const
Get the Lambda member data.
CStatistics_Base & operator=(const CStatistics_Base &)
CStatistics_Base(const CStatistics_Base &)
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
TEff_space & SetEff_space(void)
Assign a value to Eff_space data member.
bool CanGetEntropy(void) const
Check if it is safe to call GetEntropy method.
Modified on Wed Feb 21 09:56:15 2024 by modify_doxy.py rev. 669887