NCBI C++ ToolKit
TMgr_LengthStats_.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 TMgr_LengthStats_.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/trackmgr/trackmgr.asn">trackmgr.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/trackmgr/trackmgr.def">trackmgr.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_TRACKMGR_TMGR_LENGTHSTATS_BASE_HPP
42 #define OBJECTS_TRACKMGR_TMGR_LENGTHSTATS_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
50 
51 #ifndef BEGIN_objects_SCOPE
52 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
53 # define END_objects_SCOPE END_SCOPE(objects)
54 #endif
55 BEGIN_objects_SCOPE // namespace ncbi::objects::
56 
57 
58 // generated classes
59 
60 
61 /** @addtogroup dataspec_NCBI_TrackManager
62  *
63  * @{
64  */
65 
66 /////////////////////////////////////////////////////////////////////////////
67 ///
68 /// CTMgr_LengthStats_Base --
69 ///
70 
72 {
74 public:
75  // constructor
77  // destructor
78  virtual ~CTMgr_LengthStats_Base(void);
79 
80  // type info
82 
83  // types
84  typedef TSeqPos TMin;
85  typedef TSeqPos TMax;
86  typedef TSeqPos TMean;
87 
88  // member index
89  enum class E_memberIndex {
90  e__allMandatory = 0,
91  e_min,
92  e_max,
93  e_mean
94  };
96 
97  // getters
98  // setters
99 
100  /// Check if a value has been assigned to Min data member.
101  ///
102  /// Data member Min is mandatory;
103  /// its type is defined as 'typedef TSeqPos TMin'
104  /// @return
105  /// - true, if a value has been assigned.
106  /// - false, otherwise.
107  bool IsSetMin(void) const;
108 
109  /// Check if it is safe to call GetMin method.
110  ///
111  /// @return
112  /// - true, if the data member is getatable.
113  /// - false, otherwise.
114  bool CanGetMin(void) const;
115 
116  /// Reset Min data member.
117  void ResetMin(void);
118 
119  /// Get the Min member data.
120  ///
121  /// @return
122  /// Copy of the member data.
123  TMin GetMin(void) const;
124 
125  /// Assign a value to Min data member.
126  ///
127  /// @param value
128  /// Value to assign
129  void SetMin(TMin value);
130 
131  /// Assign a value to Min data member.
132  ///
133  /// @return
134  /// Reference to the data value.
135  TMin& SetMin(void);
136 
137  /// Check if a value has been assigned to Max data member.
138  ///
139  /// Data member Max is mandatory;
140  /// its type is defined as 'typedef TSeqPos TMax'
141  /// @return
142  /// - true, if a value has been assigned.
143  /// - false, otherwise.
144  bool IsSetMax(void) const;
145 
146  /// Check if it is safe to call GetMax method.
147  ///
148  /// @return
149  /// - true, if the data member is getatable.
150  /// - false, otherwise.
151  bool CanGetMax(void) const;
152 
153  /// Reset Max data member.
154  void ResetMax(void);
155 
156  /// Get the Max member data.
157  ///
158  /// @return
159  /// Copy of the member data.
160  TMax GetMax(void) const;
161 
162  /// Assign a value to Max data member.
163  ///
164  /// @param value
165  /// Value to assign
166  void SetMax(TMax value);
167 
168  /// Assign a value to Max data member.
169  ///
170  /// @return
171  /// Reference to the data value.
172  TMax& SetMax(void);
173 
174  /// Check if a value has been assigned to Mean data member.
175  ///
176  /// Data member Mean is optional;
177  /// its type is defined as 'typedef TSeqPos TMean'
178  /// @return
179  /// - true, if a value has been assigned.
180  /// - false, otherwise.
181  bool IsSetMean(void) const;
182 
183  /// Check if it is safe to call GetMean method.
184  ///
185  /// @return
186  /// - true, if the data member is getatable.
187  /// - false, otherwise.
188  bool CanGetMean(void) const;
189 
190  /// Reset Mean data member.
191  void ResetMean(void);
192 
193  /// Get the Mean member data.
194  ///
195  /// @return
196  /// Copy of the member data.
197  TMean GetMean(void) const;
198 
199  /// Assign a value to Mean data member.
200  ///
201  /// @param value
202  /// Value to assign
203  void SetMean(TMean value);
204 
205  /// Assign a value to Mean data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TMean& SetMean(void);
210 
211  /// Reset the whole object
212  virtual void Reset(void);
213 
214 
215 private:
216  // Prohibit copy constructor and assignment operator
219 
220  // data
221  Uint4 m_set_State[1];
225 };
226 
227 /* @} */
228 
229 
230 
231 
232 
233 ///////////////////////////////////////////////////////////
234 ///////////////////// inline methods //////////////////////
235 ///////////////////////////////////////////////////////////
236 inline
238 {
239  return ((m_set_State[0] & 0x3) != 0);
240 }
241 
242 inline
244 {
245  return IsSetMin();
246 }
247 
248 inline
250 {
251  m_Min = 0;
252  m_set_State[0] &= ~0x3;
253 }
254 
255 inline
257 {
258  if (!CanGetMin()) {
259  ThrowUnassigned(0);
260  }
261  return m_Min;
262 }
263 
264 inline
266 {
267  m_Min = value;
268  m_set_State[0] |= 0x3;
269 }
270 
271 inline
273 {
274 #ifdef _DEBUG
275  if (!IsSetMin()) {
276  memset(&m_Min,UnassignedByte(),sizeof(m_Min));
277  }
278 #endif
279  m_set_State[0] |= 0x1;
280  return m_Min;
281 }
282 
283 inline
285 {
286  return ((m_set_State[0] & 0xc) != 0);
287 }
288 
289 inline
291 {
292  return IsSetMax();
293 }
294 
295 inline
297 {
298  m_Max = 0;
299  m_set_State[0] &= ~0xc;
300 }
301 
302 inline
304 {
305  if (!CanGetMax()) {
306  ThrowUnassigned(1);
307  }
308  return m_Max;
309 }
310 
311 inline
313 {
314  m_Max = value;
315  m_set_State[0] |= 0xc;
316 }
317 
318 inline
320 {
321 #ifdef _DEBUG
322  if (!IsSetMax()) {
323  memset(&m_Max,UnassignedByte(),sizeof(m_Max));
324  }
325 #endif
326  m_set_State[0] |= 0x4;
327  return m_Max;
328 }
329 
330 inline
332 {
333  return ((m_set_State[0] & 0x30) != 0);
334 }
335 
336 inline
338 {
339  return IsSetMean();
340 }
341 
342 inline
344 {
345  m_Mean = 0;
346  m_set_State[0] &= ~0x30;
347 }
348 
349 inline
351 {
352  if (!CanGetMean()) {
353  ThrowUnassigned(2);
354  }
355  return m_Mean;
356 }
357 
358 inline
360 {
361  m_Mean = value;
362  m_set_State[0] |= 0x30;
363 }
364 
365 inline
367 {
368 #ifdef _DEBUG
369  if (!IsSetMean()) {
370  memset(&m_Mean,UnassignedByte(),sizeof(m_Mean));
371  }
372 #endif
373  m_set_State[0] |= 0x10;
374  return m_Mean;
375 }
376 
377 ///////////////////////////////////////////////////////////
378 ////////////////// end of inline methods //////////////////
379 ///////////////////////////////////////////////////////////
380 
381 
382 
383 
384 
385 END_objects_SCOPE // namespace ncbi::objects::
386 
388 
389 
390 #endif // OBJECTS_TRACKMGR_TMGR_LENGTHSTATS_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTMgr_LengthStats_Base –.
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
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
TMax GetMax(void) const
Get the Max member data.
void ResetMin(void)
Reset Min data member.
bool IsSetMean(void) const
Check if a value has been assigned to Mean data member.
void ResetMax(void)
Reset Max data member.
bool CanGetMean(void) const
Check if it is safe to call GetMean method.
TMean GetMean(void) const
Get the Mean member data.
CTMgr_LengthStats_Base & operator=(const CTMgr_LengthStats_Base &)
TMax & SetMax(void)
Assign a value to Max data member.
bool IsSetMin(void) const
Check if a value has been assigned to Min data member.
bool CanGetMin(void) const
Check if it is safe to call GetMin method.
bool CanGetMax(void) const
Check if it is safe to call GetMax method.
CTMgr_LengthStats_Base(const CTMgr_LengthStats_Base &)
TMean & SetMean(void)
Assign a value to Mean data member.
TMin GetMin(void) const
Get the Min member data.
bool IsSetMax(void) const
Check if a value has been assigned to Max data member.
void ResetMean(void)
Reset Mean data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TMin & SetMin(void)
Assign a value to Min data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_TRACKMGR_EXPORT
Modified on Mon Jun 24 05:20:23 2024 by modify_doxy.py rev. 669887