NCBI C++ ToolKit
Length_distribution_params_.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 Length_distribution_params_.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/gnomon/gnomon.asn">gnomon.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/algo/gnomon/gnomon.def">gnomon.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_GNOMON_LENGTH_DISTRIBUTION_PARAMS_BASE_HPP
42 #define ALGO_GNOMON_LENGTH_DISTRIBUTION_PARAMS_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_GNOMON
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CLength_distribution_params_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CLength_distribution_params_Base(void);
80 
81  // type info
83 
84  /////////////////////////////////////////////////////////////////////////////
85  ///
86  /// C_Range --
87  ///
88 
90  {
92  public:
93  // constructor
94  C_Range(void);
95  // destructor
96  ~C_Range(void);
97 
98  // type info
100 
101  // types
102  typedef int TMin;
103  typedef int TMax;
104 
105  // member index
106  enum class E_memberIndex {
107  e__allMandatory = 0,
108  e_min,
109  e_max
110  };
112 
113  // getters
114  // setters
115 
116  /// Check if a value has been assigned to Min data member.
117  ///
118  /// Data member Min is mandatory;
119  /// its type is defined as 'typedef int TMin'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetMin(void) const;
124 
125  /// Check if it is safe to call GetMin method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetMin(void) const;
131 
132  /// Reset Min data member.
133  void ResetMin(void);
134 
135  /// Get the Min member data.
136  ///
137  /// @return
138  /// Copy of the member data.
139  TMin GetMin(void) const;
140 
141  /// Assign a value to Min data member.
142  ///
143  /// @param value
144  /// Value to assign
145  void SetMin(TMin value);
146 
147  /// Assign a value to Min data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TMin& SetMin(void);
152 
153  /// Check if a value has been assigned to Max data member.
154  ///
155  /// Data member Max is mandatory;
156  /// its type is defined as 'typedef int TMax'
157  /// @return
158  /// - true, if a value has been assigned.
159  /// - false, otherwise.
160  bool IsSetMax(void) const;
161 
162  /// Check if it is safe to call GetMax method.
163  ///
164  /// @return
165  /// - true, if the data member is getatable.
166  /// - false, otherwise.
167  bool CanGetMax(void) const;
168 
169  /// Reset Max data member.
170  void ResetMax(void);
171 
172  /// Get the Max member data.
173  ///
174  /// @return
175  /// Copy of the member data.
176  TMax GetMax(void) const;
177 
178  /// Assign a value to Max data member.
179  ///
180  /// @param value
181  /// Value to assign
182  void SetMax(TMax value);
183 
184  /// Assign a value to Max data member.
185  ///
186  /// @return
187  /// Reference to the data value.
188  TMax& SetMax(void);
189 
190  /// Reset the whole object
191  void Reset(void);
192 
193 
194  private:
195  // Prohibit copy constructor and assignment operator
196  C_Range(const C_Range&);
198 
199  // data
200  Uint4 m_set_State[1];
201  int m_Min;
202  int m_Max;
203  };
204  // types
205  typedef int TStep;
206  typedef list< double > TP;
207  typedef double TA;
208  typedef double TL;
209  typedef C_Range TRange;
210 
211  // member index
212  enum class E_memberIndex {
213  e__allMandatory = 0,
214  e_step,
215  e_p,
216  e_a,
217  e_l,
218  e_range
219  };
221 
222  // getters
223  // setters
224 
225  /// Check if a value has been assigned to Step data member.
226  ///
227  /// Data member Step is mandatory;
228  /// its type is defined as 'typedef int TStep'
229  /// @return
230  /// - true, if a value has been assigned.
231  /// - false, otherwise.
232  bool IsSetStep(void) const;
233 
234  /// Check if it is safe to call GetStep method.
235  ///
236  /// @return
237  /// - true, if the data member is getatable.
238  /// - false, otherwise.
239  bool CanGetStep(void) const;
240 
241  /// Reset Step data member.
242  void ResetStep(void);
243 
244  /// Get the Step member data.
245  ///
246  /// @return
247  /// Copy of the member data.
248  TStep GetStep(void) const;
249 
250  /// Assign a value to Step data member.
251  ///
252  /// @param value
253  /// Value to assign
254  void SetStep(TStep value);
255 
256  /// Assign a value to Step data member.
257  ///
258  /// @return
259  /// Reference to the data value.
260  TStep& SetStep(void);
261 
262  /// P(step*(i+.5))|i=0,1,...,N-1
263  /// Check if a value has been assigned to P data member.
264  ///
265  /// Data member P is mandatory;
266  /// its type is defined as 'typedef list< double > TP'
267  /// @return
268  /// - true, if a value has been assigned.
269  /// - false, otherwise.
270  bool IsSetP(void) const;
271 
272  /// Check if it is safe to call GetP method.
273  ///
274  /// @return
275  /// - true, if the data member is getatable.
276  /// - false, otherwise.
277  bool CanGetP(void) const;
278 
279  /// Reset P data member.
280  void ResetP(void);
281 
282  /// Get the P member data.
283  ///
284  /// @return
285  /// Reference to the member data.
286  const TP& GetP(void) const;
287 
288  /// Assign a value to P data member.
289  ///
290  /// @return
291  /// Reference to the data value.
292  TP& SetP(void);
293 
294  /// Loretz function coefficient for the tail
295  /// Check if a value has been assigned to A data member.
296  ///
297  /// Data member A is mandatory;
298  /// its type is defined as 'typedef double TA'
299  /// @return
300  /// - true, if a value has been assigned.
301  /// - false, otherwise.
302  bool IsSetA(void) const;
303 
304  /// Check if it is safe to call GetA method.
305  ///
306  /// @return
307  /// - true, if the data member is getatable.
308  /// - false, otherwise.
309  bool CanGetA(void) const;
310 
311  /// Reset A data member.
312  void ResetA(void);
313 
314  /// Get the A member data.
315  ///
316  /// @return
317  /// Copy of the member data.
318  TA GetA(void) const;
319 
320  /// Assign a value to A data member.
321  ///
322  /// @param value
323  /// Value to assign
324  void SetA(TA value);
325 
326  /// Assign a value to A data member.
327  ///
328  /// @return
329  /// Reference to the data value.
330  TA& SetA(void);
331 
332  /// Loretz function coefficient for the tail
333  /// Check if a value has been assigned to L data member.
334  ///
335  /// Data member L is mandatory;
336  /// its type is defined as 'typedef double TL'
337  /// @return
338  /// - true, if a value has been assigned.
339  /// - false, otherwise.
340  bool IsSetL(void) const;
341 
342  /// Check if it is safe to call GetL method.
343  ///
344  /// @return
345  /// - true, if the data member is getatable.
346  /// - false, otherwise.
347  bool CanGetL(void) const;
348 
349  /// Reset L data member.
350  void ResetL(void);
351 
352  /// Get the L member data.
353  ///
354  /// @return
355  /// Copy of the member data.
356  TL GetL(void) const;
357 
358  /// Assign a value to L data member.
359  ///
360  /// @param value
361  /// Value to assign
362  void SetL(TL value);
363 
364  /// Assign a value to L data member.
365  ///
366  /// @return
367  /// Reference to the data value.
368  TL& SetL(void);
369 
370  /// Check if a value has been assigned to Range data member.
371  ///
372  /// Data member Range is mandatory;
373  /// its type is defined as 'typedef C_Range TRange'
374  /// @return
375  /// - true, if a value has been assigned.
376  /// - false, otherwise.
377  bool IsSetRange(void) const;
378 
379  /// Check if it is safe to call GetRange method.
380  ///
381  /// @return
382  /// - true, if the data member is getatable.
383  /// - false, otherwise.
384  bool CanGetRange(void) const;
385 
386  /// Reset Range data member.
387  void ResetRange(void);
388 
389  /// Get the Range member data.
390  ///
391  /// @return
392  /// Reference to the member data.
393  const TRange& GetRange(void) const;
394 
395  /// Assign a value to Range data member.
396  ///
397  /// @param value
398  /// Reference to value.
399  void SetRange(TRange& value);
400 
401  /// Assign a value to Range data member.
402  ///
403  /// @return
404  /// Reference to the data value.
405  TRange& SetRange(void);
406 
407  /// Reset the whole object
408  virtual void Reset(void);
409 
410 
411 private:
412  // Prohibit copy constructor and assignment operator
415 
416  // data
417  Uint4 m_set_State[1];
418  int m_Step;
419  list< double > m_P;
420  double m_A;
421  double m_L;
423 };
424 
425 /* @} */
426 
427 
428 
429 
430 
431 ///////////////////////////////////////////////////////////
432 ///////////////////// inline methods //////////////////////
433 ///////////////////////////////////////////////////////////
434 inline
436 {
437  return ((m_set_State[0] & 0x3) != 0);
438 }
439 
440 inline
442 {
443  return IsSetMin();
444 }
445 
446 inline
448 {
449  m_Min = 0;
450  m_set_State[0] &= ~0x3;
451 }
452 
453 inline
455 {
456  if (!CanGetMin()) {
457  ThrowUnassigned(0);
458  }
459  return m_Min;
460 }
461 
462 inline
464 {
465  m_Min = value;
466  m_set_State[0] |= 0x3;
467 }
468 
469 inline
471 {
472 #ifdef _DEBUG
473  if (!IsSetMin()) {
474  memset(&m_Min,UnassignedByte(),sizeof(m_Min));
475  }
476 #endif
477  m_set_State[0] |= 0x1;
478  return m_Min;
479 }
480 
481 inline
483 {
484  return ((m_set_State[0] & 0xc) != 0);
485 }
486 
487 inline
489 {
490  return IsSetMax();
491 }
492 
493 inline
495 {
496  m_Max = 0;
497  m_set_State[0] &= ~0xc;
498 }
499 
500 inline
502 {
503  if (!CanGetMax()) {
504  ThrowUnassigned(1);
505  }
506  return m_Max;
507 }
508 
509 inline
511 {
512  m_Max = value;
513  m_set_State[0] |= 0xc;
514 }
515 
516 inline
518 {
519 #ifdef _DEBUG
520  if (!IsSetMax()) {
521  memset(&m_Max,UnassignedByte(),sizeof(m_Max));
522  }
523 #endif
524  m_set_State[0] |= 0x4;
525  return m_Max;
526 }
527 
528 inline
530 {
531  return ((m_set_State[0] & 0x3) != 0);
532 }
533 
534 inline
536 {
537  return IsSetStep();
538 }
539 
540 inline
542 {
543  m_Step = 0;
544  m_set_State[0] &= ~0x3;
545 }
546 
547 inline
549 {
550  if (!CanGetStep()) {
551  ThrowUnassigned(0);
552  }
553  return m_Step;
554 }
555 
556 inline
558 {
559  m_Step = value;
560  m_set_State[0] |= 0x3;
561 }
562 
563 inline
565 {
566 #ifdef _DEBUG
567  if (!IsSetStep()) {
568  memset(&m_Step,UnassignedByte(),sizeof(m_Step));
569  }
570 #endif
571  m_set_State[0] |= 0x1;
572  return m_Step;
573 }
574 
575 inline
577 {
578  return ((m_set_State[0] & 0xc) != 0);
579 }
580 
581 inline
583 {
584  return true;
585 }
586 
587 inline
589 {
590  return m_P;
591 }
592 
593 inline
595 {
596  m_set_State[0] |= 0x4;
597  return m_P;
598 }
599 
600 inline
602 {
603  return ((m_set_State[0] & 0x30) != 0);
604 }
605 
606 inline
608 {
609  return IsSetA();
610 }
611 
612 inline
614 {
615  m_A = 0;
616  m_set_State[0] &= ~0x30;
617 }
618 
619 inline
621 {
622  if (!CanGetA()) {
623  ThrowUnassigned(2);
624  }
625  return m_A;
626 }
627 
628 inline
630 {
631  m_A = value;
632  m_set_State[0] |= 0x30;
633 }
634 
635 inline
637 {
638 #ifdef _DEBUG
639  if (!IsSetA()) {
640  memset(&m_A,UnassignedByte(),sizeof(m_A));
641  }
642 #endif
643  m_set_State[0] |= 0x10;
644  return m_A;
645 }
646 
647 inline
649 {
650  return ((m_set_State[0] & 0xc0) != 0);
651 }
652 
653 inline
655 {
656  return IsSetL();
657 }
658 
659 inline
661 {
662  m_L = 0;
663  m_set_State[0] &= ~0xc0;
664 }
665 
666 inline
668 {
669  if (!CanGetL()) {
670  ThrowUnassigned(3);
671  }
672  return m_L;
673 }
674 
675 inline
677 {
678  m_L = value;
679  m_set_State[0] |= 0xc0;
680 }
681 
682 inline
684 {
685 #ifdef _DEBUG
686  if (!IsSetL()) {
687  memset(&m_L,UnassignedByte(),sizeof(m_L));
688  }
689 #endif
690  m_set_State[0] |= 0x40;
691  return m_L;
692 }
693 
694 inline
696 {
697  return m_Range.NotEmpty();
698 }
699 
700 inline
702 {
703  return true;
704 }
705 
706 inline
708 {
709  if ( !m_Range ) {
710  const_cast<CLength_distribution_params_Base*>(this)->ResetRange();
711  }
712  return (*m_Range);
713 }
714 
715 inline
717 {
718  if ( !m_Range ) {
719  ResetRange();
720  }
721  return (*m_Range);
722 }
723 
724 ///////////////////////////////////////////////////////////
725 ////////////////// end of inline methods //////////////////
726 ///////////////////////////////////////////////////////////
727 
728 
729 
730 
731 
732 END_objects_SCOPE // namespace ncbi::objects::
733 
735 
736 
737 #endif // ALGO_GNOMON_LENGTH_DISTRIBUTION_PARAMS_BASE_HPP
CLength_distribution_params_Base –.
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_XALGOGNOMON_EXPORT
Definition: ncbi_export.h:1001
bool IsSetStep(void) const
Check if a value has been assigned to Step data member.
TMin GetMin(void) const
Get the Min member data.
TA & SetA(void)
Assign a value to A data member.
TMin & SetMin(void)
Assign a value to Min data member.
TL GetL(void) const
Get the L member data.
TA GetA(void) const
Get the A member data.
bool IsSetRange(void) const
Check if a value has been assigned to Range data member.
TStep GetStep(void) const
Get the Step member data.
const TRange & GetRange(void) const
Get the Range member data.
bool CanGetL(void) const
Check if it is safe to call GetL method.
TMax & SetMax(void)
Assign a value to Max data member.
bool CanGetRange(void) const
Check if it is safe to call GetRange method.
bool IsSetMin(void) const
Check if a value has been assigned to Min data member.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
TL & SetL(void)
Assign a value to L data member.
const TP & GetP(void) const
Get the P member data.
bool CanGetP(void) const
Check if it is safe to call GetP method.
TP & SetP(void)
Assign a value to P data member.
bool IsSetA(void) const
Loretz function coefficient for the tail Check if a value has been assigned to A data member.
bool IsSetL(void) const
Loretz function coefficient for the tail Check if a value has been assigned to L data member.
TMax GetMax(void) const
Get the Max member data.
bool CanGetMin(void) const
Check if it is safe to call GetMin method.
bool IsSetMax(void) const
Check if a value has been assigned to Max data member.
CLength_distribution_params_Base & operator=(const CLength_distribution_params_Base &)
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TStep & SetStep(void)
Assign a value to Step data member.
TRange & SetRange(void)
Assign a value to Range data member.
C_Range & operator=(const C_Range &)
CLength_distribution_params_Base(const CLength_distribution_params_Base &)
void ResetStep(void)
Reset Step data member.
bool CanGetMax(void) const
Check if it is safe to call GetMax method.
void ResetRange(void)
Reset Range data member.
bool CanGetA(void) const
Check if it is safe to call GetA method.
bool IsSetP(void) const
P(step*(i+.5))|i=0,1,...,N-1 Check if a value has been assigned to P data member.
bool CanGetStep(void) const
Check if it is safe to call GetStep method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:19 2024 by modify_doxy.py rev. 669887