NCBI C++ ToolKit
ID2S_Chunk_Content_.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  * 'seqsplit.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  if ( m_choice != e_not_set )
62 }
63 
65 {
66  switch ( m_choice ) {
67  case e_Bioseq_place:
68  m_Bioseq_place.Destruct();
69  break;
70  case e_Feat_ids:
71  m_Feat_ids.Destruct();
72  break;
73  case e_Seq_descr:
74  case e_Seq_annot:
75  case e_Seq_assembly:
76  case e_Seq_map:
77  case e_Seq_data:
78  case e_Seq_annot_place:
79  m_object->RemoveReference();
80  break;
81  default:
82  break;
83  }
85 }
86 
87 void CID2S_Chunk_Content_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
88 {
89  switch ( index ) {
90  case e_Seq_descr:
91  (m_object = new(pool) ncbi::objects::CID2S_Seq_descr_Info())->AddReference();
92  break;
93  case e_Seq_annot:
94  (m_object = new(pool) ncbi::objects::CID2S_Seq_annot_Info())->AddReference();
95  break;
96  case e_Seq_assembly:
97  (m_object = new(pool) ncbi::objects::CID2S_Seq_assembly_Info())->AddReference();
98  break;
99  case e_Seq_map:
100  (m_object = new(pool) ncbi::objects::CID2S_Seq_map_Info())->AddReference();
101  break;
102  case e_Seq_data:
103  (m_object = new(pool) ncbi::objects::CID2S_Seq_data_Info())->AddReference();
104  break;
105  case e_Seq_annot_place:
106  (m_object = new(pool) ncbi::objects::CID2S_Seq_annot_place_Info())->AddReference();
107  break;
108  case e_Bioseq_place:
109  m_Bioseq_place.Construct();
110  break;
111  case e_Feat_ids:
112  m_Feat_ids.Construct();
113  break;
114  default:
115  break;
116  }
117  m_choice = index;
118 }
119 
120 const char* const CID2S_Chunk_Content_Base::sm_SelectionNames[] = {
121  "not set",
122  "seq-descr",
123  "seq-annot",
124  "seq-assembly",
125  "seq-map",
126  "seq-data",
127  "seq-annot-place",
128  "bioseq-place",
129  "feat-ids"
130 };
131 
133 {
134  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
135 }
136 
138 {
139  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
140 }
141 
143 {
145  return *static_cast<const TSeq_descr*>(m_object);
146 }
147 
149 {
151  return *static_cast<TSeq_descr*>(m_object);
152 }
153 
155 {
156  TSeq_descr* ptr = &value;
157  if ( m_choice != e_Seq_descr || m_object != ptr ) {
158  ResetSelection();
159  (m_object = ptr)->AddReference();
161  }
162 }
163 
165 {
167  return *static_cast<const TSeq_annot*>(m_object);
168 }
169 
171 {
173  return *static_cast<TSeq_annot*>(m_object);
174 }
175 
177 {
178  TSeq_annot* ptr = &value;
179  if ( m_choice != e_Seq_annot || m_object != ptr ) {
180  ResetSelection();
181  (m_object = ptr)->AddReference();
183  }
184 }
185 
187 {
189  return *static_cast<const TSeq_assembly*>(m_object);
190 }
191 
193 {
195  return *static_cast<TSeq_assembly*>(m_object);
196 }
197 
199 {
200  TSeq_assembly* ptr = &value;
201  if ( m_choice != e_Seq_assembly || m_object != ptr ) {
202  ResetSelection();
203  (m_object = ptr)->AddReference();
205  }
206 }
207 
209 {
211  return *static_cast<const TSeq_map*>(m_object);
212 }
213 
215 {
217  return *static_cast<TSeq_map*>(m_object);
218 }
219 
221 {
222  TSeq_map* ptr = &value;
223  if ( m_choice != e_Seq_map || m_object != ptr ) {
224  ResetSelection();
225  (m_object = ptr)->AddReference();
227  }
228 }
229 
231 {
233  return *static_cast<const TSeq_data*>(m_object);
234 }
235 
237 {
239  return *static_cast<TSeq_data*>(m_object);
240 }
241 
243 {
244  TSeq_data* ptr = &value;
245  if ( m_choice != e_Seq_data || m_object != ptr ) {
246  ResetSelection();
247  (m_object = ptr)->AddReference();
249  }
250 }
251 
253 {
255  return *static_cast<const TSeq_annot_place*>(m_object);
256 }
257 
259 {
261  return *static_cast<TSeq_annot_place*>(m_object);
262 }
263 
265 {
266  TSeq_annot_place* ptr = &value;
267  if ( m_choice != e_Seq_annot_place || m_object != ptr ) {
268  ResetSelection();
269  (m_object = ptr)->AddReference();
271  }
272 }
273 
274 // helper methods
275 
276 // type info
278 {
279  SET_CHOICE_MODULE("NCBI-Seq-split");
280  ADD_NAMED_REF_CHOICE_VARIANT("seq-descr", m_object, CID2S_Seq_descr_Info);
281  ADD_NAMED_REF_CHOICE_VARIANT("seq-annot", m_object, CID2S_Seq_annot_Info);
282  ADD_NAMED_REF_CHOICE_VARIANT("seq-assembly", m_object, CID2S_Seq_assembly_Info);
283  ADD_NAMED_REF_CHOICE_VARIANT("seq-map", m_object, CID2S_Seq_map_Info);
284  ADD_NAMED_REF_CHOICE_VARIANT("seq-data", m_object, CID2S_Seq_data_Info);
285  ADD_NAMED_REF_CHOICE_VARIANT("seq-annot-place", m_object, CID2S_Seq_annot_place_Info);
286  ADD_NAMED_BUF_CHOICE_VARIANT("bioseq-place", m_Bioseq_place, STL_list_set, (STL_CRef, (CLASS, (CID2S_Bioseq_place_Info))));
287  ADD_NAMED_BUF_CHOICE_VARIANT("feat-ids", m_Feat_ids, STL_list_set, (STL_CRef, (CLASS, (CID2S_Seq_feat_Ids_Info))));
288  info->CodeVersion(22400);
289  info->DataSpec(ncbi::EDataSpec::eASN);
290 }
292 
293 // constructor
295  : m_choice(e_not_set)
296 {
297 }
298 
299 // destructor
301 {
302  Reset();
303 }
304 
305 
306 
307 END_objects_SCOPE // namespace ncbi::objects::
308 
310 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_CHOICE_INFO("ID2S-Chunk-Content", CID2S_Chunk_Content)
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.
User-defined methods of the data storage class.
CID2S_Bioseq_place_Info –.
CID2S_Chunk_Content –.
CID2S_Seq_annot_Info –.
CID2S_Seq_annot_place_Info –.
CID2S_Seq_assembly_Info –.
CID2S_Seq_data_Info –.
CID2S_Seq_descr_Info –.
CID2S_Seq_feat_Ids_Info –.
CID2S_Seq_map_Info –.
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_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
NCBI_NS_NCBI::CUnionBuffer< TBioseq_place > m_Bioseq_place
const TSeq_annot_place & GetSeq_annot_place(void) const
Get the variant data.
TSeq_data & SetSeq_data(void)
Select the variant.
static const char *const sm_SelectionNames[]
TSeq_descr & SetSeq_descr(void)
Select the variant.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
const TSeq_data & GetSeq_data(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TFeat_ids > m_Feat_ids
TSeq_assembly & SetSeq_assembly(void)
Select the variant.
const TSeq_map & GetSeq_map(void) const
Get the variant data.
NCBI_NS_NCBI::CSerialObject * m_object
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TSeq_descr & GetSeq_descr(void) const
Get the variant data.
TSeq_map & SetSeq_map(void)
Select the variant.
TSeq_annot_place & SetSeq_annot_place(void)
Select the variant.
const TSeq_assembly & GetSeq_assembly(void) const
Get the variant data.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
const TSeq_annot & GetSeq_annot(void) const
Get the variant data.
TSeq_annot & SetSeq_annot(void)
Select the variant.
virtual void Reset(void)
Reset the whole object.
@ e_Seq_map
place of sequence map
@ e_Seq_annot_place
place of Seq-annots
@ e_not_set
No variant selected.
@ e_Seq_descr
place of Seq-descrs
@ e_Seq_data
place of sequence data
@ e_Seq_assembly
place of assembly history
@ e_Seq_annot
locations and types of annotations
@ 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 Tue May 21 10:55:20 2024 by modify_doxy.py rev. 669887