NCBI C++ ToolKit
Blast4_request_body_.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  * 'blast.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
53 
54 BEGIN_objects_SCOPE // namespace ncbi::objects::
55 
56 
57 // generated classes
58 
60 {
61  if ( m_choice != e_not_set )
63 }
64 
66 {
67  switch ( m_choice ) {
68  case e_Finish_params:
70  case e_Get_sequences:
71  case e_Queue_search:
72  case e_Get_request_info:
75  case e_Get_search_info:
76  case e_Get_databases_ex:
77  m_object->RemoveReference();
78  break;
79  default:
80  break;
81  }
83 }
84 
85 void CBlast4_request_body_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
86 {
87  switch ( index ) {
88  case e_Finish_params:
89  (m_object = new(pool) ncbi::objects::CBlast4_finish_params_request())->AddReference();
90  break;
92  (m_object = new(pool) ncbi::objects::CBlast4_get_search_results_request())->AddReference();
93  break;
94  case e_Get_sequences:
95  (m_object = new(pool) ncbi::objects::CBlast4_get_sequences_request())->AddReference();
96  break;
97  case e_Queue_search:
98  (m_object = new(pool) ncbi::objects::CBlast4_queue_search_request())->AddReference();
99  break;
100  case e_Get_request_info:
101  (m_object = new(pool) ncbi::objects::CBlast4_get_request_info_request())->AddReference();
102  break;
104  (m_object = new(pool) ncbi::objects::CBlast4_get_seq_parts_request())->AddReference();
105  break;
106  case e_Get_protocol_info:
107  (m_object = new(pool) ncbi::objects::CBlast4_get_protocol_info_request())->AddReference();
108  break;
109  case e_Get_search_info:
110  (m_object = new(pool) ncbi::objects::CBlast4_get_search_info_request())->AddReference();
111  break;
112  case e_Get_databases_ex:
113  (m_object = new(pool) ncbi::objects::CBlast4_get_databases_ex_request())->AddReference();
114  break;
115  default:
116  break;
117  }
118  m_choice = index;
119 }
120 
121 const char* const CBlast4_request_body_Base::sm_SelectionNames[] = {
122  "not set",
123  "finish-params",
124  "get-databases",
125  "get-matrices",
126  "get-parameters",
127  "get-paramsets",
128  "get-programs",
129  "get-search-results",
130  "get-sequences",
131  "queue-search",
132  "get-request-info",
133  "get-sequence-parts",
134  "get-windowmasked-taxids",
135  "get-protocol-info",
136  "get-search-info",
137  "get-databases-ex"
138 };
139 
141 {
142  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
143 }
144 
146 {
147  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
148 }
149 
151 {
153  return *static_cast<const TFinish_params*>(m_object);
154 }
155 
157 {
159  return *static_cast<TFinish_params*>(m_object);
160 }
161 
163 {
164  TFinish_params* ptr = &value;
165  if ( m_choice != e_Finish_params || m_object != ptr ) {
166  ResetSelection();
167  (m_object = ptr)->AddReference();
169  }
170 }
171 
173 {
175  return *static_cast<const TGet_search_results*>(m_object);
176 }
177 
179 {
181  return *static_cast<TGet_search_results*>(m_object);
182 }
183 
185 {
186  TGet_search_results* ptr = &value;
187  if ( m_choice != e_Get_search_results || m_object != ptr ) {
188  ResetSelection();
189  (m_object = ptr)->AddReference();
191  }
192 }
193 
195 {
197  return *static_cast<const TGet_sequences*>(m_object);
198 }
199 
201 {
203  return *static_cast<TGet_sequences*>(m_object);
204 }
205 
207 {
208  TGet_sequences* ptr = &value;
209  if ( m_choice != e_Get_sequences || m_object != ptr ) {
210  ResetSelection();
211  (m_object = ptr)->AddReference();
213  }
214 }
215 
217 {
219  return *static_cast<const TQueue_search*>(m_object);
220 }
221 
223 {
225  return *static_cast<TQueue_search*>(m_object);
226 }
227 
229 {
230  TQueue_search* ptr = &value;
231  if ( m_choice != e_Queue_search || m_object != ptr ) {
232  ResetSelection();
233  (m_object = ptr)->AddReference();
235  }
236 }
237 
239 {
241  return *static_cast<const TGet_request_info*>(m_object);
242 }
243 
245 {
247  return *static_cast<TGet_request_info*>(m_object);
248 }
249 
251 {
252  TGet_request_info* ptr = &value;
253  if ( m_choice != e_Get_request_info || m_object != ptr ) {
254  ResetSelection();
255  (m_object = ptr)->AddReference();
257  }
258 }
259 
261 {
263  return *static_cast<const TGet_sequence_parts*>(m_object);
264 }
265 
267 {
269  return *static_cast<TGet_sequence_parts*>(m_object);
270 }
271 
273 {
274  TGet_sequence_parts* ptr = &value;
275  if ( m_choice != e_Get_sequence_parts || m_object != ptr ) {
276  ResetSelection();
277  (m_object = ptr)->AddReference();
279  }
280 }
281 
283 {
285  return *static_cast<const TGet_protocol_info*>(m_object);
286 }
287 
289 {
291  return *static_cast<TGet_protocol_info*>(m_object);
292 }
293 
295 {
296  TGet_protocol_info* ptr = &value;
297  if ( m_choice != e_Get_protocol_info || m_object != ptr ) {
298  ResetSelection();
299  (m_object = ptr)->AddReference();
301  }
302 }
303 
305 {
307  return *static_cast<const TGet_search_info*>(m_object);
308 }
309 
311 {
313  return *static_cast<TGet_search_info*>(m_object);
314 }
315 
317 {
318  TGet_search_info* ptr = &value;
319  if ( m_choice != e_Get_search_info || m_object != ptr ) {
320  ResetSelection();
321  (m_object = ptr)->AddReference();
323  }
324 }
325 
327 {
329  return *static_cast<const TGet_databases_ex*>(m_object);
330 }
331 
333 {
335  return *static_cast<TGet_databases_ex*>(m_object);
336 }
337 
339 {
340  TGet_databases_ex* ptr = &value;
341  if ( m_choice != e_Get_databases_ex || m_object != ptr ) {
342  ResetSelection();
343  (m_object = ptr)->AddReference();
345  }
346 }
347 
348 // helper methods
349 
350 // type info
352 {
353  SET_CHOICE_MODULE("NCBI-Blast4");
355  ADD_NAMED_NULL_CHOICE_VARIANT("get-databases", null, ());
356  ADD_NAMED_NULL_CHOICE_VARIANT("get-matrices", null, ());
357  ADD_NAMED_NULL_CHOICE_VARIANT("get-parameters", null, ());
358  ADD_NAMED_NULL_CHOICE_VARIANT("get-paramsets", null, ());
359  ADD_NAMED_NULL_CHOICE_VARIANT("get-programs", null, ());
360  ADD_NAMED_REF_CHOICE_VARIANT("get-search-results", m_object, CBlast4_get_search_results_request);
363  ADD_NAMED_REF_CHOICE_VARIANT("get-request-info", m_object, CBlast4_get_request_info_request);
364  ADD_NAMED_REF_CHOICE_VARIANT("get-sequence-parts", m_object, CBlast4_get_seq_parts_request);
365  ADD_NAMED_NULL_CHOICE_VARIANT("get-windowmasked-taxids", null, ());
366  ADD_NAMED_REF_CHOICE_VARIANT("get-protocol-info", m_object, CBlast4_get_protocol_info_request);
368  ADD_NAMED_REF_CHOICE_VARIANT("get-databases-ex", m_object, CBlast4_get_databases_ex_request);
369  info->CodeVersion(22400);
370  info->DataSpec(ncbi::EDataSpec::eASN);
371 }
373 
374 // constructor
376  : m_choice(e_not_set)
377 {
378 }
379 
380 // destructor
382 {
383  Reset();
384 }
385 
386 
387 
388 END_objects_SCOPE // namespace ncbi::objects::
389 
391 
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.
BEGIN_NAMED_BASE_CHOICE_INFO("Blast4-request-body", CBlast4_request_body)
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.
User-defined methods of the data storage class.
CBlast4_finish_params_request –.
CBlast4_get_databases_ex_request –.
CBlast4_get_protocol_info_request –.
CBlast4_get_request_info_request –.
CBlast4_get_search_info_request –.
CBlast4_get_search_results_request –.
CBlast4_get_seq_parts_request –.
CBlast4_get_sequences_request –.
CBlast4_queue_search_request –.
CBlast4_request_body –.
string
Definition: cgiapp.hpp:687
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
Definition: ncbidiag.hpp:170
#define ADD_NAMED_REF_CHOICE_VARIANT(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:400
#define END_CHOICE_INFO
Definition: serialimpl.hpp:506
#define SET_CHOICE_MODULE(ModuleName)
Definition: serialimpl.hpp:500
#define ADD_NAMED_NULL_CHOICE_VARIANT(MemberAlias, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:379
@ eDoNotResetVariant
Definition: serialbase.hpp:78
void AddReference(void) const
Add reference to object.
Definition: ncbiobj.hpp:489
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TFinish_params & SetFinish_params(void)
Select the variant.
const TGet_sequence_parts & GetGet_sequence_parts(void) const
Get the variant data.
virtual void Reset(void)
Reset the whole object.
TGet_search_results & SetGet_search_results(void)
Select the variant.
const TGet_request_info & GetGet_request_info(void) const
Get the variant data.
const TFinish_params & GetFinish_params(void) const
Get the variant data.
TGet_sequence_parts & SetGet_sequence_parts(void)
Select the variant.
TGet_protocol_info & SetGet_protocol_info(void)
Select the variant.
TGet_sequences & SetGet_sequences(void)
Select the variant.
TGet_request_info & SetGet_request_info(void)
Select the variant.
const TQueue_search & GetQueue_search(void) const
Get the variant data.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
TGet_search_info & SetGet_search_info(void)
Select the variant.
const TGet_search_results & GetGet_search_results(void) const
Get the variant data.
const TGet_protocol_info & GetGet_protocol_info(void) const
Get the variant data.
const TGet_databases_ex & GetGet_databases_ex(void) const
Get the variant data.
const TGet_search_info & GetGet_search_info(void) const
Get the variant data.
TGet_databases_ex & SetGet_databases_ex(void)
Select the variant.
TQueue_search & SetQueue_search(void)
Select the variant.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
NCBI_NS_NCBI::CSerialObject * m_object
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
static const char *const sm_SelectionNames[]
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
const TGet_sequences & GetGet_sequences(void) const
Get the variant data.
@ e_Get_databases_ex
OLD OK get-databases-ex NULL.
@ e_not_set
No variant selected.
@ e_Get_protocol_info
Get version and info about some extended methods.
@ e_Get_search_info
Get search info: status, title and etc.
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sat Apr 27 11:19:14 2024 by modify_doxy.py rev. 669887