NCBI C++ ToolKit
Entrez2_boolean_term_.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_term_.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_TERM_BASE_HPP
42 #define OBJECTS_ENTREZ2_ENTREZ2_BOOLEAN_TERM_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
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 ///*****************************************
70 /// the term is both sent and received as parts of
71 /// queries and replies. The attributes can be filled in
72 /// by either, but may be ignored by one or the other. Flags are
73 /// shown if a real value is only of use in the query (Q), only
74 /// in the reply (R), or used in both (B)
75 /// do-not-explode and do-not-translate are only active set by
76 /// by the query. However, they retain those settings in the
77 /// return value so they can be resent with a new query
78 ///******************************************
79 ///
80 /// CEntrez2_boolean_term_Base --
81 ///
82 
84 {
86 public:
87  // constructor
89  // destructor
90  virtual ~CEntrez2_boolean_term_Base(void);
91 
92  // type info
94 
95  // types
97  typedef string TTerm;
98  typedef int TTerm_count;
99  typedef bool TDo_not_explode;
100  typedef bool TDo_not_translate;
101 
102  // member index
103  enum class E_memberIndex {
104  e__allMandatory = 0,
105  e_field,
106  e_term,
107  e_term_count,
108  e_do_not_explode,
109  e_do_not_translate
110  };
112 
113  // getters
114  // setters
115 
116  /// B
117  /// Check if a value has been assigned to Field data member.
118  ///
119  /// Data member Field is mandatory;
120  /// its type is defined as 'typedef CEntrez2_field_id TField'
121  /// @return
122  /// - true, if a value has been assigned.
123  /// - false, otherwise.
124  bool IsSetField(void) const;
125 
126  /// Check if it is safe to call GetField method.
127  ///
128  /// @return
129  /// - true, if the data member is getatable.
130  /// - false, otherwise.
131  bool CanGetField(void) const;
132 
133  /// Reset Field data member.
134  void ResetField(void);
135 
136  /// Get the Field member data.
137  ///
138  /// @return
139  /// Reference to the member data.
140  const TField& GetField(void) const;
141 
142  /// Assign a value to Field data member.
143  ///
144  /// @param value
145  /// Value to assign
146  void SetField(const TField& value);
147 
148  /// Assign a value to Field data member.
149  ///
150  /// @return
151  /// Reference to the data value.
152  TField& SetField(void);
153 
154  /// B
155  /// Check if a value has been assigned to Term data member.
156  ///
157  /// Data member Term is mandatory;
158  /// its type is defined as 'typedef string TTerm'
159  /// @return
160  /// - true, if a value has been assigned.
161  /// - false, otherwise.
162  bool IsSetTerm(void) const;
163 
164  /// Check if it is safe to call GetTerm method.
165  ///
166  /// @return
167  /// - true, if the data member is getatable.
168  /// - false, otherwise.
169  bool CanGetTerm(void) const;
170 
171  /// Reset Term data member.
172  void ResetTerm(void);
173 
174  /// Get the Term member data.
175  ///
176  /// @return
177  /// Reference to the member data.
178  const TTerm& GetTerm(void) const;
179 
180  /// Assign a value to Term data member.
181  ///
182  /// @param value
183  /// Value to assign
184  void SetTerm(const TTerm& value);
185  void SetTerm(TTerm&& value);
186 
187  /// Assign a value to Term data member.
188  ///
189  /// @return
190  /// Reference to the data value.
191  TTerm& SetTerm(void);
192 
193  /// R count of records with term
194  /// Check if a value has been assigned to Term_count data member.
195  ///
196  /// Data member Term_count is optional;
197  /// its type is defined as 'typedef int TTerm_count'
198  /// @return
199  /// - true, if a value has been assigned.
200  /// - false, otherwise.
201  bool IsSetTerm_count(void) const;
202 
203  /// Check if it is safe to call GetTerm_count method.
204  ///
205  /// @return
206  /// - true, if the data member is getatable.
207  /// - false, otherwise.
208  bool CanGetTerm_count(void) const;
209 
210  /// Reset Term_count data member.
211  void ResetTerm_count(void);
212 
213  /// Get the Term_count member data.
214  ///
215  /// @return
216  /// Copy of the member data.
217  TTerm_count GetTerm_count(void) const;
218 
219  /// Assign a value to Term_count data member.
220  ///
221  /// @param value
222  /// Value to assign
223  void SetTerm_count(TTerm_count value);
224 
225  /// Assign a value to Term_count data member.
226  ///
227  /// @return
228  /// Reference to the data value.
229  TTerm_count& SetTerm_count(void);
230 
231  /// Q do not explode term
232  /// Check if a value has been assigned to Do_not_explode data member.
233  ///
234  /// Data member Do_not_explode is optional with default false;
235  /// its type is defined as 'typedef bool TDo_not_explode'
236  /// @return
237  /// - true, if a value has been assigned.
238  /// - false, otherwise.
239  bool IsSetDo_not_explode(void) const;
240 
241  /// Check if it is safe to call GetDo_not_explode method.
242  ///
243  /// @return
244  /// - true, if the data member is getatable.
245  /// - false, otherwise.
246  bool CanGetDo_not_explode(void) const;
247 
248  /// Reset Do_not_explode data member.
249  void ResetDo_not_explode(void);
250 
251  /// Assign default value to Do_not_explode data member.
252  void SetDefaultDo_not_explode(void);
253 
254  /// Get the Do_not_explode member data.
255  ///
256  /// @return
257  /// Copy of the member data.
258  TDo_not_explode GetDo_not_explode(void) const;
259 
260  /// Assign a value to Do_not_explode data member.
261  ///
262  /// @param value
263  /// Value to assign
264  void SetDo_not_explode(TDo_not_explode value);
265 
266  /// Assign a value to Do_not_explode data member.
267  ///
268  /// @return
269  /// Reference to the data value.
270  TDo_not_explode& SetDo_not_explode(void);
271 
272  /// Q do not use synonyms
273  /// Check if a value has been assigned to Do_not_translate data member.
274  ///
275  /// Data member Do_not_translate is optional with default false;
276  /// its type is defined as 'typedef bool TDo_not_translate'
277  /// @return
278  /// - true, if a value has been assigned.
279  /// - false, otherwise.
280  bool IsSetDo_not_translate(void) const;
281 
282  /// Check if it is safe to call GetDo_not_translate method.
283  ///
284  /// @return
285  /// - true, if the data member is getatable.
286  /// - false, otherwise.
287  bool CanGetDo_not_translate(void) const;
288 
289  /// Reset Do_not_translate data member.
290  void ResetDo_not_translate(void);
291 
292  /// Assign default value to Do_not_translate data member.
293  void SetDefaultDo_not_translate(void);
294 
295  /// Get the Do_not_translate member data.
296  ///
297  /// @return
298  /// Copy of the member data.
299  TDo_not_translate GetDo_not_translate(void) const;
300 
301  /// Assign a value to Do_not_translate data member.
302  ///
303  /// @param value
304  /// Value to assign
305  void SetDo_not_translate(TDo_not_translate value);
306 
307  /// Assign a value to Do_not_translate data member.
308  ///
309  /// @return
310  /// Reference to the data value.
311  TDo_not_translate& SetDo_not_translate(void);
312 
313  /// Reset the whole object
314  virtual void Reset(void);
315 
316 
317 private:
318  // Prohibit copy constructor and assignment operator
321 
322  // data
323  Uint4 m_set_State[1];
325  string m_Term;
329 };
330 
331 /* @} */
332 
333 
334 
335 
336 
337 ///////////////////////////////////////////////////////////
338 ///////////////////// inline methods //////////////////////
339 ///////////////////////////////////////////////////////////
340 inline
342 {
343  return ((m_set_State[0] & 0x3) != 0);
344 }
345 
346 inline
348 {
349  return IsSetField();
350 }
351 
352 inline
354 {
355  if (!CanGetField()) {
356  ThrowUnassigned(0);
357  }
358  return m_Field;
359 }
360 
361 inline
363 {
364  m_Field = value;
365  m_set_State[0] |= 0x3;
366 }
367 
368 inline
370 {
371  m_set_State[0] |= 0x1;
372  return m_Field;
373 }
374 
375 inline
377 {
378  return ((m_set_State[0] & 0xc) != 0);
379 }
380 
381 inline
383 {
384  return IsSetTerm();
385 }
386 
387 inline
389 {
390  if (!CanGetTerm()) {
391  ThrowUnassigned(1);
392  }
393  return m_Term;
394 }
395 
396 inline
398 {
399  m_Term = value;
400  m_set_State[0] |= 0xc;
401 }
402 
403 inline
405 {
406  m_Term = std::forward<CEntrez2_boolean_term_Base::TTerm>(value);
407  m_set_State[0] |= 0xc;
408 }
409 
410 inline
412 {
413 #ifdef _DEBUG
414  if (!IsSetTerm()) {
416  }
417 #endif
418  m_set_State[0] |= 0x4;
419  return m_Term;
420 }
421 
422 inline
424 {
425  return ((m_set_State[0] & 0x30) != 0);
426 }
427 
428 inline
430 {
431  return IsSetTerm_count();
432 }
433 
434 inline
436 {
437  m_Term_count = 0;
438  m_set_State[0] &= ~0x30;
439 }
440 
441 inline
443 {
444  if (!CanGetTerm_count()) {
445  ThrowUnassigned(2);
446  }
447  return m_Term_count;
448 }
449 
450 inline
452 {
454  m_set_State[0] |= 0x30;
455 }
456 
457 inline
459 {
460 #ifdef _DEBUG
461  if (!IsSetTerm_count()) {
462  memset(&m_Term_count,UnassignedByte(),sizeof(m_Term_count));
463  }
464 #endif
465  m_set_State[0] |= 0x10;
466  return m_Term_count;
467 }
468 
469 inline
471 {
472  return ((m_set_State[0] & 0xc0) != 0);
473 }
474 
475 inline
477 {
478  return true;
479 }
480 
481 inline
483 {
484  m_Do_not_explode = false;
485  m_set_State[0] &= ~0xc0;
486 }
487 
488 inline
490 {
492 }
493 
494 inline
496 {
497  return m_Do_not_explode;
498 }
499 
500 inline
502 {
504  m_set_State[0] |= 0xc0;
505 }
506 
507 inline
509 {
510 #ifdef _DEBUG
511  if (!IsSetDo_not_explode()) {
513  }
514 #endif
515  m_set_State[0] |= 0x40;
516  return m_Do_not_explode;
517 }
518 
519 inline
521 {
522  return ((m_set_State[0] & 0x300) != 0);
523 }
524 
525 inline
527 {
528  return true;
529 }
530 
531 inline
533 {
534  m_Do_not_translate = false;
535  m_set_State[0] &= ~0x300;
536 }
537 
538 inline
540 {
542 }
543 
544 inline
546 {
547  return m_Do_not_translate;
548 }
549 
550 inline
552 {
554  m_set_State[0] |= 0x300;
555 }
556 
557 inline
559 {
560 #ifdef _DEBUG
561  if (!IsSetDo_not_translate()) {
563  }
564 #endif
565  m_set_State[0] |= 0x100;
566  return m_Do_not_translate;
567 }
568 
569 ///////////////////////////////////////////////////////////
570 ////////////////// end of inline methods //////////////////
571 ///////////////////////////////////////////////////////////
572 
573 
574 
575 
576 
577 END_objects_SCOPE // namespace ncbi::objects::
578 
580 
581 
582 #endif // OBJECTS_ENTREZ2_ENTREZ2_BOOLEAN_TERM_BASE_HPP
User-defined methods of the data storage class.
***************************************** the term is both sent and received as parts of queries and ...
CEntrez2_field_id –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
void SetField(objects::CUser_object &user, const string &field_name, const string &val)
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
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
TDo_not_explode GetDo_not_explode(void) const
Get the Do_not_explode member data.
void ResetDo_not_translate(void)
Reset Do_not_translate data member.
TDo_not_translate & SetDo_not_translate(void)
Assign a value to Do_not_translate data member.
TTerm_count & SetTerm_count(void)
Assign a value to Term_count data member.
bool IsSetDo_not_translate(void) const
Q do not use synonyms Check if a value has been assigned to Do_not_translate data member.
bool CanGetDo_not_translate(void) const
Check if it is safe to call GetDo_not_translate method.
TTerm & SetTerm(void)
Assign a value to Term data member.
CEntrez2_boolean_term_Base & operator=(const CEntrez2_boolean_term_Base &)
TField & SetField(void)
Assign a value to Field data member.
CEntrez2_boolean_term_Base(const CEntrez2_boolean_term_Base &)
TTerm_count GetTerm_count(void) const
Get the Term_count member data.
void ResetDo_not_explode(void)
Reset Do_not_explode data member.
bool IsSetField(void) const
B Check if a value has been assigned to Field data member.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
void SetDefaultDo_not_translate(void)
Assign default value to Do_not_translate data member.
const TField & GetField(void) const
Get the Field member data.
bool IsSetDo_not_explode(void) const
Q do not explode term Check if a value has been assigned to Do_not_explode data member.
bool CanGetDo_not_explode(void) const
Check if it is safe to call GetDo_not_explode method.
bool IsSetTerm_count(void) const
R count of records with term Check if a value has been assigned to Term_count data member.
TDo_not_translate GetDo_not_translate(void) const
Get the Do_not_translate member data.
bool CanGetField(void) const
Check if it is safe to call GetField method.
bool CanGetTerm_count(void) const
Check if it is safe to call GetTerm_count method.
bool IsSetTerm(void) const
B Check if a value has been assigned to Term data member.
TDo_not_explode & SetDo_not_explode(void)
Assign a value to Do_not_explode data member.
void SetDefaultDo_not_explode(void)
Assign default value to Do_not_explode data member.
void ResetTerm_count(void)
Reset Term_count data member.
bool CanGetTerm(void) const
Check if it is safe to call GetTerm method.
const TTerm & GetTerm(void) const
Get the Term member data.
Modified on Sat Dec 09 04:46:55 2023 by modify_doxy.py rev. 669887