NCBI C++ ToolKit
Seq_submit_.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  * 'submit.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_Entrys:
64  m_Entrys.Destruct();
65  break;
66  case e_Annots:
67  m_Annots.Destruct();
68  break;
69  case e_Delete:
70  m_Delete.Destruct();
71  break;
72  default:
73  break;
74  }
75  m_choice = e_not_set;
76 }
77 
78 void CSeq_submit_Base::C_Data::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
79 {
80  switch ( index ) {
81  case e_Entrys:
82  m_Entrys.Construct();
83  break;
84  case e_Annots:
85  m_Annots.Construct();
86  break;
87  case e_Delete:
88  m_Delete.Construct();
89  break;
90  default:
91  break;
92  }
93  m_choice = index;
94 }
95 
96 const char* const CSeq_submit_Base::C_Data::sm_SelectionNames[] = {
97  "not set",
98  "entrys",
99  "annots",
100  "delete"
101 };
102 
104 {
105  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
106 }
107 
109 {
110  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
111 }
112 
113 // helper methods
114 
115 // type info
117 {
118  SET_INTERNAL_NAME("Seq-submit", "data");
119  SET_CHOICE_MODULE("NCBI-Submit");
120  ADD_NAMED_BUF_CHOICE_VARIANT("entrys", m_Entrys, STL_list_set, (STL_CRef, (CLASS, (CSeq_entry))));
121  ADD_NAMED_BUF_CHOICE_VARIANT("annots", m_Annots, STL_list_set, (STL_CRef, (CLASS, (CSeq_annot))));
122  ADD_NAMED_BUF_CHOICE_VARIANT("delete", m_Delete, STL_list_set, (STL_CRef, (CLASS, (CSeq_id))));
123  info->CodeVersion(22400);
124  info->DataSpec(ncbi::EDataSpec::eASN);
125 }
127 
128 // constructor
130  : m_choice(e_not_set)
131 {
132 }
133 
134 // destructor
136 {
137  Reset();
138 }
139 
140 
142 {
143  if ( !m_Sub ) {
144  m_Sub.Reset(new TSub());
145  return;
146  }
147  (*m_Sub).Reset();
148 }
149 
151 {
152  m_Sub.Reset(&value);
153 }
154 
156 {
157  if ( !m_Data ) {
158  m_Data.Reset(new TData());
159  return;
160  }
161  (*m_Data).Reset();
162 }
163 
165 {
166  m_Data.Reset(&value);
167 }
168 
170 {
171  ResetSub();
172  ResetData();
173 }
174 
176 {
177  SET_CLASS_MODULE("NCBI-Submit");
179  ADD_NAMED_REF_MEMBER("data", m_Data, C_Data);
180  info->RandomOrder();
181  info->CodeVersion(22400);
182  info->DataSpec(ncbi::EDataSpec::eASN);
183 }
185 
186 // constructor
188 {
189  memset(m_set_State,0,sizeof(m_set_State));
190  if ( !IsAllocatedInPool() ) {
191  ResetSub();
192  ResetData();
193  }
194 }
195 
196 // destructor
198 {
199 }
200 
201 
202 
203 END_objects_SCOPE // namespace ncbi::objects::
204 
206 
User-defined methods of the data storage class.
BEGIN_NAMED_CHOICE_INFO("", CSeq_submit_Base::C_Data)
BEGIN_NAMED_BASE_CLASS_INFO("Seq-submit", CSeq_submit)
User-defined methods of the data storage class.
Definition: Seq_entry.hpp:56
CSubmit_block –.
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_REF_MEMBER(MemberAlias, MemberName, ClassName)
Definition: serialimpl.hpp:357
#define END_CLASS_INFO
Definition: serialimpl.hpp:456
#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
#define ADD_NAMED_BUF_CHOICE_VARIANT(MemberAlias, MemberName, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:385
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
CSubmit_block TSub
static const char *const sm_SelectionNames[]
void Reset(void)
Reset the whole object.
Definition: Seq_submit_.cpp:54
void ResetSub(void)
Reset Sub data member.
E_Choice
Choice variants.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: Seq_submit_.cpp:78
TData & SetData(void)
Assign a value to Data data member.
virtual ~CSeq_submit_Base(void)
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Uint4 m_set_State[1]
TSub & SetSub(void)
Assign a value to Sub data member.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Seq_submit_.cpp:60
CRef< TSub > m_Sub
virtual void Reset(void)
Reset the whole object.
void ResetData(void)
Reset Data data member.
CRef< TData > m_Data
@ e_not_set
No variant selected.
@ 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:57:42 2024 by modify_doxy.py rev. 669887