NCBI C++ ToolKit
id1_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  * 'id1.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
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
52 
53 // generated classes
54 
56 {
58  AskInit();
59 }
60 
62 {
63  try {
64  AskFini();
65  } catch (...) {
67  throw;
68  }
70 }
71 
73 {
74  Ask(request, reply);
75  TReplyChoice& rc = x_Choice(reply);
76  if (rc.Which() == wanted) {
77  return; // ok
78  } else if (rc.IsError()) {
79  CNcbiOstrstream oss;
80  oss << "CID1Client: server error: " << rc.GetError();
82  } else {
83  rc.ThrowInvalidSelection(wanted);
84  }
85 }
86 
88 {
89  TRequestChoice request;
90  TReply reply0;
91  request.SetInit();
92  if ( !reply ) {
93  reply = &reply0;
94  }
95  Ask(request, *reply, TReplyChoice::e_Init);
96 }
97 
99 {
100  TRequestChoice request;
101  TReply reply0;
102  request.SetGetgi(const_cast<CSeq_id&>(req));
103  if ( !reply ) {
104  reply = &reply0;
105  }
106  Ask(request, *reply, TReplyChoice::e_Gotgi);
107  return x_Choice(*reply).GetGotgi();
108 }
109 
111 {
112  TRequestChoice request;
113  TReply reply0;
114  request.SetGetsefromgi(const_cast<CID1server_maxcomplex&>(req));
115  if ( !reply ) {
116  reply = &reply0;
117  }
118  Ask(request, *reply, TReplyChoice::e_Gotseqentry);
119  return CRef<CSeq_entry>(&x_Choice(*reply).SetGotseqentry());
120 }
121 
123 {
124  TRequestChoice request;
125  TReply reply0;
126  request.SetFini();
127  if ( !reply ) {
128  reply = &reply0;
129  }
130  Ask(request, *reply, TReplyChoice::e_Fini);
131 }
132 
134 {
135  TRequestChoice request;
136  TReply reply0;
137  request.SetGetseqidsfromgi(const_cast<NCBI_NS_NCBI::TGi&>(req));
138  if ( !reply ) {
139  reply = &reply0;
140  }
141  Ask(request, *reply, TReplyChoice::e_Ids);
142  return x_Choice(*reply).GetIds();
143 }
144 
145 list< CRef< CID1Seq_hist > > CID1Client_Base::AskGetgihist(const NCBI_NS_NCBI::TGi& req, CID1Client_Base::TReply* reply)
146 {
147  TRequestChoice request;
148  TReply reply0;
149  request.SetGetgihist(const_cast<NCBI_NS_NCBI::TGi&>(req));
150  if ( !reply ) {
151  reply = &reply0;
152  }
153  Ask(request, *reply, TReplyChoice::e_Gihist);
154  return x_Choice(*reply).GetGihist();
155 }
156 
157 list< CRef< CID1Seq_hist > > CID1Client_Base::AskGetgirev(const NCBI_NS_NCBI::TGi& req, CID1Client_Base::TReply* reply)
158 {
159  TRequestChoice request;
160  TReply reply0;
161  request.SetGetgirev(const_cast<NCBI_NS_NCBI::TGi&>(req));
162  if ( !reply ) {
163  reply = &reply0;
164  }
165  Ask(request, *reply, TReplyChoice::e_Girevhist);
166  return x_Choice(*reply).GetGirevhist();
167 }
168 
170 {
171  TRequestChoice request;
172  TReply reply0;
173  request.SetGetgistate(const_cast<NCBI_NS_NCBI::TGi&>(req));
174  if ( !reply ) {
175  reply = &reply0;
176  }
177  Ask(request, *reply, TReplyChoice::e_Gistate);
178  return x_Choice(*reply).GetGistate();
179 }
180 
182 {
183  TRequestChoice request;
184  TReply reply0;
185  request.SetGetsewithinfo(const_cast<CID1server_maxcomplex&>(req));
186  if ( !reply ) {
187  reply = &reply0;
188  }
189  Ask(request, *reply, TReplyChoice::e_Gotsewithinfo);
191 }
192 
194 {
195  TRequestChoice request;
196  TReply reply0;
197  request.SetGetblobinfo(const_cast<CID1server_maxcomplex&>(req));
198  if ( !reply ) {
199  reply = &reply0;
200  }
201  Ask(request, *reply, TReplyChoice::e_Gotblobinfo);
202  return CRef<CID1blob_info>(&x_Choice(*reply).SetGotblobinfo());
203 }
204 
205 // constructor
207  : Tparent("ID1")
208 {
209 }
210 
211 // destructor
213 {
214  // Copied from ~CRPCClient_Base, whose implicit actions should
215  // wait, but whose explicit actions should run now so as to
216  // pick up the correct x_Disconnect implementation.
217  try {
218  Disconnect();
219  } STD_CATCH_ALL_XX(Serial_RPCClient, 2, "CRPCClient_Base::Disconnect()");
220 }
221 
222 
223 
224 END_objects_SCOPE // namespace ncbi::objects::
225 
227 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ID1server_back.hpp User-defined methods of the data storage class.
CID1server_maxcomplex –.
CID1server_request –.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CStrictId< SStrictId_Gi, SStrictId_Gi::TId > TGi
Definition: ncbimisc.hpp:1025
#define STD_CATCH_ALL_XX(err_name, err_subcode, message)
Standard handling of "exception"-derived exceptions; catches non-standard exceptions and generates "u...
Definition: ncbiexpt.hpp:640
#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 x_Disconnect(void)
Disconnect as cleanly as possible.
Definition: rpcbase.cpp:203
void Disconnect(void)
Definition: rpcbase.cpp:164
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
virtual CRef< CSeq_entry > AskGetsefromgi(const CID1server_maxcomplex &req, TReply *reply=0)
TGetsefromgi & SetGetsefromgi(void)
Select the variant.
TGetgihist & SetGetgihist(void)
Select the variant.
TGetgirev & SetGetgirev(void)
Select the variant.
E_Choice Which(void) const
Which variant is currently selected.
void x_Disconnect(void)
Disconnect as cleanly as possible.
Definition: id1_client_.cpp:61
void SetFini(void)
Select the variant.
virtual void AskInit(TReply *reply=0)
Definition: id1_client_.cpp:87
TError GetError(void) const
Get the variant data.
bool IsError(void) const
Check if variant Error is selected.
virtual ~CID1Client_Base(void)
virtual NCBI_NS_NCBI::TGi AskGetgi(const CSeq_id &req, TReply *reply=0)
Definition: id1_client_.cpp:98
void SetInit(void)
Select the variant.
virtual int AskGetgistate(const NCBI_NS_NCBI::TGi &req, TReply *reply=0)
TGetgistate & SetGetgistate(void)
Select the variant.
TReplyChoice & x_Choice(TReply &reply)
virtual list< CRef< CSeq_id > > AskGetseqidsfromgi(const NCBI_NS_NCBI::TGi &req, TReply *reply=0)
TGotseqentry & SetGotseqentry(void)
Select the variant.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TGotblobinfo & SetGotblobinfo(void)
Select the variant.
virtual CRef< CID1blob_info > AskGetblobinfo(const CID1server_maxcomplex &req, TReply *reply=0)
TGotgi GetGotgi(void) const
Get the variant data.
const TIds & GetIds(void) const
Get the variant data.
virtual list< CRef< CID1Seq_hist > > AskGetgihist(const NCBI_NS_NCBI::TGi &req, TReply *reply=0)
TGetblobinfo & SetGetblobinfo(void)
Select the variant.
virtual void Ask(const TRequest &request, TReply &reply)
virtual CRef< CID1SeqEntry_info > AskGetsewithinfo(const CID1server_maxcomplex &req, TReply *reply=0)
const TGirevhist & GetGirevhist(void) const
Get the variant data.
TGetseqidsfromgi & SetGetseqidsfromgi(void)
Select the variant.
TGetsewithinfo & SetGetsewithinfo(void)
Select the variant.
TGetgi & SetGetgi(void)
Select the variant.
TGotsewithinfo & SetGotsewithinfo(void)
Select the variant.
virtual list< CRef< CID1Seq_hist > > AskGetgirev(const NCBI_NS_NCBI::TGi &req, TReply *reply=0)
E_Choice
Choice variants.
virtual void AskFini(TReply *reply=0)
void x_Connect(void)
These run with m_Mutex already acquired.
Definition: id1_client_.cpp:55
TGistate GetGistate(void) const
Get the variant data.
const TGihist & GetGihist(void) const
Get the variant data.
@ e_Gihist
because hand crafted Seq-hist does not follow same conventions
Modified on Tue May 14 16:17:47 2024 by modify_doxy.py rev. 669887