NCBI C++ ToolKit
Blast4_value_.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
46 #include <objects/seq/Bioseq.hpp>
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_Big_integer_list:
69  m_Big_integer_list.Destruct();
70  break;
71  case e_Bioseq_list:
72  m_Bioseq_list.Destruct();
73  break;
74  case e_Boolean_list:
75  m_Boolean_list.Destruct();
76  break;
77  case e_Cutoff_list:
78  m_Cutoff_list.Destruct();
79  break;
80  case e_Integer_list:
81  m_Integer_list.Destruct();
82  break;
83  case e_Matrix_list:
84  m_Matrix_list.Destruct();
85  break;
86  case e_Real_list:
87  m_Real_list.Destruct();
88  break;
89  case e_Seq_align_list:
90  m_Seq_align_list.Destruct();
91  break;
92  case e_Seq_id_list:
93  m_Seq_id_list.Destruct();
94  break;
95  case e_Seq_loc_list:
96  m_Seq_loc_list.Destruct();
97  break;
98  case e_Strand_type_list:
99  m_Strand_type_list.Destruct();
100  break;
101  case e_String_list:
102  m_String_list.Destruct();
103  break;
104  case e_String:
105  m_string.Destruct();
106  break;
107  case e_Bioseq:
108  case e_Cutoff:
109  case e_Matrix:
110  case e_Seq_align:
111  case e_Seq_id:
112  case e_Seq_loc:
113  case e_Bioseq_set:
114  case e_Seq_align_set:
115  case e_Query_mask:
116  m_object->RemoveReference();
117  break;
118  default:
119  break;
120  }
122 }
123 
124 void CBlast4_value_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
125 {
126  switch ( index ) {
127  case e_Big_integer:
128  m_Big_integer = 0;
129  break;
130  case e_Bioseq:
131  (m_object = new(pool) ncbi::objects::CBioseq())->AddReference();
132  break;
133  case e_Boolean:
134  m_Boolean = 0;
135  break;
136  case e_Cutoff:
137  (m_object = new(pool) ncbi::objects::CBlast4_cutoff())->AddReference();
138  break;
139  case e_Integer:
140  m_Integer = 0;
141  break;
142  case e_Matrix:
143  (m_object = new(pool) ncbi::objects::CPssmWithParameters())->AddReference();
144  break;
145  case e_Real:
146  m_Real = 0;
147  break;
148  case e_Seq_align:
149  (m_object = new(pool) ncbi::objects::CSeq_align())->AddReference();
150  break;
151  case e_Seq_id:
152  (m_object = new(pool) ncbi::objects::CSeq_id())->AddReference();
153  break;
154  case e_Seq_loc:
155  (m_object = new(pool) ncbi::objects::CSeq_loc())->AddReference();
156  break;
157  case e_Strand_type:
159  break;
160  case e_Big_integer_list:
161  m_Big_integer_list.Construct();
162  break;
163  case e_Bioseq_list:
164  m_Bioseq_list.Construct();
165  break;
166  case e_Boolean_list:
167  m_Boolean_list.Construct();
168  break;
169  case e_Cutoff_list:
170  m_Cutoff_list.Construct();
171  break;
172  case e_Integer_list:
173  m_Integer_list.Construct();
174  break;
175  case e_Matrix_list:
176  m_Matrix_list.Construct();
177  break;
178  case e_Real_list:
179  m_Real_list.Construct();
180  break;
181  case e_Seq_align_list:
182  m_Seq_align_list.Construct();
183  break;
184  case e_Seq_id_list:
185  m_Seq_id_list.Construct();
186  break;
187  case e_Seq_loc_list:
188  m_Seq_loc_list.Construct();
189  break;
190  case e_Strand_type_list:
191  m_Strand_type_list.Construct();
192  break;
193  case e_String_list:
194  m_String_list.Construct();
195  break;
196  case e_Bioseq_set:
197  (m_object = new(pool) ncbi::objects::CBioseq_set())->AddReference();
198  break;
199  case e_Seq_align_set:
200  (m_object = new(pool) ncbi::objects::CSeq_align_set())->AddReference();
201  break;
202  case e_Query_mask:
203  (m_object = new(pool) ncbi::objects::CBlast4_mask())->AddReference();
204  break;
205  case e_String:
206  m_string.Construct();
207  break;
208  default:
209  break;
210  }
211  m_choice = index;
212 }
213 
214 const char* const CBlast4_value_Base::sm_SelectionNames[] = {
215  "not set",
216  "big-integer",
217  "bioseq",
218  "boolean",
219  "cutoff",
220  "integer",
221  "matrix",
222  "real",
223  "seq-align",
224  "seq-id",
225  "seq-loc",
226  "strand-type",
227  "string",
228  "big-integer-list",
229  "bioseq-list",
230  "boolean-list",
231  "cutoff-list",
232  "integer-list",
233  "matrix-list",
234  "real-list",
235  "seq-align-list",
236  "seq-id-list",
237  "seq-loc-list",
238  "strand-type-list",
239  "string-list",
240  "bioseq-set",
241  "seq-align-set",
242  "query-mask"
243 };
244 
246 {
247  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
248 }
249 
251 {
252  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
253 }
254 
256 {
258  return *static_cast<const TBioseq*>(m_object);
259 }
260 
262 {
264  return *static_cast<TBioseq*>(m_object);
265 }
266 
268 {
269  TBioseq* ptr = &value;
270  if ( m_choice != e_Bioseq || m_object != ptr ) {
271  ResetSelection();
272  (m_object = ptr)->AddReference();
273  m_choice = e_Bioseq;
274  }
275 }
276 
278 {
280  return *static_cast<const TCutoff*>(m_object);
281 }
282 
284 {
286  return *static_cast<TCutoff*>(m_object);
287 }
288 
290 {
291  TCutoff* ptr = &value;
292  if ( m_choice != e_Cutoff || m_object != ptr ) {
293  ResetSelection();
294  (m_object = ptr)->AddReference();
295  m_choice = e_Cutoff;
296  }
297 }
298 
300 {
302  return *static_cast<const TMatrix*>(m_object);
303 }
304 
306 {
308  return *static_cast<TMatrix*>(m_object);
309 }
310 
312 {
313  TMatrix* ptr = &value;
314  if ( m_choice != e_Matrix || m_object != ptr ) {
315  ResetSelection();
316  (m_object = ptr)->AddReference();
317  m_choice = e_Matrix;
318  }
319 }
320 
322 {
324  return *static_cast<const TSeq_align*>(m_object);
325 }
326 
328 {
330  return *static_cast<TSeq_align*>(m_object);
331 }
332 
334 {
335  TSeq_align* ptr = &value;
336  if ( m_choice != e_Seq_align || m_object != ptr ) {
337  ResetSelection();
338  (m_object = ptr)->AddReference();
340  }
341 }
342 
344 {
346  return *static_cast<const TSeq_id*>(m_object);
347 }
348 
350 {
352  return *static_cast<TSeq_id*>(m_object);
353 }
354 
356 {
357  TSeq_id* ptr = &value;
358  if ( m_choice != e_Seq_id || m_object != ptr ) {
359  ResetSelection();
360  (m_object = ptr)->AddReference();
361  m_choice = e_Seq_id;
362  }
363 }
364 
366 {
368  return *static_cast<const TSeq_loc*>(m_object);
369 }
370 
372 {
374  return *static_cast<TSeq_loc*>(m_object);
375 }
376 
378 {
379  TSeq_loc* ptr = &value;
380  if ( m_choice != e_Seq_loc || m_object != ptr ) {
381  ResetSelection();
382  (m_object = ptr)->AddReference();
384  }
385 }
386 
388 {
390  *m_string = value;
391 }
392 
394 {
396  return *static_cast<const TBioseq_set*>(m_object);
397 }
398 
400 {
402  return *static_cast<TBioseq_set*>(m_object);
403 }
404 
406 {
407  TBioseq_set* ptr = &value;
408  if ( m_choice != e_Bioseq_set || m_object != ptr ) {
409  ResetSelection();
410  (m_object = ptr)->AddReference();
412  }
413 }
414 
416 {
418  return *static_cast<const TSeq_align_set*>(m_object);
419 }
420 
422 {
424  return *static_cast<TSeq_align_set*>(m_object);
425 }
426 
428 {
429  TSeq_align_set* ptr = &value;
430  if ( m_choice != e_Seq_align_set || m_object != ptr ) {
431  ResetSelection();
432  (m_object = ptr)->AddReference();
434  }
435 }
436 
438 {
440  return *static_cast<const TQuery_mask*>(m_object);
441 }
442 
444 {
446  return *static_cast<TQuery_mask*>(m_object);
447 }
448 
450 {
451  TQuery_mask* ptr = &value;
452  if ( m_choice != e_Query_mask || m_object != ptr ) {
453  ResetSelection();
454  (m_object = ptr)->AddReference();
456  }
457 }
458 
459 // helper methods
460 
461 // type info
463 {
464  SET_CHOICE_MODULE("NCBI-Blast4");
465  ADD_NAMED_CHOICE_VARIANT("big-integer", m_Big_integer, BigInt, ());
466  ADD_NAMED_REF_CHOICE_VARIANT("bioseq", m_object, CBioseq);
467  ADD_NAMED_STD_CHOICE_VARIANT("boolean", m_Boolean);
468  ADD_NAMED_REF_CHOICE_VARIANT("cutoff", m_object, CBlast4_cutoff);
469  ADD_NAMED_STD_CHOICE_VARIANT("integer", m_Integer);
471  ADD_NAMED_STD_CHOICE_VARIANT("real", m_Real);
472  ADD_NAMED_REF_CHOICE_VARIANT("seq-align", m_object, CSeq_align);
473  ADD_NAMED_REF_CHOICE_VARIANT("seq-id", m_object, CSeq_id);
474  ADD_NAMED_REF_CHOICE_VARIANT("seq-loc", m_object, CSeq_loc);
475  ADD_NAMED_ENUM_CHOICE_VARIANT("strand-type", m_Strand_type, EBlast4_strand_type);
476  ADD_NAMED_BUF_CHOICE_VARIANT("string", m_string, STD, (string));
477  ADD_NAMED_BUF_CHOICE_VARIANT("big-integer-list", m_Big_integer_list, STL_list, (BigInt, ()));
478  ADD_NAMED_BUF_CHOICE_VARIANT("bioseq-list", m_Bioseq_list, STL_list, (STL_CRef, (CLASS, (CBioseq))));
479  ADD_NAMED_BUF_CHOICE_VARIANT("boolean-list", m_Boolean_list, STL_list, (STD, (bool)));
480  ADD_NAMED_BUF_CHOICE_VARIANT("cutoff-list", m_Cutoff_list, STL_list, (STL_CRef, (CLASS, (CBlast4_cutoff))));
481  ADD_NAMED_BUF_CHOICE_VARIANT("integer-list", m_Integer_list, STL_list, (STD, (int)));
482  ADD_NAMED_BUF_CHOICE_VARIANT("matrix-list", m_Matrix_list, STL_list, (STL_CRef, (CLASS, (CPssmWithParameters))));
483  ADD_NAMED_BUF_CHOICE_VARIANT("real-list", m_Real_list, STL_list, (STD, (double)));
484  ADD_NAMED_BUF_CHOICE_VARIANT("seq-align-list", m_Seq_align_list, STL_list, (STL_CRef, (CLASS, (CSeq_align))));
485  ADD_NAMED_BUF_CHOICE_VARIANT("seq-id-list", m_Seq_id_list, STL_list, (STL_CRef, (CLASS, (CSeq_id))));
486  ADD_NAMED_BUF_CHOICE_VARIANT("seq-loc-list", m_Seq_loc_list, STL_list, (STL_CRef, (CLASS, (CSeq_loc))));
487  ADD_NAMED_BUF_CHOICE_VARIANT("strand-type-list", m_Strand_type_list, STL_list, (ENUM, (EBlast4_strand_type, EBlast4_strand_type)));
488  ADD_NAMED_BUF_CHOICE_VARIANT("string-list", m_String_list, STL_list, (STD, (string)));
489  ADD_NAMED_REF_CHOICE_VARIANT("bioseq-set", m_object, CBioseq_set);
490  ADD_NAMED_REF_CHOICE_VARIANT("seq-align-set", m_object, CSeq_align_set);
491  ADD_NAMED_REF_CHOICE_VARIANT("query-mask", m_object, CBlast4_mask);
492  info->CodeVersion(22400);
493  info->DataSpec(ncbi::EDataSpec::eASN);
494 }
496 
497 // constructor
499  : m_choice(e_not_set)
500 {
501 }
502 
503 // destructor
505 {
506  Reset();
507 }
508 
509 
510 
511 END_objects_SCOPE // namespace ncbi::objects::
512 
514 
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-value", CBlast4_value)
User-defined methods of the data storage class.
CBlast4_cutoff –.
CBlast4_mask –.
Definition: Blast4_mask.hpp:66
CBlast4_value –.
string
Definition: cgiapp.hpp:690
#define DIAG_COMPILE_INFO
Make compile time diagnostic information object to use in CNcbiDiag and CException.
Definition: ncbidiag.hpp:170
#define ADD_NAMED_CHOICE_VARIANT(MemberAlias, MemberName, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:382
#define ADD_NAMED_REF_CHOICE_VARIANT(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:400
#define ADD_NAMED_ENUM_CHOICE_VARIANT(MemberAlias, MemberName, EnumName)
Definition: serialimpl.hpp:391
#define ADD_NAMED_STD_CHOICE_VARIANT(MemberAlias, MemberName)
Definition: serialimpl.hpp:388
#define END_CHOICE_INFO
Definition: serialimpl.hpp:506
#define SET_CHOICE_MODULE(ModuleName)
Definition: serialimpl.hpp:500
#define ADD_NAMED_BUF_CHOICE_VARIANT(MemberAlias, MemberName, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:385
@ 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
const TBioseq & GetBioseq(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TInteger_list > m_Integer_list
TSeq_align & SetSeq_align(void)
Select the variant.
const TSeq_id & GetSeq_id(void) const
Get the variant data.
const TCutoff & GetCutoff(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TBoolean_list > m_Boolean_list
const TBioseq_set & GetBioseq_set(void) const
Get the variant data.
TQuery_mask & SetQuery_mask(void)
Select the variant.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
TBioseq & SetBioseq(void)
Select the variant.
const TSeq_align & GetSeq_align(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TBioseq_list > m_Bioseq_list
NCBI_NS_NCBI::CUnionBuffer< TStrand_type_list > m_Strand_type_list
static const char *const sm_SelectionNames[]
NCBI_NS_NCBI::CUnionBuffer< TString_list > m_String_list
NCBI_NS_NCBI::CUnionBuffer< TSeq_id_list > m_Seq_id_list
TSeq_id & SetSeq_id(void)
Select the variant.
TMatrix & SetMatrix(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< TBig_integer_list > m_Big_integer_list
const TSeq_align_set & GetSeq_align_set(void) const
Get the variant data.
TBioseq_set & SetBioseq_set(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< TReal_list > m_Real_list
virtual void Reset(void)
Reset the whole object.
TSeq_align_set & SetSeq_align_set(void)
Select the variant.
const TMatrix & GetMatrix(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TMatrix_list > m_Matrix_list
TBig_integer m_Big_integer
TSeq_loc & SetSeq_loc(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
TStrand_type m_Strand_type
TCutoff & SetCutoff(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
virtual ~CBlast4_value_Base(void)
const TQuery_mask & GetQuery_mask(void) const
Get the variant data.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
E_Choice
Choice variants.
NCBI_NS_NCBI::CUnionBuffer< TSeq_align_list > m_Seq_align_list
TString & SetString(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< TCutoff_list > m_Cutoff_list
const TSeq_loc & GetSeq_loc(void) const
Get the variant data.
EBlast4_strand_type
Access to EBlast4_strand_type's attributes (values, names) as defined in spec.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
NCBI_NS_NCBI::CSerialObject * m_object
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
NCBI_NS_NCBI::CUnionBuffer< TSeq_loc_list > m_Seq_loc_list
@ e_Query_mask
Intended to represent user-provided masking locations for a single query sequence (name field in Blas...
@ e_not_set
No variant selected.
@ e_Big_integer
scalar types
@ e_Big_integer_list
lists of scalar types
@ e_Bioseq_set
imported collection types
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define STD
Modified on Fri Sep 20 14:58:10 2024 by modify_doxy.py rev. 669887