NCBI C++ ToolKit
TMgr_PositionStats_.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_PositionStats_.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_POSITIONSTATS_BASE_HPP
42 #define OBJECTS_TRACKMGR_TMGR_POSITIONSTATS_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_PositionStats_Base --
69 ///
70 
72 {
74 public:
75  // constructor
77  // destructor
78  virtual ~CTMgr_PositionStats_Base(void);
79 
80  // type info
82 
83  // types
84  typedef TSeqPos TMin;
85  typedef TSeqPos TMax;
86 
87  // member index
88  enum class E_memberIndex {
89  e__allMandatory = 0,
90  e_min,
91  e_max
92  };
94 
95  // getters
96  // setters
97 
98  /// Check if a value has been assigned to Min data member.
99  ///
100  /// Data member Min is mandatory;
101  /// its type is defined as 'typedef TSeqPos TMin'
102  /// @return
103  /// - true, if a value has been assigned.
104  /// - false, otherwise.
105  bool IsSetMin(void) const;
106 
107  /// Check if it is safe to call GetMin method.
108  ///
109  /// @return
110  /// - true, if the data member is getatable.
111  /// - false, otherwise.
112  bool CanGetMin(void) const;
113 
114  /// Reset Min data member.
115  void ResetMin(void);
116 
117  /// Get the Min member data.
118  ///
119  /// @return
120  /// Copy of the member data.
121  TMin GetMin(void) const;
122 
123  /// Assign a value to Min data member.
124  ///
125  /// @param value
126  /// Value to assign
127  void SetMin(TMin value);
128 
129  /// Assign a value to Min data member.
130  ///
131  /// @return
132  /// Reference to the data value.
133  TMin& SetMin(void);
134 
135  /// Check if a value has been assigned to Max data member.
136  ///
137  /// Data member Max is mandatory;
138  /// its type is defined as 'typedef TSeqPos TMax'
139  /// @return
140  /// - true, if a value has been assigned.
141  /// - false, otherwise.
142  bool IsSetMax(void) const;
143 
144  /// Check if it is safe to call GetMax method.
145  ///
146  /// @return
147  /// - true, if the data member is getatable.
148  /// - false, otherwise.
149  bool CanGetMax(void) const;
150 
151  /// Reset Max data member.
152  void ResetMax(void);
153 
154  /// Get the Max member data.
155  ///
156  /// @return
157  /// Copy of the member data.
158  TMax GetMax(void) const;
159 
160  /// Assign a value to Max data member.
161  ///
162  /// @param value
163  /// Value to assign
164  void SetMax(TMax value);
165 
166  /// Assign a value to Max data member.
167  ///
168  /// @return
169  /// Reference to the data value.
170  TMax& SetMax(void);
171 
172  /// Reset the whole object
173  virtual void Reset(void);
174 
175 
176 private:
177  // Prohibit copy constructor and assignment operator
180 
181  // data
182  Uint4 m_set_State[1];
185 };
186 
187 /* @} */
188 
189 
190 
191 
192 
193 ///////////////////////////////////////////////////////////
194 ///////////////////// inline methods //////////////////////
195 ///////////////////////////////////////////////////////////
196 inline
198 {
199  return ((m_set_State[0] & 0x3) != 0);
200 }
201 
202 inline
204 {
205  return IsSetMin();
206 }
207 
208 inline
210 {
211  m_Min = 0;
212  m_set_State[0] &= ~0x3;
213 }
214 
215 inline
217 {
218  if (!CanGetMin()) {
219  ThrowUnassigned(0);
220  }
221  return m_Min;
222 }
223 
224 inline
226 {
227  m_Min = value;
228  m_set_State[0] |= 0x3;
229 }
230 
231 inline
233 {
234 #ifdef _DEBUG
235  if (!IsSetMin()) {
236  memset(&m_Min,UnassignedByte(),sizeof(m_Min));
237  }
238 #endif
239  m_set_State[0] |= 0x1;
240  return m_Min;
241 }
242 
243 inline
245 {
246  return ((m_set_State[0] & 0xc) != 0);
247 }
248 
249 inline
251 {
252  return IsSetMax();
253 }
254 
255 inline
257 {
258  m_Max = 0;
259  m_set_State[0] &= ~0xc;
260 }
261 
262 inline
264 {
265  if (!CanGetMax()) {
266  ThrowUnassigned(1);
267  }
268  return m_Max;
269 }
270 
271 inline
273 {
274  m_Max = value;
275  m_set_State[0] |= 0xc;
276 }
277 
278 inline
280 {
281 #ifdef _DEBUG
282  if (!IsSetMax()) {
283  memset(&m_Max,UnassignedByte(),sizeof(m_Max));
284  }
285 #endif
286  m_set_State[0] |= 0x4;
287  return m_Max;
288 }
289 
290 ///////////////////////////////////////////////////////////
291 ////////////////// end of inline methods //////////////////
292 ///////////////////////////////////////////////////////////
293 
294 
295 
296 
297 
298 END_objects_SCOPE // namespace ncbi::objects::
299 
301 
302 
303 #endif // OBJECTS_TRACKMGR_TMGR_POSITIONSTATS_BASE_HPP
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTMgr_PositionStats_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
bool CanGetMin(void) const
Check if it is safe to call GetMin method.
bool IsSetMin(void) const
Check if a value has been assigned to Min data member.
TMin & SetMin(void)
Assign a value to Min data member.
bool CanGetMax(void) const
Check if it is safe to call GetMax method.
TMax & SetMax(void)
Assign a value to Max data member.
TMin GetMin(void) const
Get the Min member data.
void ResetMin(void)
Reset Min data member.
void ResetMax(void)
Reset Max data member.
bool IsSetMax(void) const
Check if a value has been assigned to Max data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
CTMgr_PositionStats_Base & operator=(const CTMgr_PositionStats_Base &)
TMax GetMax(void) const
Get the Max member data.
CTMgr_PositionStats_Base(const CTMgr_PositionStats_Base &)
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 Jul 23 17:53:06 2024 by modify_doxy.py rev. 669887