NCBI C++ ToolKit
Entrez2_boolean_reply_.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_boolean_reply_.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_BOOLEAN_REPLY_BASE_HPP
42 #define OBJECTS_ENTREZ2_ENTREZ2_BOOLEAN_REPLY_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
47 
48 #ifndef BEGIN_objects_SCOPE
49 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
50 # define END_objects_SCOPE END_SCOPE(objects)
51 #endif
52 BEGIN_objects_SCOPE // namespace ncbi::objects::
53 
54 
55 // forward declarations
57 class CEntrez2_id_list;
58 
59 
60 // generated classes
61 
62 
63 /** @addtogroup dataspec_NCBI_Entrez2
64  *
65  * @{
66  */
67 
68 /////////////////////////////////////////////////////////////////////////////
69 ///
70 /// CEntrez2_boolean_reply_Base --
71 ///
72 
74 {
76 public:
77  // constructor
79  // destructor
80  virtual ~CEntrez2_boolean_reply_Base(void);
81 
82  // type info
84 
85  // types
86  typedef int TCount;
89 
90  // member index
91  enum class E_memberIndex {
92  e__allMandatory = 0,
93  e_count,
94  e_uids,
95  e_query
96  };
98 
99  // getters
100  // setters
101 
102  /// records hit
103  /// Check if a value has been assigned to Count data member.
104  ///
105  /// Data member Count is mandatory;
106  /// its type is defined as 'typedef int TCount'
107  /// @return
108  /// - true, if a value has been assigned.
109  /// - false, otherwise.
110  bool IsSetCount(void) const;
111 
112  /// Check if it is safe to call GetCount method.
113  ///
114  /// @return
115  /// - true, if the data member is getatable.
116  /// - false, otherwise.
117  bool CanGetCount(void) const;
118 
119  /// Reset Count data member.
120  void ResetCount(void);
121 
122  /// Get the Count member data.
123  ///
124  /// @return
125  /// Copy of the member data.
126  TCount GetCount(void) const;
127 
128  /// Assign a value to Count data member.
129  ///
130  /// @param value
131  /// Value to assign
132  void SetCount(TCount value);
133 
134  /// Assign a value to Count data member.
135  ///
136  /// @return
137  /// Reference to the data value.
138  TCount& SetCount(void);
139 
140  /// if uids requested
141  /// Check if a value has been assigned to Uids data member.
142  ///
143  /// Data member Uids is optional;
144  /// its type is defined as 'typedef CEntrez2_id_list TUids'
145  /// @return
146  /// - true, if a value has been assigned.
147  /// - false, otherwise.
148  bool IsSetUids(void) const;
149 
150  /// Check if it is safe to call GetUids method.
151  ///
152  /// @return
153  /// - true, if the data member is getatable.
154  /// - false, otherwise.
155  bool CanGetUids(void) const;
156 
157  /// Reset Uids data member.
158  void ResetUids(void);
159 
160  /// Get the Uids member data.
161  ///
162  /// @return
163  /// Reference to the member data.
164  const TUids& GetUids(void) const;
165 
166  /// Assign a value to Uids data member.
167  ///
168  /// @param value
169  /// Reference to value.
170  void SetUids(TUids& value);
171 
172  /// Assign a value to Uids data member.
173  ///
174  /// @return
175  /// Reference to the data value.
176  TUids& SetUids(void);
177 
178  /// if parsed query requested
179  /// Check if a value has been assigned to Query data member.
180  ///
181  /// Data member Query is optional;
182  /// its type is defined as 'typedef CEntrez2_boolean_exp TQuery'
183  /// @return
184  /// - true, if a value has been assigned.
185  /// - false, otherwise.
186  bool IsSetQuery(void) const;
187 
188  /// Check if it is safe to call GetQuery method.
189  ///
190  /// @return
191  /// - true, if the data member is getatable.
192  /// - false, otherwise.
193  bool CanGetQuery(void) const;
194 
195  /// Reset Query data member.
196  void ResetQuery(void);
197 
198  /// Get the Query member data.
199  ///
200  /// @return
201  /// Reference to the member data.
202  const TQuery& GetQuery(void) const;
203 
204  /// Assign a value to Query data member.
205  ///
206  /// @param value
207  /// Reference to value.
208  void SetQuery(TQuery& value);
209 
210  /// Assign a value to Query data member.
211  ///
212  /// @return
213  /// Reference to the data value.
214  TQuery& SetQuery(void);
215 
216  /// Reset the whole object
217  virtual void Reset(void);
218 
219 
220 private:
221  // Prohibit copy constructor and assignment operator
224 
225  // data
226  Uint4 m_set_State[1];
227  int m_Count;
230 };
231 
232 /* @} */
233 
234 
235 
236 
237 
238 ///////////////////////////////////////////////////////////
239 ///////////////////// inline methods //////////////////////
240 ///////////////////////////////////////////////////////////
241 inline
243 {
244  return ((m_set_State[0] & 0x3) != 0);
245 }
246 
247 inline
249 {
250  return IsSetCount();
251 }
252 
253 inline
255 {
256  m_Count = 0;
257  m_set_State[0] &= ~0x3;
258 }
259 
260 inline
262 {
263  if (!CanGetCount()) {
264  ThrowUnassigned(0);
265  }
266  return m_Count;
267 }
268 
269 inline
271 {
272  m_Count = value;
273  m_set_State[0] |= 0x3;
274 }
275 
276 inline
278 {
279 #ifdef _DEBUG
280  if (!IsSetCount()) {
281  memset(&m_Count,UnassignedByte(),sizeof(m_Count));
282  }
283 #endif
284  m_set_State[0] |= 0x1;
285  return m_Count;
286 }
287 
288 inline
290 {
291  return m_Uids.NotEmpty();
292 }
293 
294 inline
296 {
297  return IsSetUids();
298 }
299 
300 inline
302 {
303  if (!CanGetUids()) {
304  ThrowUnassigned(1);
305  }
306  return (*m_Uids);
307 }
308 
309 inline
311 {
312  return m_Query.NotEmpty();
313 }
314 
315 inline
317 {
318  return IsSetQuery();
319 }
320 
321 inline
323 {
324  if (!CanGetQuery()) {
325  ThrowUnassigned(2);
326  }
327  return (*m_Query);
328 }
329 
330 ///////////////////////////////////////////////////////////
331 ////////////////// end of inline methods //////////////////
332 ///////////////////////////////////////////////////////////
333 
334 
335 
336 
337 
338 END_objects_SCOPE // namespace ncbi::objects::
339 
341 
342 
343 #endif // OBJECTS_ENTREZ2_ENTREZ2_BOOLEAN_REPLY_BASE_HPP
CEntrez2_boolean_exp –.
CEntrez2_boolean_reply_Base –.
CRef –.
Definition: ncbiobj.hpp:618
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_boolean_reply_Base & operator=(const CEntrez2_boolean_reply_Base &)
const TUids & GetUids(void) const
Get the Uids member data.
const TQuery & GetQuery(void) const
Get the Query member data.
bool CanGetUids(void) const
Check if it is safe to call GetUids method.
bool CanGetCount(void) const
Check if it is safe to call GetCount method.
void ResetCount(void)
Reset Count data member.
bool IsSetUids(void) const
if uids requested Check if a value has been assigned to Uids data member.
bool IsSetCount(void) const
records hit Check if a value has been assigned to Count data member.
bool CanGetQuery(void) const
Check if it is safe to call GetQuery method.
TCount GetCount(void) const
Get the Count member data.
bool IsSetQuery(void) const
if parsed query requested Check if a value has been assigned to Query data member.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
TCount & SetCount(void)
Assign a value to Count data member.
CEntrez2_boolean_reply_Base(const CEntrez2_boolean_reply_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:56 2024 by modify_doxy.py rev. 669887