NCBI C++ ToolKit
SeqEdit_Cmd_RemoveAnnot_.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_choice != e_not_set )
58 }
59 
61 {
62  switch ( m_choice ) {
63  case e_Feat:
64  case e_Align:
65  case e_Graph:
66  m_object->RemoveReference();
67  break;
68  default:
69  break;
70  }
71  m_choice = e_not_set;
72 }
73 
74 void CSeqEdit_Cmd_RemoveAnnot_Base::C_Data::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
75 {
76  switch ( index ) {
77  case e_Feat:
78  (m_object = new(pool) ncbi::objects::CSeq_feat())->AddReference();
79  break;
80  case e_Align:
81  (m_object = new(pool) ncbi::objects::CSeq_align())->AddReference();
82  break;
83  case e_Graph:
84  (m_object = new(pool) ncbi::objects::CSeq_graph())->AddReference();
85  break;
86  default:
87  break;
88  }
89  m_choice = index;
90 }
91 
93  "not set",
94  "feat",
95  "align",
96  "graph"
97 };
98 
100 {
101  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
102 }
103 
105 {
106  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
107 }
108 
110 {
111  CheckSelected(e_Feat);
112  return *static_cast<const TFeat*>(m_object);
113 }
114 
116 {
117  Select(e_Feat, NCBI_NS_NCBI::eDoNotResetVariant);
118  return *static_cast<TFeat*>(m_object);
119 }
120 
122 {
123  TFeat* ptr = &value;
124  if ( m_choice != e_Feat || m_object != ptr ) {
125  ResetSelection();
126  (m_object = ptr)->AddReference();
127  m_choice = e_Feat;
128  }
129 }
130 
132 {
133  CheckSelected(e_Align);
134  return *static_cast<const TAlign*>(m_object);
135 }
136 
138 {
139  Select(e_Align, NCBI_NS_NCBI::eDoNotResetVariant);
140  return *static_cast<TAlign*>(m_object);
141 }
142 
144 {
145  TAlign* ptr = &value;
146  if ( m_choice != e_Align || m_object != ptr ) {
147  ResetSelection();
148  (m_object = ptr)->AddReference();
149  m_choice = e_Align;
150  }
151 }
152 
154 {
155  CheckSelected(e_Graph);
156  return *static_cast<const TGraph*>(m_object);
157 }
158 
160 {
161  Select(e_Graph, NCBI_NS_NCBI::eDoNotResetVariant);
162  return *static_cast<TGraph*>(m_object);
163 }
164 
166 {
167  TGraph* ptr = &value;
168  if ( m_choice != e_Graph || m_object != ptr ) {
169  ResetSelection();
170  (m_object = ptr)->AddReference();
171  m_choice = e_Graph;
172  }
173 }
174 
175 // helper methods
176 
177 // type info
179 {
180  SET_INTERNAL_NAME("SeqEdit-Cmd-RemoveAnnot", "data");
181  SET_CHOICE_MODULE("NCBI-SeqEdit");
182  ADD_NAMED_REF_CHOICE_VARIANT("feat", m_object, CSeq_feat);
183  ADD_NAMED_REF_CHOICE_VARIANT("align", m_object, CSeq_align);
184  ADD_NAMED_REF_CHOICE_VARIANT("graph", m_object, CSeq_graph);
185  info->CodeVersion(22400);
186  info->DataSpec(ncbi::EDataSpec::eASN);
187 }
189 
190 // constructor
192  : m_choice(e_not_set)
193 {
194 }
195 
196 // destructor
198 {
199  Reset();
200 }
201 
202 
204 {
205  if ( !m_Id ) {
206  m_Id.Reset(new TId());
207  return;
208  }
209  (*m_Id).Reset();
210 }
211 
213 {
214  m_Id.Reset(&value);
215 }
216 
218 {
219  m_Name.erase();
220  m_set_State[0] &= ~0xc;
221 }
222 
224 {
225  if ( !m_Data ) {
226  m_Data.Reset(new TData());
227  return;
228  }
229  (*m_Data).Reset();
230 }
231 
233 {
234  m_Data.Reset(&value);
235 }
236 
238 {
239  ResetId();
240  ResetName();
241  ResetNamed();
242  ResetData();
243 }
244 
246 {
247  SET_CLASS_MODULE("NCBI-SeqEdit");
249  ADD_NAMED_STD_MEMBER("name", m_Name)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
250  ADD_NAMED_STD_MEMBER("named", m_Named)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
251  ADD_NAMED_REF_MEMBER("data", m_Data, C_Data);
252  info->RandomOrder();
253  info->CodeVersion(22400);
254  info->DataSpec(ncbi::EDataSpec::eASN);
255 }
257 
258 // constructor
260  : m_Named(0)
261 {
262  memset(m_set_State,0,sizeof(m_set_State));
263  if ( !IsAllocatedInPool() ) {
264  ResetId();
265  ResetData();
266  }
267 }
268 
269 // destructor
271 {
272 }
273 
274 
275 
276 END_objects_SCOPE // namespace ncbi::objects::
277 
279 
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_CLASS_INFO("SeqEdit-Cmd-RemoveAnnot", CSeqEdit_Cmd_RemoveAnnot)
BEGIN_NAMED_CHOICE_INFO("", CSeqEdit_Cmd_RemoveAnnot_Base::C_Data)
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CSeqEdit_Cmd_RemoveAnnot –.
CSeqEdit_Id –.
Definition: SeqEdit_Id.hpp:66
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
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 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.
TAlign & SetAlign(void)
Select the variant.
TFeat & SetFeat(void)
Select the variant.
TGraph & SetGraph(void)
Select the variant.
TData & SetData(void)
Assign a value to Data data member.
void ResetId(void)
Reset Id data member.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
void ResetData(void)
Reset Data data member.
void Reset(void)
Reset the whole object.
virtual void Reset(void)
Reset the whole object.
const TGraph & GetGraph(void) const
Get the variant data.
const TAlign & GetAlign(void) const
Get the variant data.
TId & SetId(void)
Assign a value to Id data member.
@ 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 Fri Sep 20 14:58:19 2024 by modify_doxy.py rev. 669887