NCBI C++ ToolKit
TMgr_TypeStat_.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_TypeStat_.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_TYPESTAT_BASE_HPP
42 #define OBJECTS_TRACKMGR_TMGR_TYPESTAT_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
52 
54 
55 #ifndef BEGIN_objects_SCOPE
56 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
57 # define END_objects_SCOPE END_SCOPE(objects)
58 #endif
59 BEGIN_objects_SCOPE // namespace ncbi::objects::
60 
61 
62 // forward declarations
63 class CTMgr_LengthStats;
65 
66 
67 // generated classes
68 
69 
70 /** @addtogroup dataspec_NCBI_TrackManager
71  *
72  * @{
73  */
74 
75 /////////////////////////////////////////////////////////////////////////////
76 ///
77 /// CTMgr_TypeStat_Base --
78 ///
79 
81 {
83 public:
84  // constructor
85  CTMgr_TypeStat_Base(void);
86  // destructor
87  virtual ~CTMgr_TypeStat_Base(void);
88 
89  // type info
91 
92  // types
93  typedef int TType;
94  typedef int TCount;
97 
98  // member index
99  enum class E_memberIndex {
100  e__allMandatory = 0,
101  e_type,
102  e_count,
103  e_length_stats,
104  e_position_stats
105  };
107 
108  // getters
109  // setters
110 
111  /// Check if a value has been assigned to Type data member.
112  ///
113  /// Data member Type is mandatory;
114  /// its type is defined as 'typedef int TType'
115  /// @return
116  /// - true, if a value has been assigned.
117  /// - false, otherwise.
118  bool IsSetType(void) const;
119 
120  /// Check if it is safe to call GetType method.
121  ///
122  /// @return
123  /// - true, if the data member is getatable.
124  /// - false, otherwise.
125  bool CanGetType(void) const;
126 
127  /// Reset Type data member.
128  void ResetType(void);
129 
130  /// Get the Type member data.
131  ///
132  /// @return
133  /// Copy of the member data.
134  TType GetType(void) const;
135 
136  /// Assign a value to Type data member.
137  ///
138  /// @param value
139  /// Value to assign
140  void SetType(TType value);
141 
142  /// Assign a value to Type data member.
143  ///
144  /// @return
145  /// Reference to the data value.
146  TType& SetType(void);
147 
148  /// Check if a value has been assigned to Count data member.
149  ///
150  /// Data member Count is mandatory;
151  /// its type is defined as 'typedef int TCount'
152  /// @return
153  /// - true, if a value has been assigned.
154  /// - false, otherwise.
155  bool IsSetCount(void) const;
156 
157  /// Check if it is safe to call GetCount method.
158  ///
159  /// @return
160  /// - true, if the data member is getatable.
161  /// - false, otherwise.
162  bool CanGetCount(void) const;
163 
164  /// Reset Count data member.
165  void ResetCount(void);
166 
167  /// Get the Count member data.
168  ///
169  /// @return
170  /// Copy of the member data.
171  TCount GetCount(void) const;
172 
173  /// Assign a value to Count data member.
174  ///
175  /// @param value
176  /// Value to assign
177  void SetCount(TCount value);
178 
179  /// Assign a value to Count data member.
180  ///
181  /// @return
182  /// Reference to the data value.
183  TCount& SetCount(void);
184 
185  /// Check if a value has been assigned to Length_stats data member.
186  ///
187  /// Data member Length_stats is optional;
188  /// its type is defined as 'typedef CTMgr_LengthStats TLength_stats'
189  /// @return
190  /// - true, if a value has been assigned.
191  /// - false, otherwise.
192  bool IsSetLength_stats(void) const;
193 
194  /// Check if it is safe to call GetLength_stats method.
195  ///
196  /// @return
197  /// - true, if the data member is getatable.
198  /// - false, otherwise.
199  bool CanGetLength_stats(void) const;
200 
201  /// Reset Length_stats data member.
202  void ResetLength_stats(void);
203 
204  /// Get the Length_stats member data.
205  ///
206  /// @return
207  /// Reference to the member data.
208  const TLength_stats& GetLength_stats(void) const;
209 
210  /// Assign a value to Length_stats data member.
211  ///
212  /// @param value
213  /// Reference to value.
214  void SetLength_stats(TLength_stats& value);
215 
216  /// Assign a value to Length_stats data member.
217  ///
218  /// @return
219  /// Reference to the data value.
220  TLength_stats& SetLength_stats(void);
221 
222  /// Check if a value has been assigned to Position_stats data member.
223  ///
224  /// Data member Position_stats is optional;
225  /// its type is defined as 'typedef CTMgr_PositionStats TPosition_stats'
226  /// @return
227  /// - true, if a value has been assigned.
228  /// - false, otherwise.
229  bool IsSetPosition_stats(void) const;
230 
231  /// Check if it is safe to call GetPosition_stats method.
232  ///
233  /// @return
234  /// - true, if the data member is getatable.
235  /// - false, otherwise.
236  bool CanGetPosition_stats(void) const;
237 
238  /// Reset Position_stats data member.
239  void ResetPosition_stats(void);
240 
241  /// Get the Position_stats member data.
242  ///
243  /// @return
244  /// Reference to the member data.
245  const TPosition_stats& GetPosition_stats(void) const;
246 
247  /// Assign a value to Position_stats data member.
248  ///
249  /// @param value
250  /// Reference to value.
251  void SetPosition_stats(TPosition_stats& value);
252 
253  /// Assign a value to Position_stats data member.
254  ///
255  /// @return
256  /// Reference to the data value.
257  TPosition_stats& SetPosition_stats(void);
258 
259  /// Reset the whole object
260  virtual void Reset(void);
261 
262 
263 private:
264  // Prohibit copy constructor and assignment operator
267 
268  // data
269  Uint4 m_set_State[1];
270  int m_Type;
271  int m_Count;
274 };
275 
276 /* @} */
277 
278 
279 
280 
281 
282 ///////////////////////////////////////////////////////////
283 ///////////////////// inline methods //////////////////////
284 ///////////////////////////////////////////////////////////
285 inline
287 {
288  return ((m_set_State[0] & 0x3) != 0);
289 }
290 
291 inline
293 {
294  return IsSetType();
295 }
296 
297 inline
299 {
300  m_Type = (int)(0);
301  m_set_State[0] &= ~0x3;
302 }
303 
304 inline
306 {
307  if (!CanGetType()) {
308  ThrowUnassigned(0);
309  }
310  return m_Type;
311 }
312 
313 inline
315 {
316  m_Type = value;
317  m_set_State[0] |= 0x3;
318 }
319 
320 inline
322 {
323 #ifdef _DEBUG
324  if (!IsSetType()) {
325  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
326  }
327 #endif
328  m_set_State[0] |= 0x1;
329  return m_Type;
330 }
331 
332 inline
334 {
335  return ((m_set_State[0] & 0xc) != 0);
336 }
337 
338 inline
340 {
341  return IsSetCount();
342 }
343 
344 inline
346 {
347  m_Count = 0;
348  m_set_State[0] &= ~0xc;
349 }
350 
351 inline
353 {
354  if (!CanGetCount()) {
355  ThrowUnassigned(1);
356  }
357  return m_Count;
358 }
359 
360 inline
362 {
363  m_Count = value;
364  m_set_State[0] |= 0xc;
365 }
366 
367 inline
369 {
370 #ifdef _DEBUG
371  if (!IsSetCount()) {
372  memset(&m_Count,UnassignedByte(),sizeof(m_Count));
373  }
374 #endif
375  m_set_State[0] |= 0x4;
376  return m_Count;
377 }
378 
379 inline
381 {
382  return m_Length_stats.NotEmpty();
383 }
384 
385 inline
387 {
388  return IsSetLength_stats();
389 }
390 
391 inline
393 {
394  if (!CanGetLength_stats()) {
395  ThrowUnassigned(2);
396  }
397  return (*m_Length_stats);
398 }
399 
400 inline
402 {
403  return m_Position_stats.NotEmpty();
404 }
405 
406 inline
408 {
409  return IsSetPosition_stats();
410 }
411 
412 inline
414 {
415  if (!CanGetPosition_stats()) {
416  ThrowUnassigned(3);
417  }
418  return (*m_Position_stats);
419 }
420 
421 ///////////////////////////////////////////////////////////
422 ////////////////// end of inline methods //////////////////
423 ///////////////////////////////////////////////////////////
424 
425 
426 
427 
428 
429 END_objects_SCOPE // namespace ncbi::objects::
430 
432 
433 
434 #endif // OBJECTS_TRACKMGR_TMGR_TYPESTAT_BASE_HPP
User-defined methods of the data storage class.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTMgr_TypeStat_Base –.
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
bool IsSetCount(void) const
Check if a value has been assigned to Count data member.
bool IsSetPosition_stats(void) const
Check if a value has been assigned to Position_stats data member.
const TPosition_stats & GetPosition_stats(void) const
Get the Position_stats member data.
TType GetType(void) const
Get the Type member data.
bool CanGetCount(void) const
Check if it is safe to call GetCount method.
CTMgr_TypeStat_Base & operator=(const CTMgr_TypeStat_Base &)
bool CanGetPosition_stats(void) const
Check if it is safe to call GetPosition_stats method.
CTMgr_LengthStats TLength_stats
bool CanGetLength_stats(void) const
Check if it is safe to call GetLength_stats method.
CRef< TLength_stats > m_Length_stats
bool CanGetType(void) const
Check if it is safe to call GetType method.
void ResetCount(void)
Reset Count data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
const TLength_stats & GetLength_stats(void) const
Get the Length_stats member data.
TCount GetCount(void) const
Get the Count member data.
CTMgr_PositionStats TPosition_stats
void ResetType(void)
Reset Type data member.
TCount & SetCount(void)
Assign a value to Count data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
CTMgr_TypeStat_Base(const CTMgr_TypeStat_Base &)
CSerialObject Tparent
TType & SetType(void)
Assign a value to Type data member.
CRef< TPosition_stats > m_Position_stats
bool IsSetLength_stats(void) const
Check if a value has been assigned to Length_stats data member.
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
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_TRACKMGR_EXPORT
Modified on Tue May 14 16:21:00 2024 by modify_doxy.py rev. 669887