NCBI C++ ToolKit
Entrez2_id_list_.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 Entrez2_id_list_.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/entrez2/entrez2.asn">entrez2.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/entrez2/entrez2.def">entrez2.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_ENTREZ2_ENTREZ2_ID_LIST_BASE_HPP
42 #define OBJECTS_ENTREZ2_ENTREZ2_ID_LIST_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Entrez2
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 /// list of record UIDs
70 ///
71 /// CEntrez2_id_list_Base --
72 ///
73 
75 {
77 public:
78  // constructor
80  // destructor
81  virtual ~CEntrez2_id_list_Base(void);
82 
83  // type info
85 
86  // types
88  typedef int TNum;
89  typedef vector< char > TUids;
90 
91  // member index
92  enum class E_memberIndex {
93  e__allMandatory = 0,
94  e_db,
95  e_num,
96  e_uids
97  };
99 
100  // getters
101  // setters
102 
103  /// the database
104  /// Check if a value has been assigned to Db data member.
105  ///
106  /// Data member Db is mandatory;
107  /// its type is defined as 'typedef CEntrez2_db_id TDb'
108  /// @return
109  /// - true, if a value has been assigned.
110  /// - false, otherwise.
111  bool IsSetDb(void) const;
112 
113  /// Check if it is safe to call GetDb method.
114  ///
115  /// @return
116  /// - true, if the data member is getatable.
117  /// - false, otherwise.
118  bool CanGetDb(void) const;
119 
120  /// Reset Db data member.
121  void ResetDb(void);
122 
123  /// Get the Db member data.
124  ///
125  /// @return
126  /// Reference to the member data.
127  const TDb& GetDb(void) const;
128 
129  /// Assign a value to Db data member.
130  ///
131  /// @param value
132  /// Value to assign
133  void SetDb(const TDb& value);
134 
135  /// Assign a value to Db data member.
136  ///
137  /// @return
138  /// Reference to the data value.
139  TDb& SetDb(void);
140 
141  /// number of uids
142  /// Check if a value has been assigned to Num data member.
143  ///
144  /// Data member Num is mandatory;
145  /// its type is defined as 'typedef int TNum'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetNum(void) const;
150 
151  /// Check if it is safe to call GetNum method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetNum(void) const;
157 
158  /// Reset Num data member.
159  void ResetNum(void);
160 
161  /// Get the Num member data.
162  ///
163  /// @return
164  /// Copy of the member data.
165  TNum GetNum(void) const;
166 
167  /// Assign a value to Num data member.
168  ///
169  /// @param value
170  /// Value to assign
171  void SetNum(TNum value);
172 
173  /// Assign a value to Num data member.
174  ///
175  /// @return
176  /// Reference to the data value.
177  TNum& SetNum(void);
178 
179  /// coded uids
180  /// Check if a value has been assigned to Uids data member.
181  ///
182  /// Data member Uids is optional;
183  /// its type is defined as 'typedef vector< char > TUids'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetUids(void) const;
188 
189  /// Check if it is safe to call GetUids method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetUids(void) const;
195 
196  /// Reset Uids data member.
197  void ResetUids(void);
198 
199  /// Get the Uids member data.
200  ///
201  /// @return
202  /// Reference to the member data.
203  const TUids& GetUids(void) const;
204 
205  /// Assign a value to Uids data member.
206  ///
207  /// @return
208  /// Reference to the data value.
209  TUids& SetUids(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];
223  int m_Num;
224  vector< char > m_Uids;
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 IsSetDb();
246 }
247 
248 inline
250 {
251  if (!CanGetDb()) {
252  ThrowUnassigned(0);
253  }
254  return m_Db;
255 }
256 
257 inline
259 {
260  m_Db = value;
261  m_set_State[0] |= 0x3;
262 }
263 
264 inline
266 {
267  m_set_State[0] |= 0x1;
268  return m_Db;
269 }
270 
271 inline
273 {
274  return ((m_set_State[0] & 0xc) != 0);
275 }
276 
277 inline
279 {
280  return IsSetNum();
281 }
282 
283 inline
285 {
286  m_Num = 0;
287  m_set_State[0] &= ~0xc;
288 }
289 
290 inline
292 {
293  if (!CanGetNum()) {
294  ThrowUnassigned(1);
295  }
296  return m_Num;
297 }
298 
299 inline
301 {
302  m_Num = value;
303  m_set_State[0] |= 0xc;
304 }
305 
306 inline
308 {
309 #ifdef _DEBUG
310  if (!IsSetNum()) {
311  memset(&m_Num,UnassignedByte(),sizeof(m_Num));
312  }
313 #endif
314  m_set_State[0] |= 0x4;
315  return m_Num;
316 }
317 
318 inline
320 {
321  return ((m_set_State[0] & 0x30) != 0);
322 }
323 
324 inline
326 {
327  return IsSetUids();
328 }
329 
330 inline
332 {
333  if (!CanGetUids()) {
334  ThrowUnassigned(2);
335  }
336  return m_Uids;
337 }
338 
339 inline
341 {
342  m_set_State[0] |= 0x10;
343  return m_Uids;
344 }
345 
346 ///////////////////////////////////////////////////////////
347 ////////////////// end of inline methods //////////////////
348 ///////////////////////////////////////////////////////////
349 
350 
351 
352 
353 
354 END_objects_SCOPE // namespace ncbi::objects::
355 
357 
358 
359 #endif // OBJECTS_ENTREZ2_ENTREZ2_ID_LIST_BASE_HPP
User-defined methods of the data storage class.
CEntrez2_db_id –.
list of record UIDs
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_ENTREZ2_EXPORT
Definition: ncbi_export.h:464
void ResetNum(void)
Reset Num data member.
CEntrez2_id_list_Base(const CEntrez2_id_list_Base &)
TUids & SetUids(void)
Assign a value to Uids data member.
bool IsSetDb(void) const
the database Check if a value has been assigned to Db data member.
const TUids & GetUids(void) const
Get the Uids member data.
bool CanGetUids(void) const
Check if it is safe to call GetUids method.
TNum GetNum(void) const
Get the Num member data.
bool CanGetNum(void) const
Check if it is safe to call GetNum method.
TDb & SetDb(void)
Assign a value to Db data member.
bool IsSetUids(void) const
coded uids Check if a value has been assigned to Uids data member.
CEntrez2_id_list_Base & operator=(const CEntrez2_id_list_Base &)
bool IsSetNum(void) const
number of uids Check if a value has been assigned to Num data member.
bool CanGetDb(void) const
Check if it is safe to call GetDb method.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TNum & SetNum(void)
Assign a value to Num data member.
const TDb & GetDb(void) const
Get the Db member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue Apr 23 07:41:03 2024 by modify_doxy.py rev. 669887