NCBI C++ ToolKit
GBL_Data_.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 GBL_Data_.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/genesbyloc/genesbyloc.asn">genesbyloc.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/genesbyloc/genesbyloc.def">genesbyloc.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_GENESBYLOC_GBL_DATA_BASE_HPP
42 #define OBJECTS_GENESBYLOC_GBL_DATA_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 // forward declarations
60 class CGBL_Gene;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_GenesByLoc
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CGBL_Data_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CGBL_Data_Base(void);
82  // destructor
83  virtual ~CGBL_Data_Base(void);
84 
85  // type info
87 
88  // types
89  typedef int TTotal;
90  typedef int TReturned;
91  typedef list< CRef< CGBL_Gene > > TGenes;
92 
93  // member index
94  enum class E_memberIndex {
95  e__allMandatory = 0,
96  e_total,
97  e_returned,
98  e_genes
99  };
101 
102  // getters
103  // setters
104 
105  /// total number of genes found
106  /// Check if a value has been assigned to Total data member.
107  ///
108  /// Data member Total is mandatory;
109  /// its type is defined as 'typedef int TTotal'
110  /// @return
111  /// - true, if a value has been assigned.
112  /// - false, otherwise.
113  bool IsSetTotal(void) const;
114 
115  /// Check if it is safe to call GetTotal method.
116  ///
117  /// @return
118  /// - true, if the data member is getatable.
119  /// - false, otherwise.
120  bool CanGetTotal(void) const;
121 
122  /// Reset Total data member.
123  void ResetTotal(void);
124 
125  /// Get the Total member data.
126  ///
127  /// @return
128  /// Copy of the member data.
129  TTotal GetTotal(void) const;
130 
131  /// Assign a value to Total data member.
132  ///
133  /// @param value
134  /// Value to assign
135  void SetTotal(TTotal value);
136 
137  /// Assign a value to Total data member.
138  ///
139  /// @return
140  /// Reference to the data value.
141  TTotal& SetTotal(void);
142 
143  /// number of gene records returned in the reply data, may be less than the total gene count
144  /// Check if a value has been assigned to Returned data member.
145  ///
146  /// Data member Returned is mandatory;
147  /// its type is defined as 'typedef int TReturned'
148  /// @return
149  /// - true, if a value has been assigned.
150  /// - false, otherwise.
151  bool IsSetReturned(void) const;
152 
153  /// Check if it is safe to call GetReturned method.
154  ///
155  /// @return
156  /// - true, if the data member is getatable.
157  /// - false, otherwise.
158  bool CanGetReturned(void) const;
159 
160  /// Reset Returned data member.
161  void ResetReturned(void);
162 
163  /// Get the Returned member data.
164  ///
165  /// @return
166  /// Copy of the member data.
167  TReturned GetReturned(void) const;
168 
169  /// Assign a value to Returned data member.
170  ///
171  /// @param value
172  /// Value to assign
173  void SetReturned(TReturned value);
174 
175  /// Assign a value to Returned data member.
176  ///
177  /// @return
178  /// Reference to the data value.
179  TReturned& SetReturned(void);
180 
181  /// Check if a value has been assigned to Genes data member.
182  ///
183  /// Data member Genes is optional;
184  /// its type is defined as 'typedef list< CRef< CGBL_Gene > > TGenes'
185  /// @return
186  /// - true, if a value has been assigned.
187  /// - false, otherwise.
188  bool IsSetGenes(void) const;
189 
190  /// Check if it is safe to call GetGenes method.
191  ///
192  /// @return
193  /// - true, if the data member is getatable.
194  /// - false, otherwise.
195  bool CanGetGenes(void) const;
196 
197  /// Reset Genes data member.
198  void ResetGenes(void);
199 
200  /// Get the Genes member data.
201  ///
202  /// @return
203  /// Reference to the member data.
204  const TGenes& GetGenes(void) const;
205 
206  /// Assign a value to Genes data member.
207  ///
208  /// @return
209  /// Reference to the data value.
210  TGenes& SetGenes(void);
211 
212  /// Reset the whole object
213  virtual void Reset(void);
214 
215 
216 private:
217  // Prohibit copy constructor and assignment operator
220 
221  // data
222  Uint4 m_set_State[1];
223  int m_Total;
225  list< CRef< CGBL_Gene > > m_Genes;
226 };
227 
228 /* @} */
229 
230 
231 
232 
233 
234 ///////////////////////////////////////////////////////////
235 ///////////////////// inline methods //////////////////////
236 ///////////////////////////////////////////////////////////
237 inline
239 {
240  return ((m_set_State[0] & 0x3) != 0);
241 }
242 
243 inline
245 {
246  return IsSetTotal();
247 }
248 
249 inline
251 {
252  m_Total = 0;
253  m_set_State[0] &= ~0x3;
254 }
255 
256 inline
258 {
259  if (!CanGetTotal()) {
260  ThrowUnassigned(0);
261  }
262  return m_Total;
263 }
264 
265 inline
267 {
268  m_Total = value;
269  m_set_State[0] |= 0x3;
270 }
271 
272 inline
274 {
275 #ifdef _DEBUG
276  if (!IsSetTotal()) {
277  memset(&m_Total,UnassignedByte(),sizeof(m_Total));
278  }
279 #endif
280  m_set_State[0] |= 0x1;
281  return m_Total;
282 }
283 
284 inline
286 {
287  return ((m_set_State[0] & 0xc) != 0);
288 }
289 
290 inline
292 {
293  return IsSetReturned();
294 }
295 
296 inline
298 {
299  m_Returned = 0;
300  m_set_State[0] &= ~0xc;
301 }
302 
303 inline
305 {
306  if (!CanGetReturned()) {
307  ThrowUnassigned(1);
308  }
309  return m_Returned;
310 }
311 
312 inline
314 {
315  m_Returned = value;
316  m_set_State[0] |= 0xc;
317 }
318 
319 inline
321 {
322 #ifdef _DEBUG
323  if (!IsSetReturned()) {
324  memset(&m_Returned,UnassignedByte(),sizeof(m_Returned));
325  }
326 #endif
327  m_set_State[0] |= 0x4;
328  return m_Returned;
329 }
330 
331 inline
333 {
334  return ((m_set_State[0] & 0x30) != 0);
335 }
336 
337 inline
339 {
340  return true;
341 }
342 
343 inline
345 {
346  return m_Genes;
347 }
348 
349 inline
351 {
352  m_set_State[0] |= 0x10;
353  return m_Genes;
354 }
355 
356 ///////////////////////////////////////////////////////////
357 ////////////////// end of inline methods //////////////////
358 ///////////////////////////////////////////////////////////
359 
360 
361 
362 
363 
364 END_objects_SCOPE // namespace ncbi::objects::
365 
367 
368 
369 #endif // OBJECTS_GENESBYLOC_GBL_DATA_BASE_HPP
CGBL_Data_Base –.
Definition: GBL_Data_.hpp:77
CGBL_Gene –.
Definition: GBL_Gene.hpp:66
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_GENESBYLOC_EXPORT
Definition: ncbi_export.h:520
DECLARE_INTERNAL_TYPE_INFO()
bool IsSetTotal(void) const
total number of genes found Check if a value has been assigned to Total data member.
Definition: GBL_Data_.hpp:238
void ResetReturned(void)
Reset Returned data member.
Definition: GBL_Data_.hpp:297
bool CanGetTotal(void) const
Check if it is safe to call GetTotal method.
Definition: GBL_Data_.hpp:244
TReturned GetReturned(void) const
Get the Returned member data.
Definition: GBL_Data_.hpp:304
list< CRef< CGBL_Gene > > TGenes
Definition: GBL_Data_.hpp:91
CGBL_Data_Base(const CGBL_Data_Base &)
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: GBL_Data_.hpp:100
CGBL_Data_Base & operator=(const CGBL_Data_Base &)
bool CanGetReturned(void) const
Check if it is safe to call GetReturned method.
Definition: GBL_Data_.hpp:291
bool IsSetReturned(void) const
number of gene records returned in the reply data, may be less than the total gene count Check if a v...
Definition: GBL_Data_.hpp:285
TTotal GetTotal(void) const
Get the Total member data.
Definition: GBL_Data_.hpp:257
TGenes & SetGenes(void)
Assign a value to Genes data member.
Definition: GBL_Data_.hpp:350
TTotal & SetTotal(void)
Assign a value to Total data member.
Definition: GBL_Data_.hpp:273
TReturned & SetReturned(void)
Assign a value to Returned data member.
Definition: GBL_Data_.hpp:320
Uint4 m_set_State[1]
Definition: GBL_Data_.hpp:222
list< CRef< CGBL_Gene > > m_Genes
Definition: GBL_Data_.hpp:225
bool IsSetGenes(void) const
Check if a value has been assigned to Genes data member.
Definition: GBL_Data_.hpp:332
void ResetTotal(void)
Reset Total data member.
Definition: GBL_Data_.hpp:250
CSerialObject Tparent
Definition: GBL_Data_.hpp:78
bool CanGetGenes(void) const
Check if it is safe to call GetGenes method.
Definition: GBL_Data_.hpp:338
const TGenes & GetGenes(void) const
Get the Genes member data.
Definition: GBL_Data_.hpp:344
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:25 2024 by modify_doxy.py rev. 669887