NCBI C++ ToolKit
Entrez2_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_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_REPLY_BASE_HPP
42 #define OBJECTS_ENTREZ2_ENTREZ2_REPLY_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 // forward declarations
61 class CE2Reply;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_Entrez2
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///**********************************************************
74 /// Replies from the Entrez server
75 /// all replies contain the date/time stamp when they were executed
76 /// to do reqular date bounded searches use this value+1 to search
77 /// again later instead of recording the date/time on the client machine
78 /// the cookie allows a simple key string to represent UID lists in the history
79 ///**********************************************************
80 ///
81 /// CEntrez2_reply_Base --
82 ///
83 
85 {
87 public:
88  // constructor
89  CEntrez2_reply_Base(void);
90  // destructor
91  virtual ~CEntrez2_reply_Base(void);
92 
93  // type info
95 
96  // types
97  typedef CE2Reply TReply;
98  typedef CEntrez2_dt TDt;
99  typedef string TServer;
100  typedef string TMsg;
101  typedef string TKey;
102  typedef string TCookie;
103 
104  // member index
105  enum class E_memberIndex {
106  e__allMandatory = 0,
107  e_reply,
108  e_dt,
109  e_server,
110  e_msg,
111  e_key,
112  e_cookie
113  };
115 
116  // getters
117  // setters
118 
119  /// the actual reply
120  /// Check if a value has been assigned to Reply data member.
121  ///
122  /// Data member Reply is mandatory;
123  /// its type is defined as 'typedef CE2Reply TReply'
124  /// @return
125  /// - true, if a value has been assigned.
126  /// - false, otherwise.
127  bool IsSetReply(void) const;
128 
129  /// Check if it is safe to call GetReply method.
130  ///
131  /// @return
132  /// - true, if the data member is getatable.
133  /// - false, otherwise.
134  bool CanGetReply(void) const;
135 
136  /// Reset Reply data member.
137  void ResetReply(void);
138 
139  /// Get the Reply member data.
140  ///
141  /// @return
142  /// Reference to the member data.
143  const TReply& GetReply(void) const;
144 
145  /// Assign a value to Reply data member.
146  ///
147  /// @param value
148  /// Reference to value.
149  void SetReply(TReply& value);
150 
151  /// Assign a value to Reply data member.
152  ///
153  /// @return
154  /// Reference to the data value.
155  TReply& SetReply(void);
156 
157  /// date/time stamp from server
158  /// Check if a value has been assigned to Dt data member.
159  ///
160  /// Data member Dt is mandatory;
161  /// its type is defined as 'typedef CEntrez2_dt TDt'
162  /// @return
163  /// - true, if a value has been assigned.
164  /// - false, otherwise.
165  bool IsSetDt(void) const;
166 
167  /// Check if it is safe to call GetDt method.
168  ///
169  /// @return
170  /// - true, if the data member is getatable.
171  /// - false, otherwise.
172  bool CanGetDt(void) const;
173 
174  /// Reset Dt data member.
175  void ResetDt(void);
176 
177  /// Get the Dt member data.
178  ///
179  /// @return
180  /// Reference to the member data.
181  const TDt& GetDt(void) const;
182 
183  /// Assign a value to Dt data member.
184  ///
185  /// @param value
186  /// Value to assign
187  void SetDt(const TDt& value);
188 
189  /// Assign a value to Dt data member.
190  ///
191  /// @return
192  /// Reference to the data value.
193  TDt& SetDt(void);
194 
195  /// server version info
196  /// Check if a value has been assigned to Server data member.
197  ///
198  /// Data member Server is mandatory;
199  /// its type is defined as 'typedef string TServer'
200  /// @return
201  /// - true, if a value has been assigned.
202  /// - false, otherwise.
203  bool IsSetServer(void) const;
204 
205  /// Check if it is safe to call GetServer method.
206  ///
207  /// @return
208  /// - true, if the data member is getatable.
209  /// - false, otherwise.
210  bool CanGetServer(void) const;
211 
212  /// Reset Server data member.
213  void ResetServer(void);
214 
215  /// Get the Server member data.
216  ///
217  /// @return
218  /// Reference to the member data.
219  const TServer& GetServer(void) const;
220 
221  /// Assign a value to Server data member.
222  ///
223  /// @param value
224  /// Value to assign
225  void SetServer(const TServer& value);
226  void SetServer(TServer&& value);
227 
228  /// Assign a value to Server data member.
229  ///
230  /// @return
231  /// Reference to the data value.
232  TServer& SetServer(void);
233 
234  /// possibly a message to the user
235  /// Check if a value has been assigned to Msg data member.
236  ///
237  /// Data member Msg is optional;
238  /// its type is defined as 'typedef string TMsg'
239  /// @return
240  /// - true, if a value has been assigned.
241  /// - false, otherwise.
242  bool IsSetMsg(void) const;
243 
244  /// Check if it is safe to call GetMsg method.
245  ///
246  /// @return
247  /// - true, if the data member is getatable.
248  /// - false, otherwise.
249  bool CanGetMsg(void) const;
250 
251  /// Reset Msg data member.
252  void ResetMsg(void);
253 
254  /// Get the Msg member data.
255  ///
256  /// @return
257  /// Reference to the member data.
258  const TMsg& GetMsg(void) const;
259 
260  /// Assign a value to Msg data member.
261  ///
262  /// @param value
263  /// Value to assign
264  void SetMsg(const TMsg& value);
265  void SetMsg(TMsg&& value);
266 
267  /// Assign a value to Msg data member.
268  ///
269  /// @return
270  /// Reference to the data value.
271  TMsg& SetMsg(void);
272 
273  /// history key for query
274  /// Check if a value has been assigned to Key data member.
275  ///
276  /// Data member Key is optional;
277  /// its type is defined as 'typedef string TKey'
278  /// @return
279  /// - true, if a value has been assigned.
280  /// - false, otherwise.
281  bool IsSetKey(void) const;
282 
283  /// Check if it is safe to call GetKey method.
284  ///
285  /// @return
286  /// - true, if the data member is getatable.
287  /// - false, otherwise.
288  bool CanGetKey(void) const;
289 
290  /// Reset Key data member.
291  void ResetKey(void);
292 
293  /// Get the Key member data.
294  ///
295  /// @return
296  /// Reference to the member data.
297  const TKey& GetKey(void) const;
298 
299  /// Assign a value to Key data member.
300  ///
301  /// @param value
302  /// Value to assign
303  void SetKey(const TKey& value);
304  void SetKey(TKey&& value);
305 
306  /// Assign a value to Key data member.
307  ///
308  /// @return
309  /// Reference to the data value.
310  TKey& SetKey(void);
311 
312  /// history session cookie
313  /// Check if a value has been assigned to Cookie data member.
314  ///
315  /// Data member Cookie is optional;
316  /// its type is defined as 'typedef string TCookie'
317  /// @return
318  /// - true, if a value has been assigned.
319  /// - false, otherwise.
320  bool IsSetCookie(void) const;
321 
322  /// Check if it is safe to call GetCookie method.
323  ///
324  /// @return
325  /// - true, if the data member is getatable.
326  /// - false, otherwise.
327  bool CanGetCookie(void) const;
328 
329  /// Reset Cookie data member.
330  void ResetCookie(void);
331 
332  /// Get the Cookie member data.
333  ///
334  /// @return
335  /// Reference to the member data.
336  const TCookie& GetCookie(void) const;
337 
338  /// Assign a value to Cookie data member.
339  ///
340  /// @param value
341  /// Value to assign
342  void SetCookie(const TCookie& value);
343  void SetCookie(TCookie&& value);
344 
345  /// Assign a value to Cookie data member.
346  ///
347  /// @return
348  /// Reference to the data value.
349  TCookie& SetCookie(void);
350 
351  /// Reset the whole object
352  virtual void Reset(void);
353 
354 
355 private:
356  // Prohibit copy constructor and assignment operator
359 
360  // data
361  Uint4 m_set_State[1];
364  string m_Server;
365  string m_Msg;
366  string m_Key;
367  string m_Cookie;
368 };
369 
370 /* @} */
371 
372 
373 
374 
375 
376 ///////////////////////////////////////////////////////////
377 ///////////////////// inline methods //////////////////////
378 ///////////////////////////////////////////////////////////
379 inline
381 {
382  return m_Reply.NotEmpty();
383 }
384 
385 inline
387 {
388  return true;
389 }
390 
391 inline
393 {
394  if ( !m_Reply ) {
395  const_cast<CEntrez2_reply_Base*>(this)->ResetReply();
396  }
397  return (*m_Reply);
398 }
399 
400 inline
402 {
403  if ( !m_Reply ) {
404  ResetReply();
405  }
406  return (*m_Reply);
407 }
408 
409 inline
411 {
412  return ((m_set_State[0] & 0xc) != 0);
413 }
414 
415 inline
417 {
418  return IsSetDt();
419 }
420 
421 inline
423 {
424  m_Dt = CEntrez2_dt(0);
425  m_set_State[0] &= ~0xc;
426 }
427 
428 inline
430 {
431  if (!CanGetDt()) {
432  ThrowUnassigned(1);
433  }
434  return m_Dt;
435 }
436 
437 inline
439 {
440  m_Dt = value;
441  m_set_State[0] |= 0xc;
442 }
443 
444 inline
446 {
447  m_set_State[0] |= 0x4;
448  return m_Dt;
449 }
450 
451 inline
453 {
454  return ((m_set_State[0] & 0x30) != 0);
455 }
456 
457 inline
459 {
460  return IsSetServer();
461 }
462 
463 inline
465 {
466  if (!CanGetServer()) {
467  ThrowUnassigned(2);
468  }
469  return m_Server;
470 }
471 
472 inline
474 {
475  m_Server = value;
476  m_set_State[0] |= 0x30;
477 }
478 
479 inline
481 {
482  m_Server = std::forward<CEntrez2_reply_Base::TServer>(value);
483  m_set_State[0] |= 0x30;
484 }
485 
486 inline
488 {
489 #ifdef _DEBUG
490  if (!IsSetServer()) {
492  }
493 #endif
494  m_set_State[0] |= 0x10;
495  return m_Server;
496 }
497 
498 inline
500 {
501  return ((m_set_State[0] & 0xc0) != 0);
502 }
503 
504 inline
506 {
507  return IsSetMsg();
508 }
509 
510 inline
512 {
513  if (!CanGetMsg()) {
514  ThrowUnassigned(3);
515  }
516  return m_Msg;
517 }
518 
519 inline
521 {
522  m_Msg = value;
523  m_set_State[0] |= 0xc0;
524 }
525 
526 inline
528 {
529  m_Msg = std::forward<CEntrez2_reply_Base::TMsg>(value);
530  m_set_State[0] |= 0xc0;
531 }
532 
533 inline
535 {
536 #ifdef _DEBUG
537  if (!IsSetMsg()) {
539  }
540 #endif
541  m_set_State[0] |= 0x40;
542  return m_Msg;
543 }
544 
545 inline
547 {
548  return ((m_set_State[0] & 0x300) != 0);
549 }
550 
551 inline
553 {
554  return IsSetKey();
555 }
556 
557 inline
559 {
560  if (!CanGetKey()) {
561  ThrowUnassigned(4);
562  }
563  return m_Key;
564 }
565 
566 inline
568 {
569  m_Key = value;
570  m_set_State[0] |= 0x300;
571 }
572 
573 inline
575 {
576  m_Key = std::forward<CEntrez2_reply_Base::TKey>(value);
577  m_set_State[0] |= 0x300;
578 }
579 
580 inline
582 {
583 #ifdef _DEBUG
584  if (!IsSetKey()) {
586  }
587 #endif
588  m_set_State[0] |= 0x100;
589  return m_Key;
590 }
591 
592 inline
594 {
595  return ((m_set_State[0] & 0xc00) != 0);
596 }
597 
598 inline
600 {
601  return IsSetCookie();
602 }
603 
604 inline
606 {
607  if (!CanGetCookie()) {
608  ThrowUnassigned(5);
609  }
610  return m_Cookie;
611 }
612 
613 inline
615 {
616  m_Cookie = value;
617  m_set_State[0] |= 0xc00;
618 }
619 
620 inline
622 {
623  m_Cookie = std::forward<CEntrez2_reply_Base::TCookie>(value);
624  m_set_State[0] |= 0xc00;
625 }
626 
627 inline
629 {
630 #ifdef _DEBUG
631  if (!IsSetCookie()) {
633  }
634 #endif
635  m_set_State[0] |= 0x400;
636  return m_Cookie;
637 }
638 
639 ///////////////////////////////////////////////////////////
640 ////////////////// end of inline methods //////////////////
641 ///////////////////////////////////////////////////////////
642 
643 
644 
645 
646 
647 END_objects_SCOPE // namespace ncbi::objects::
648 
650 
651 
652 #endif // OBJECTS_ENTREZ2_ENTREZ2_REPLY_BASE_HPP
User-defined methods of the data storage class.
CE2Reply –.
Definition: E2Reply.hpp:66
CEntrez2_dt –.
Definition: Entrez2_dt.hpp:66
********************************************************** Replies from the Entrez server all replies...
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
bool CanGetDt(void) const
Check if it is safe to call GetDt method.
bool IsSetReply(void) const
the actual reply Check if a value has been assigned to Reply data member.
void ResetReply(void)
Reset Reply data member.
TReply & SetReply(void)
Assign a value to Reply data member.
const TMsg & GetMsg(void) const
Get the Msg member data.
bool IsSetCookie(void) const
history session cookie Check if a value has been assigned to Cookie data member.
TDt & SetDt(void)
Assign a value to Dt data member.
TServer & SetServer(void)
Assign a value to Server data member.
bool CanGetReply(void) const
Check if it is safe to call GetReply method.
bool CanGetMsg(void) const
Check if it is safe to call GetMsg method.
bool IsSetMsg(void) const
possibly a message to the user Check if a value has been assigned to Msg data member.
bool IsSetServer(void) const
server version info Check if a value has been assigned to Server data member.
TKey & SetKey(void)
Assign a value to Key data member.
bool CanGetKey(void) const
Check if it is safe to call GetKey method.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
TMsg & SetMsg(void)
Assign a value to Msg data member.
TCookie & SetCookie(void)
Assign a value to Cookie data member.
const TReply & GetReply(void) const
Get the Reply member data.
CRef< TReply > m_Reply
CEntrez2_reply_Base & operator=(const CEntrez2_reply_Base &)
bool IsSetDt(void) const
date/time stamp from server Check if a value has been assigned to Dt data member.
bool CanGetCookie(void) const
Check if it is safe to call GetCookie method.
const TServer & GetServer(void) const
Get the Server member data.
bool CanGetServer(void) const
Check if it is safe to call GetServer method.
const TKey & GetKey(void) const
Get the Key member data.
CEntrez2_reply_Base(const CEntrez2_reply_Base &)
void ResetDt(void)
Reset Dt data member.
const TDt & GetDt(void) const
Get the Dt member data.
CSerialObject Tparent
const TCookie & GetCookie(void) const
Get the Cookie member data.
bool IsSetKey(void) const
history key for query Check if a value has been assigned to Key data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue May 21 10:59:09 2024 by modify_doxy.py rev. 669887