NCBI C++ ToolKit
TMgr_CreateRemoteTrackRequ_.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  * 'trackmgr.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
49 
50 BEGIN_objects_SCOPE // namespace ncbi::objects::
51 
52 
53 // generated classes
54 
56 {
57  if ( m_choice != e_not_set )
59 }
60 
62 {
63  switch ( m_choice ) {
64  case e_Hub:
65  case e_Track:
66  m_object->RemoveReference();
67  break;
68  default:
69  break;
70  }
71  m_choice = e_not_set;
72 }
73 
74 void CTMgr_CreateRemoteTrackRequest_Base::C_Track_db::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
75 {
76  switch ( index ) {
77  case e_Hub:
78  (m_object = new(pool) ncbi::objects::CTMgr_Hub())->AddReference();
79  break;
80  case e_Track:
81  (m_object = new(pool) ncbi::objects::CTMgr_HubTrack())->AddReference();
82  break;
83  default:
84  break;
85  }
86  m_choice = index;
87 }
88 
90  "not set",
91  "hub",
92  "track"
93 };
94 
96 {
97  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
98 }
99 
101 {
102  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
103 }
104 
106 {
107  CheckSelected(e_Hub);
108  return *static_cast<const THub*>(m_object);
109 }
110 
112 {
113  Select(e_Hub, NCBI_NS_NCBI::eDoNotResetVariant);
114  return *static_cast<THub*>(m_object);
115 }
116 
118 {
119  THub* ptr = &value;
120  if ( m_choice != e_Hub || m_object != ptr ) {
121  ResetSelection();
122  (m_object = ptr)->AddReference();
123  m_choice = e_Hub;
124  }
125 }
126 
128 {
129  CheckSelected(e_Track);
130  return *static_cast<const TTrack*>(m_object);
131 }
132 
134 {
135  Select(e_Track, NCBI_NS_NCBI::eDoNotResetVariant);
136  return *static_cast<TTrack*>(m_object);
137 }
138 
140 {
141  TTrack* ptr = &value;
142  if ( m_choice != e_Track || m_object != ptr ) {
143  ResetSelection();
144  (m_object = ptr)->AddReference();
145  m_choice = e_Track;
146  }
147 }
148 
149 // helper methods
150 
151 // type info
153 {
154  SET_INTERNAL_NAME("TMgr-CreateRemoteTrackRequest", "track-db");
155  SET_CHOICE_MODULE("NCBI-TrackManager");
156  ADD_NAMED_REF_CHOICE_VARIANT("hub", m_object, CTMgr_Hub);
157  ADD_NAMED_REF_CHOICE_VARIANT("track", m_object, CTMgr_HubTrack);
158  info->CodeVersion(22301);
159  info->DataSpec(ncbi::EDataSpec::eASN);
160 }
162 
163 // constructor
165  : m_choice(e_not_set)
166 {
167 }
168 
169 // destructor
171 {
172  Reset();
173 }
174 
175 
177 {
178  if ( !m_Identity ) {
179  m_Identity.Reset(new TIdentity());
180  return;
181  }
182  (*m_Identity).Reset();
183 }
184 
186 {
187  m_Identity.Reset(&value);
188 }
189 
191 {
192  m_Assembly_acc.erase();
193  m_set_State[0] &= ~0xc;
194 }
195 
197 {
198  m_Url.erase();
199  m_set_State[0] &= ~0x30;
200 }
201 
203 {
204  m_Track_name.erase();
205  m_set_State[0] &= ~0x300;
206 }
207 
209 {
210  m_Index_url.erase();
211  m_set_State[0] &= ~0xc00;
212 }
213 
215 {
216  m_Track_db.Reset();
217 }
218 
220 {
221  m_Track_db.Reset(&value);
222 }
223 
225 {
226  if ( !m_Track_db )
227  m_Track_db.Reset(new TTrack_db());
228  return (*m_Track_db);
229 }
230 
232 {
233  m_Attrs.clear();
234  m_set_State[0] &= ~0xc000;
235 }
236 
238 {
239  m_Client.Reset();
240 }
241 
243 {
244  m_Client.Reset(&value);
245 }
246 
248 {
249  if ( !m_Client )
250  m_Client.Reset(new TClient());
251  return (*m_Client);
252 }
253 
255 {
256  ResetIdentity();
258  ResetUrl();
259  ResetType();
260  ResetTrack_name();
261  ResetIndex_url();
262  ResetTrack_db();
263  ResetAttrs();
264  ResetClient();
265 }
266 
268 {
269  SET_CLASS_MODULE("NCBI-TrackManager");
271  ADD_NAMED_STD_MEMBER("assembly-acc", m_Assembly_acc)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
272  ADD_NAMED_STD_MEMBER("url", m_Url)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
274  ADD_NAMED_STD_MEMBER("track-name", m_Track_name)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
275  ADD_NAMED_STD_MEMBER("index-url", m_Index_url)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
276  ADD_NAMED_REF_MEMBER("track-db", m_Track_db, C_Track_db)->SetOptional();
277  ADD_NAMED_MEMBER("attrs", m_Attrs, STL_list_set, (STL_CRef, (CLASS, (CTMgr_Attribute))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
278  ADD_NAMED_REF_MEMBER("client", m_Client, CTMgr_ClientInfo)->SetOptional();
279  info->RandomOrder();
280  info->CodeVersion(22301);
281  info->DataSpec(ncbi::EDataSpec::eASN);
282 }
284 
285 // constructor
287  : m_Type((int)(0))
288 {
289  memset(m_set_State,0,sizeof(m_set_State));
290  if ( !IsAllocatedInPool() ) {
291  ResetIdentity();
292  }
293 }
294 
295 // destructor
297 {
298 }
299 
300 
301 
302 END_objects_SCOPE // namespace ncbi::objects::
303 
305 
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_CHOICE_INFO("", CTMgr_CreateRemoteTrackRequest_Base::C_Track_db)
BEGIN_NAMED_BASE_CLASS_INFO("TMgr-CreateRemoteTrackRequest", CTMgr_CreateRemoteTrackRequest)
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CTMgr_Attribute –.
CTMgr_CreateRemoteTrackRequest –.
CTMgr_HubTrack –.
CTMgr_Hub –.
Definition: TMgr_Hub.hpp:66
CTMgr_Identity –.
char value[7]
Definition: config.c:431
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_MEMBER(MemberAlias, MemberName, TypeMacro, TypeMacroArgs)
Definition: serialimpl.hpp:342
#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 ADD_NAMED_ENUM_MEMBER(MemberAlias, MemberName, EnumName)
Definition: serialimpl.hpp:351
#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
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 ResetClient(void)
Reset Client data member.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
void ResetIndex_url(void)
Reset Index_url data member.
virtual void Reset(void)
Reset the whole object.
void ResetType(void)
Reset Type data member.
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
void ResetAssembly_acc(void)
Reset Assembly_acc data member.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TClient & SetClient(void)
Assign a value to Client data member.
TIdentity & SetIdentity(void)
Assign a value to Identity data member.
TTrack_db & SetTrack_db(void)
Assign a value to Track_db data member.
void ResetAttrs(void)
Reset Attrs data member.
void ResetIdentity(void)
Reset Identity data member.
ETMgr_TypeTrackType
Access to ETMgr_TypeTrackType's attributes (values, names) as defined in spec.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
const TTrack & GetTrack(void) const
Get the variant data.
void ResetTrack_db(void)
Reset Track_db data member.
const THub & GetHub(void) const
Get the variant data.
void ResetTrack_name(void)
Reset Track_name data member.
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
Modified on Fri Dec 01 04:50:11 2023 by modify_doxy.py rev. 669887