NCBI C++ ToolKit
SeqEdit_Cmd_ReplaceAnnot_.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  * 'seqedit.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
48 
49 BEGIN_objects_SCOPE // namespace ncbi::objects::
50 
51 
52 // generated classes
53 
55 {
56  if ( !m_Ovalue ) {
57  m_Ovalue.Reset(new TOvalue());
58  return;
59  }
60  (*m_Ovalue).Reset();
61 }
62 
64 {
65  m_Ovalue.Reset(&value);
66 }
67 
69 {
70  if ( !m_Nvalue ) {
71  m_Nvalue.Reset(new TNvalue());
72  return;
73  }
74  (*m_Nvalue).Reset();
75 }
76 
78 {
79  m_Nvalue.Reset(&value);
80 }
81 
83 {
84  ResetOvalue();
85  ResetNvalue();
86 }
87 
89 {
90  SET_INTERNAL_NAME("SeqEdit-Cmd-ReplaceAnnot.data", "feat");
91  SET_CLASS_MODULE("NCBI-SeqEdit");
92  ADD_NAMED_REF_MEMBER("ovalue", m_Ovalue, CSeq_feat);
93  ADD_NAMED_REF_MEMBER("nvalue", m_Nvalue, CSeq_feat);
94  info->RandomOrder();
95  info->CodeVersion(22400);
96  info->DataSpec(ncbi::EDataSpec::eASN);
97 }
99 
100 // constructor
102 {
103  memset(m_set_State,0,sizeof(m_set_State));
104  if ( !IsAllocatedInPool() ) {
105  ResetOvalue();
106  ResetNvalue();
107  }
108 }
109 
110 // destructor
112 {
113 }
114 
115 
117 {
118  if ( !m_Ovalue ) {
119  m_Ovalue.Reset(new TOvalue());
120  return;
121  }
122  (*m_Ovalue).Reset();
123 }
124 
126 {
127  m_Ovalue.Reset(&value);
128 }
129 
131 {
132  if ( !m_Nvalue ) {
133  m_Nvalue.Reset(new TNvalue());
134  return;
135  }
136  (*m_Nvalue).Reset();
137 }
138 
140 {
141  m_Nvalue.Reset(&value);
142 }
143 
145 {
146  ResetOvalue();
147  ResetNvalue();
148 }
149 
151 {
152  SET_INTERNAL_NAME("SeqEdit-Cmd-ReplaceAnnot.data", "align");
153  SET_CLASS_MODULE("NCBI-SeqEdit");
154  ADD_NAMED_REF_MEMBER("ovalue", m_Ovalue, CSeq_align);
155  ADD_NAMED_REF_MEMBER("nvalue", m_Nvalue, CSeq_align);
156  info->RandomOrder();
157  info->CodeVersion(22400);
158  info->DataSpec(ncbi::EDataSpec::eASN);
159 }
161 
162 // constructor
164 {
165  memset(m_set_State,0,sizeof(m_set_State));
166  if ( !IsAllocatedInPool() ) {
167  ResetOvalue();
168  ResetNvalue();
169  }
170 }
171 
172 // destructor
174 {
175 }
176 
177 
179 {
180  if ( !m_Ovalue ) {
181  m_Ovalue.Reset(new TOvalue());
182  return;
183  }
184  (*m_Ovalue).Reset();
185 }
186 
188 {
189  m_Ovalue.Reset(&value);
190 }
191 
193 {
194  if ( !m_Nvalue ) {
195  m_Nvalue.Reset(new TNvalue());
196  return;
197  }
198  (*m_Nvalue).Reset();
199 }
200 
202 {
203  m_Nvalue.Reset(&value);
204 }
205 
207 {
208  ResetOvalue();
209  ResetNvalue();
210 }
211 
213 {
214  SET_INTERNAL_NAME("SeqEdit-Cmd-ReplaceAnnot.data", "graph");
215  SET_CLASS_MODULE("NCBI-SeqEdit");
216  ADD_NAMED_REF_MEMBER("ovalue", m_Ovalue, CSeq_graph);
217  ADD_NAMED_REF_MEMBER("nvalue", m_Nvalue, CSeq_graph);
218  info->RandomOrder();
219  info->CodeVersion(22400);
220  info->DataSpec(ncbi::EDataSpec::eASN);
221 }
223 
224 // constructor
226 {
227  memset(m_set_State,0,sizeof(m_set_State));
228  if ( !IsAllocatedInPool() ) {
229  ResetOvalue();
230  ResetNvalue();
231  }
232 }
233 
234 // destructor
236 {
237 }
238 
239 
241 {
242  if ( m_choice != e_not_set )
243  ResetSelection();
244 }
245 
247 {
248  switch ( m_choice ) {
249  case e_Feat:
250  case e_Align:
251  case e_Graph:
252  m_object->RemoveReference();
253  break;
254  default:
255  break;
256  }
258 }
259 
260 void CSeqEdit_Cmd_ReplaceAnnot_Base::C_Data::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
261 {
262  switch ( index ) {
263  case e_Feat:
264  (m_object = new(pool) C_Feat())->AddReference();
265  break;
266  case e_Align:
267  (m_object = new(pool) C_Align())->AddReference();
268  break;
269  case e_Graph:
270  (m_object = new(pool) C_Graph())->AddReference();
271  break;
272  default:
273  break;
274  }
275  m_choice = index;
276 }
277 
279  "not set",
280  "feat",
281  "align",
282  "graph"
283 };
284 
286 {
287  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
288 }
289 
291 {
292  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
293 }
294 
296 {
298  return *static_cast<const TFeat*>(m_object);
299 }
300 
302 {
304  return *static_cast<TFeat*>(m_object);
305 }
306 
308 {
309  TFeat* ptr = &value;
310  if ( m_choice != e_Feat || m_object != ptr ) {
311  ResetSelection();
312  (m_object = ptr)->AddReference();
313  m_choice = e_Feat;
314  }
315 }
316 
318 {
320  return *static_cast<const TAlign*>(m_object);
321 }
322 
324 {
326  return *static_cast<TAlign*>(m_object);
327 }
328 
330 {
331  TAlign* ptr = &value;
332  if ( m_choice != e_Align || m_object != ptr ) {
333  ResetSelection();
334  (m_object = ptr)->AddReference();
335  m_choice = e_Align;
336  }
337 }
338 
340 {
342  return *static_cast<const TGraph*>(m_object);
343 }
344 
346 {
348  return *static_cast<TGraph*>(m_object);
349 }
350 
352 {
353  TGraph* ptr = &value;
354  if ( m_choice != e_Graph || m_object != ptr ) {
355  ResetSelection();
356  (m_object = ptr)->AddReference();
357  m_choice = e_Graph;
358  }
359 }
360 
361 // helper methods
362 
363 // type info
365 {
366  SET_INTERNAL_NAME("SeqEdit-Cmd-ReplaceAnnot", "data");
367  SET_CHOICE_MODULE("NCBI-SeqEdit");
368  ADD_NAMED_REF_CHOICE_VARIANT("feat", m_object, C_Feat);
369  ADD_NAMED_REF_CHOICE_VARIANT("align", m_object, C_Align);
370  ADD_NAMED_REF_CHOICE_VARIANT("graph", m_object, C_Graph);
371  info->CodeVersion(22400);
372  info->DataSpec(ncbi::EDataSpec::eASN);
373 }
375 
376 // constructor
379 {
380 }
381 
382 // destructor
384 {
385  Reset();
386 }
387 
388 
390 {
391  if ( !m_Id ) {
392  m_Id.Reset(new TId());
393  return;
394  }
395  (*m_Id).Reset();
396 }
397 
399 {
400  m_Id.Reset(&value);
401 }
402 
404 {
405  m_Name.erase();
406  m_set_State[0] &= ~0xc;
407 }
408 
410 {
411  if ( !m_Data ) {
412  m_Data.Reset(new TData());
413  return;
414  }
415  (*m_Data).Reset();
416 }
417 
419 {
420  m_Data.Reset(&value);
421 }
422 
424 {
425  ResetId();
426  ResetName();
427  ResetNamed();
428  ResetData();
429 }
430 
432 {
433  SET_CLASS_MODULE("NCBI-SeqEdit");
435  ADD_NAMED_STD_MEMBER("name", m_Name)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
436  ADD_NAMED_STD_MEMBER("named", m_Named)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
437  ADD_NAMED_REF_MEMBER("data", m_Data, C_Data);
438  info->RandomOrder();
439  info->CodeVersion(22400);
440  info->DataSpec(ncbi::EDataSpec::eASN);
441 }
443 
444 // constructor
446  : m_Named(0)
447 {
448  memset(m_set_State,0,sizeof(m_set_State));
449  if ( !IsAllocatedInPool() ) {
450  ResetId();
451  ResetData();
452  }
453 }
454 
455 // destructor
457 {
458 }
459 
460 
461 
462 END_objects_SCOPE // namespace ncbi::objects::
463 
465 
User-defined methods of the data storage class.
BEGIN_NAMED_CHOICE_INFO("", CSeqEdit_Cmd_ReplaceAnnot_Base::C_Data)
BEGIN_NAMED_CLASS_INFO("", CSeqEdit_Cmd_ReplaceAnnot_Base::C_Data::C_Feat)
BEGIN_NAMED_BASE_CLASS_INFO("SeqEdit-Cmd-ReplaceAnnot", CSeqEdit_Cmd_ReplaceAnnot)
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CSeqEdit_Cmd_ReplaceAnnot –.
CSeqEdit_Id –.
Definition: SeqEdit_Id.hpp:66
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
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 MEMBER_PTR(MemberName)
Definition: serialimpl.hpp:284
#define ADD_NAMED_REF_MEMBER(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:357
#define END_CLASS_INFO
Definition: serialimpl.hpp:456
#define ADD_NAMED_REF_CHOICE_VARIANT(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:400
#define ADD_NAMED_STD_MEMBER(MemberAlias, MemberName)
Definition: serialimpl.hpp:345
#define SET_CLASS_MODULE(ModuleName)
Definition: serialimpl.hpp:444
#define END_CHOICE_INFO
Definition: serialimpl.hpp:506
#define SET_INTERNAL_NAME(OwnerName, MemberName)
Definition: serialimpl.hpp:447
#define SET_CHOICE_MODULE(ModuleName)
Definition: serialimpl.hpp:500
@ eDoNotResetVariant
Definition: serialbase.hpp:78
void AddReference(void) const
Add reference to object.
Definition: ncbiobj.hpp:489
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool IsAllocatedInPool(void) const THROWS_NONE
Check if object is allocated in memory pool (not system heap)
Definition: ncbiobj.hpp:461
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
void ResetNamed(void)
Reset Named data member.
void ResetName(void)
Reset Name data member.
const TFeat & GetFeat(void) const
Get the variant data.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
void ResetId(void)
Reset Id data member.
TOvalue & SetOvalue(void)
Assign a value to Ovalue data member.
void ResetData(void)
Reset Data data member.
TNvalue & SetNvalue(void)
Assign a value to Nvalue data member.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
virtual void Reset(void)
Reset the whole object.
TNvalue & SetNvalue(void)
Assign a value to Nvalue data member.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TAlign & SetAlign(void)
Select the variant.
const TGraph & GetGraph(void) const
Get the variant data.
const TAlign & GetAlign(void) const
Get the variant data.
TOvalue & SetOvalue(void)
Assign a value to Ovalue data member.
TId & SetId(void)
Assign a value to Id data member.
TData & SetData(void)
Assign a value to Data data member.
TOvalue & SetOvalue(void)
Assign a value to Ovalue data member.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
TNvalue & SetNvalue(void)
Assign a value to Nvalue data member.
TGraph & SetGraph(void)
Select the variant.
virtual void Reset(void)
Reset the whole object.
Definition: Seq_align_.cpp:333
virtual void Reset(void)
Reset the whole object.
Definition: Seq_feat_.cpp:229
virtual void Reset(void)
Reset the whole object.
Definition: Seq_graph_.cpp:255
static MDB_envinfo info
Definition: mdb_load.c:37
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Apr 21 03:44:58 2024 by modify_doxy.py rev. 669887