NCBI C++ ToolKit
Entrez2_info_.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_info_.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_INFO_BASE_HPP
42 #define OBJECTS_ENTREZ2_ENTREZ2_INFO_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 // forward declarations
61 class CEntrez2_db_info;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_Entrez2
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 /// describes all the databases
74 ///
75 /// CEntrez2_info_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CEntrez2_info_Base(void);
84  // destructor
85  virtual ~CEntrez2_info_Base(void);
86 
87  // type info
89 
90  // types
91  typedef int TDb_count;
93  typedef list< CRef< CEntrez2_db_info > > TDb_info;
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_db_count,
99  e_build_date,
100  e_db_info
101  };
103 
104  // getters
105  // setters
106 
107  /// number of databases
108  /// Check if a value has been assigned to Db_count data member.
109  ///
110  /// Data member Db_count is mandatory;
111  /// its type is defined as 'typedef int TDb_count'
112  /// @return
113  /// - true, if a value has been assigned.
114  /// - false, otherwise.
115  bool IsSetDb_count(void) const;
116 
117  /// Check if it is safe to call GetDb_count method.
118  ///
119  /// @return
120  /// - true, if the data member is getatable.
121  /// - false, otherwise.
122  bool CanGetDb_count(void) const;
123 
124  /// Reset Db_count data member.
125  void ResetDb_count(void);
126 
127  /// Get the Db_count member data.
128  ///
129  /// @return
130  /// Copy of the member data.
131  TDb_count GetDb_count(void) const;
132 
133  /// Assign a value to Db_count data member.
134  ///
135  /// @param value
136  /// Value to assign
137  void SetDb_count(TDb_count value);
138 
139  /// Assign a value to Db_count data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TDb_count& SetDb_count(void);
144 
145  /// build date of databases
146  /// Check if a value has been assigned to Build_date data member.
147  ///
148  /// Data member Build_date is mandatory;
149  /// its type is defined as 'typedef CEntrez2_dt TBuild_date'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetBuild_date(void) const;
154 
155  /// Check if it is safe to call GetBuild_date method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetBuild_date(void) const;
161 
162  /// Reset Build_date data member.
163  void ResetBuild_date(void);
164 
165  /// Get the Build_date member data.
166  ///
167  /// @return
168  /// Reference to the member data.
169  const TBuild_date& GetBuild_date(void) const;
170 
171  /// Assign a value to Build_date data member.
172  ///
173  /// @param value
174  /// Value to assign
175  void SetBuild_date(const TBuild_date& value);
176 
177  /// Assign a value to Build_date data member.
178  ///
179  /// @return
180  /// Reference to the data value.
181  TBuild_date& SetBuild_date(void);
182 
183  /// info by database
184  /// Check if a value has been assigned to Db_info data member.
185  ///
186  /// Data member Db_info is mandatory;
187  /// its type is defined as 'typedef list< CRef< CEntrez2_db_info > > TDb_info'
188  /// @return
189  /// - true, if a value has been assigned.
190  /// - false, otherwise.
191  bool IsSetDb_info(void) const;
192 
193  /// Check if it is safe to call GetDb_info method.
194  ///
195  /// @return
196  /// - true, if the data member is getatable.
197  /// - false, otherwise.
198  bool CanGetDb_info(void) const;
199 
200  /// Reset Db_info data member.
201  void ResetDb_info(void);
202 
203  /// Get the Db_info member data.
204  ///
205  /// @return
206  /// Reference to the member data.
207  const TDb_info& GetDb_info(void) const;
208 
209  /// Assign a value to Db_info data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TDb_info& SetDb_info(void);
214 
215  /// Reset the whole object
216  virtual void Reset(void);
217 
218 
219 private:
220  // Prohibit copy constructor and assignment operator
223 
224  // data
225  Uint4 m_set_State[1];
228  list< CRef< CEntrez2_db_info > > m_Db_info;
229 };
230 
231 /* @} */
232 
233 
234 
235 
236 
237 ///////////////////////////////////////////////////////////
238 ///////////////////// inline methods //////////////////////
239 ///////////////////////////////////////////////////////////
240 inline
242 {
243  return ((m_set_State[0] & 0x3) != 0);
244 }
245 
246 inline
248 {
249  return IsSetDb_count();
250 }
251 
252 inline
254 {
255  m_Db_count = 0;
256  m_set_State[0] &= ~0x3;
257 }
258 
259 inline
261 {
262  if (!CanGetDb_count()) {
263  ThrowUnassigned(0);
264  }
265  return m_Db_count;
266 }
267 
268 inline
270 {
271  m_Db_count = value;
272  m_set_State[0] |= 0x3;
273 }
274 
275 inline
277 {
278 #ifdef _DEBUG
279  if (!IsSetDb_count()) {
280  memset(&m_Db_count,UnassignedByte(),sizeof(m_Db_count));
281  }
282 #endif
283  m_set_State[0] |= 0x1;
284  return m_Db_count;
285 }
286 
287 inline
289 {
290  return ((m_set_State[0] & 0xc) != 0);
291 }
292 
293 inline
295 {
296  return IsSetBuild_date();
297 }
298 
299 inline
301 {
303  m_set_State[0] &= ~0xc;
304 }
305 
306 inline
308 {
309  if (!CanGetBuild_date()) {
310  ThrowUnassigned(1);
311  }
312  return m_Build_date;
313 }
314 
315 inline
317 {
319  m_set_State[0] |= 0xc;
320 }
321 
322 inline
324 {
325  m_set_State[0] |= 0x4;
326  return m_Build_date;
327 }
328 
329 inline
331 {
332  return ((m_set_State[0] & 0x30) != 0);
333 }
334 
335 inline
337 {
338  return true;
339 }
340 
341 inline
343 {
344  return m_Db_info;
345 }
346 
347 inline
349 {
350  m_set_State[0] |= 0x10;
351  return m_Db_info;
352 }
353 
354 ///////////////////////////////////////////////////////////
355 ////////////////// end of inline methods //////////////////
356 ///////////////////////////////////////////////////////////
357 
358 
359 
360 
361 
362 END_objects_SCOPE // namespace ncbi::objects::
363 
365 
366 
367 #endif // OBJECTS_ENTREZ2_ENTREZ2_INFO_BASE_HPP
User-defined methods of the data storage class.
CEntrez2_db_info –.
CEntrez2_dt –.
Definition: Entrez2_dt.hpp:66
describes all the databases
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
CEntrez2_dt TBuild_date
CSerialObject Tparent
bool IsSetDb_count(void) const
number of databases Check if a value has been assigned to Db_count data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool CanGetDb_info(void) const
Check if it is safe to call GetDb_info method.
TDb_count GetDb_count(void) const
Get the Db_count member data.
TDb_info & SetDb_info(void)
Assign a value to Db_info data member.
TDb_count & SetDb_count(void)
Assign a value to Db_count data member.
TBuild_date & SetBuild_date(void)
Assign a value to Build_date data member.
bool CanGetBuild_date(void) const
Check if it is safe to call GetBuild_date method.
list< CRef< CEntrez2_db_info > > TDb_info
const TDb_info & GetDb_info(void) const
Get the Db_info member data.
bool IsSetBuild_date(void) const
build date of databases Check if a value has been assigned to Build_date data member.
CEntrez2_dt m_Build_date
bool CanGetDb_count(void) const
Check if it is safe to call GetDb_count method.
void ResetDb_count(void)
Reset Db_count data member.
const TBuild_date & GetBuild_date(void) const
Get the Build_date member data.
bool IsSetDb_info(void) const
info by database Check if a value has been assigned to Db_info data member.
list< CRef< CEntrez2_db_info > > m_Db_info
CEntrez2_info_Base(const CEntrez2_info_Base &)
void ResetBuild_date(void)
Reset Build_date data member.
CEntrez2_info_Base & operator=(const CEntrez2_info_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue May 28 05:50:44 2024 by modify_doxy.py rev. 669887