NCBI C++ ToolKit
entrez2_client_.cpp
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  * File Description:
27  * This code was generated by application DATATOOL
28  * using the following specifications:
29  * 'entrez2.asn'.
30  *
31  * ATTENTION:
32  * Don't edit or commit this file into CVS as this file will
33  * be overridden (by DATATOOL) without warning!
34  * ===========================================================================
35  */
36 
37 // standard includes
38 #include <ncbi_pch.hpp>
39 #include <serial/serialimpl.hpp>
40 
41 // generated includes
52 
53 BEGIN_objects_SCOPE // namespace ncbi::objects::
54 
55 
56 // generated classes
57 
59 {
60  TRequest request;
61  request.Assign(*m_DefaultRequest);
62  request.SetRequest().Assign(req);
63  Ask(request, reply);
64 }
65 
66 
68 {
69  TRequest request;
70  request.Assign(*m_DefaultRequest);
71  request.SetRequest().Assign(req);
72  Ask(request, reply, wanted);
73 }
74 
75 
77 {
78  Ask(request, reply);
79  TReplyChoice& rc = x_Choice(reply);
80  if (rc.Which() == wanted) {
81  return; // ok
82  } else if (rc.IsError()) {
83  CNcbiOstrstream oss;
84  oss << "CEntrez2Client: server error: " << rc.GetError();
86  } else {
87  rc.ThrowInvalidSelection(wanted);
88  }
89 }
90 
92 {
93  TRequestChoice request;
94  TReply reply0;
95  request.SetGet_info();
96  if ( !reply ) {
97  reply = &reply0;
98  }
99  Ask(request, *reply, TReplyChoice::e_Get_info);
100  return CRef<CEntrez2_info>(&x_Choice(*reply).SetGet_info());
101 }
102 
104 {
105  TRequestChoice request;
106  TReply reply0;
107  request.SetEval_boolean(const_cast<CEntrez2_eval_boolean&>(req));
108  if ( !reply ) {
109  reply = &reply0;
110  }
111  Ask(request, *reply, TReplyChoice::e_Eval_boolean);
113 }
114 
116 {
117  TRequestChoice request;
118  TReply reply0;
119  request.SetGet_docsum(const_cast<CEntrez2_id_list&>(req));
120  if ( !reply ) {
121  reply = &reply0;
122  }
123  Ask(request, *reply, TReplyChoice::e_Get_docsum);
125 }
126 
128 {
129  TRequestChoice request;
130  TReply reply0;
131  request.SetGet_term_pos(const_cast<CEntrez2_term_query&>(req));
132  if ( !reply ) {
133  reply = &reply0;
134  }
135  Ask(request, *reply, TReplyChoice::e_Get_term_pos);
136  return x_Choice(*reply).GetGet_term_pos();
137 }
138 
140 {
141  TRequestChoice request;
142  TReply reply0;
143  request.SetGet_term_list(const_cast<CEntrez2_term_pos&>(req));
144  if ( !reply ) {
145  reply = &reply0;
146  }
147  Ask(request, *reply, TReplyChoice::e_Get_term_list);
149 }
150 
152 {
153  TRequestChoice request;
154  TReply reply0;
155  request.SetGet_term_hierarchy(const_cast<CEntrez2_hier_query&>(req));
156  if ( !reply ) {
157  reply = &reply0;
158  }
159  Ask(request, *reply, TReplyChoice::e_Get_term_hierarchy);
161 }
162 
164 {
165  TRequestChoice request;
166  TReply reply0;
167  request.SetGet_links(const_cast<CEntrez2_get_links&>(req));
168  if ( !reply ) {
169  reply = &reply0;
170  }
171  Ask(request, *reply, TReplyChoice::e_Get_links);
172  return CRef<CEntrez2_link_set>(&x_Choice(*reply).SetGet_links());
173 }
174 
176 {
177  TRequestChoice request;
178  TReply reply0;
179  request.SetGet_linked(const_cast<CEntrez2_get_links&>(req));
180  if ( !reply ) {
181  reply = &reply0;
182  }
183  Ask(request, *reply, TReplyChoice::e_Get_linked);
184  return CRef<CEntrez2_id_list>(&x_Choice(*reply).SetGet_linked());
185 }
186 
188 {
189  TRequestChoice request;
190  TReply reply0;
191  request.SetGet_link_counts(const_cast<CEntrez2_id&>(req));
192  if ( !reply ) {
193  reply = &reply0;
194  }
195  Ask(request, *reply, TReplyChoice::e_Get_link_counts);
197 }
198 
199 // constructor
201  : Tparent("ENTREZ2S"), m_DefaultRequest(new TRequest)
202 {
203 }
204 
205 // destructor
207 {
208 }
209 
210 
211 
212 END_objects_SCOPE // namespace ncbi::objects::
213 
215 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CE2Reply –.
Definition: E2Reply.hpp:66
CE2Request –.
Definition: E2Request.hpp:66
CEntrez2_eval_boolean –.
CEntrez2_hier_query –.
CEntrez2_id –.
Definition: Entrez2_id.hpp:66
CEntrez2_reply –.
CEntrez2_request –.
CEntrez2_term_pos –.
CEntrez2_term_query –.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CRef –.
Definition: ncbiobj.hpp:618
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const TError & GetError(void) const
Get the variant data.
Definition: E2Reply_.hpp:503
virtual CRef< CEntrez2_link_set > AskGet_links(const CEntrez2_get_links &req, TReply *reply=0)
TGet_term_hierarchy & SetGet_term_hierarchy(void)
Select the variant.
Definition: E2Request_.cpp:232
TGet_term_hierarchy & SetGet_term_hierarchy(void)
Select the variant.
Definition: E2Reply_.cpp:249
virtual CRef< CEntrez2_id_list > AskGet_linked(const CEntrez2_get_links &req, TReply *reply=0)
TGet_link_counts & SetGet_link_counts(void)
Select the variant.
Definition: E2Request_.cpp:298
TGet_term_pos & SetGet_term_pos(void)
Select the variant.
Definition: E2Request_.cpp:188
TGet_linked & SetGet_linked(void)
Select the variant.
Definition: E2Reply_.cpp:293
virtual void Ask(const TRequest &request, TReply &reply)
virtual CRef< CEntrez2_hier_node > AskGet_term_hierarchy(const CEntrez2_hier_query &req, TReply *reply=0)
virtual CRef< CEntrez2_link_count_list > AskGet_link_counts(const CEntrez2_id &req, TReply *reply=0)
TGet_link_counts & SetGet_link_counts(void)
Select the variant.
Definition: E2Reply_.cpp:315
TGet_term_pos GetGet_term_pos(void) const
Get the variant data.
Definition: E2Reply_.hpp:541
virtual CRef< CEntrez2_term_list > AskGet_term_list(const CEntrez2_term_pos &req, TReply *reply=0)
virtual int AskGet_term_pos(const CEntrez2_term_query &req, TReply *reply=0)
void SetGet_info(void)
Select the variant.
Definition: E2Request_.hpp:451
TGet_docsum & SetGet_docsum(void)
Select the variant.
Definition: E2Request_.cpp:166
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: E2Reply_.cpp:144
TGet_info & SetGet_info(void)
Select the variant.
Definition: E2Reply_.cpp:161
void SetRequest(TRequest &value)
Assign a value to Request data member.
CRef< TRequest > m_DefaultRequest
TEval_boolean & SetEval_boolean(void)
Select the variant.
Definition: E2Request_.cpp:144
TGet_links & SetGet_links(void)
Select the variant.
Definition: E2Reply_.cpp:271
E_Choice
Choice variants.
Definition: E2Reply_.hpp:97
TEval_boolean & SetEval_boolean(void)
Select the variant.
Definition: E2Reply_.cpp:183
virtual CRef< CEntrez2_info > AskGet_info(TReply *reply=0)
virtual ~CEntrez2Client_Base(void)
TGet_linked & SetGet_linked(void)
Select the variant.
Definition: E2Request_.cpp:276
TGet_docsum & SetGet_docsum(void)
Select the variant.
Definition: E2Reply_.cpp:205
TGet_term_list & SetGet_term_list(void)
Select the variant.
Definition: E2Reply_.cpp:227
virtual CRef< CEntrez2_boolean_reply > AskEval_boolean(const CEntrez2_eval_boolean &req, TReply *reply=0)
bool IsError(void) const
Check if variant Error is selected.
Definition: E2Reply_.hpp:497
TReplyChoice & x_Choice(TReply &reply)
TGet_links & SetGet_links(void)
Select the variant.
Definition: E2Request_.cpp:254
virtual CRef< CEntrez2_docsum_list > AskGet_docsum(const CEntrez2_id_list &req, TReply *reply=0)
E_Choice Which(void) const
Which variant is currently selected.
Definition: E2Reply_.hpp:468
TGet_term_list & SetGet_term_list(void)
Select the variant.
Definition: E2Request_.cpp:210
@ e_Get_info
the database info
Definition: E2Reply_.hpp:100
@ e_Get_term_hierarchy
Definition: E2Reply_.hpp:105
@ e_Get_term_pos
position of the term
Definition: E2Reply_.hpp:103
@ e_Eval_boolean
result of boolean query
Definition: E2Reply_.hpp:101
Modified on Tue Apr 30 06:41:03 2024 by modify_doxy.py rev. 669887