NCBI C++ ToolKit
Gnomon_param_.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  * 'gnomon.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  ResetFrom();
58  ResetTo();
59 }
60 
62 {
63  SET_INTERNAL_NAME("Gnomon-param", "gc-content-range");
64  SET_CLASS_MODULE("NCBI-GNOMON");
65  ADD_NAMED_STD_MEMBER("from", m_From)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
66  ADD_NAMED_STD_MEMBER("to", m_To)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
67  info->RandomOrder();
68  info->CodeVersion(22301);
69  info->DataSpec(ncbi::EDataSpec::eASN);
70 }
72 
73 // constructor
75  : m_From(0), m_To(0)
76 {
77  memset(m_set_State,0,sizeof(m_set_State));
78 }
79 
80 // destructor
82 {
83 }
84 
85 
87 {
88  if ( m_choice != e_not_set )
89  ResetSelection();
90 }
91 
93 {
94  switch ( m_choice ) {
95  case e_Coding_region:
96  m_Coding_region.Destruct();
97  break;
98  case e_Intergenic:
99  case e_Intron:
100  case e_Exon:
101  case e_Start:
102  case e_Stop:
103  case e_Donor:
104  case e_Acceptor:
105  case e_Non_coding_region:
106  m_object->RemoveReference();
107  break;
108  default:
109  break;
110  }
111  m_choice = e_not_set;
112 }
113 
114 void CGnomon_param_Base::C_Param::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
115 {
116  switch ( index ) {
117  case e_Intergenic:
118  (m_object = new(pool) ncbi::objects::CIntergenic_params())->AddReference();
119  break;
120  case e_Intron:
121  (m_object = new(pool) ncbi::objects::CIntron_params())->AddReference();
122  break;
123  case e_Exon:
124  (m_object = new(pool) ncbi::objects::CExon_params())->AddReference();
125  break;
126  case e_Start:
127  (m_object = new(pool) ncbi::objects::CMarkov_chain_array())->AddReference();
128  break;
129  case e_Stop:
130  (m_object = new(pool) ncbi::objects::CMarkov_chain_array())->AddReference();
131  break;
132  case e_Donor:
133  (m_object = new(pool) ncbi::objects::CMarkov_chain_array())->AddReference();
134  break;
135  case e_Acceptor:
136  (m_object = new(pool) ncbi::objects::CMarkov_chain_array())->AddReference();
137  break;
138  case e_Coding_region:
139  m_Coding_region.Construct();
140  break;
141  case e_Non_coding_region:
142  (m_object = new(pool) ncbi::objects::CMarkov_chain_params())->AddReference();
143  break;
144  default:
145  break;
146  }
147  m_choice = index;
148 }
149 
151  "not set",
152  "intergenic",
153  "intron",
154  "exon",
155  "start",
156  "stop",
157  "donor",
158  "acceptor",
159  "coding-region",
160  "non-coding-region"
161 };
162 
164 {
165  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
166 }
167 
169 {
170  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
171 }
172 
174 {
175  CheckSelected(e_Intergenic);
176  return *static_cast<const TIntergenic*>(m_object);
177 }
178 
180 {
181  Select(e_Intergenic, NCBI_NS_NCBI::eDoNotResetVariant);
182  return *static_cast<TIntergenic*>(m_object);
183 }
184 
186 {
187  TIntergenic* ptr = &value;
188  if ( m_choice != e_Intergenic || m_object != ptr ) {
189  ResetSelection();
190  (m_object = ptr)->AddReference();
191  m_choice = e_Intergenic;
192  }
193 }
194 
196 {
197  CheckSelected(e_Intron);
198  return *static_cast<const TIntron*>(m_object);
199 }
200 
202 {
203  Select(e_Intron, NCBI_NS_NCBI::eDoNotResetVariant);
204  return *static_cast<TIntron*>(m_object);
205 }
206 
208 {
209  TIntron* ptr = &value;
210  if ( m_choice != e_Intron || m_object != ptr ) {
211  ResetSelection();
212  (m_object = ptr)->AddReference();
213  m_choice = e_Intron;
214  }
215 }
216 
218 {
219  CheckSelected(e_Exon);
220  return *static_cast<const TExon*>(m_object);
221 }
222 
224 {
225  Select(e_Exon, NCBI_NS_NCBI::eDoNotResetVariant);
226  return *static_cast<TExon*>(m_object);
227 }
228 
230 {
231  TExon* ptr = &value;
232  if ( m_choice != e_Exon || m_object != ptr ) {
233  ResetSelection();
234  (m_object = ptr)->AddReference();
235  m_choice = e_Exon;
236  }
237 }
238 
240 {
241  CheckSelected(e_Start);
242  return *static_cast<const TStart*>(m_object);
243 }
244 
246 {
247  Select(e_Start, NCBI_NS_NCBI::eDoNotResetVariant);
248  return *static_cast<TStart*>(m_object);
249 }
250 
252 {
253  TStart* ptr = &value;
254  if ( m_choice != e_Start || m_object != ptr ) {
255  ResetSelection();
256  (m_object = ptr)->AddReference();
257  m_choice = e_Start;
258  }
259 }
260 
262 {
263  CheckSelected(e_Stop);
264  return *static_cast<const TStop*>(m_object);
265 }
266 
268 {
269  Select(e_Stop, NCBI_NS_NCBI::eDoNotResetVariant);
270  return *static_cast<TStop*>(m_object);
271 }
272 
274 {
275  TStop* ptr = &value;
276  if ( m_choice != e_Stop || m_object != ptr ) {
277  ResetSelection();
278  (m_object = ptr)->AddReference();
279  m_choice = e_Stop;
280  }
281 }
282 
284 {
285  CheckSelected(e_Donor);
286  return *static_cast<const TDonor*>(m_object);
287 }
288 
290 {
291  Select(e_Donor, NCBI_NS_NCBI::eDoNotResetVariant);
292  return *static_cast<TDonor*>(m_object);
293 }
294 
296 {
297  TDonor* ptr = &value;
298  if ( m_choice != e_Donor || m_object != ptr ) {
299  ResetSelection();
300  (m_object = ptr)->AddReference();
301  m_choice = e_Donor;
302  }
303 }
304 
306 {
307  CheckSelected(e_Acceptor);
308  return *static_cast<const TAcceptor*>(m_object);
309 }
310 
312 {
313  Select(e_Acceptor, NCBI_NS_NCBI::eDoNotResetVariant);
314  return *static_cast<TAcceptor*>(m_object);
315 }
316 
318 {
319  TAcceptor* ptr = &value;
320  if ( m_choice != e_Acceptor || m_object != ptr ) {
321  ResetSelection();
322  (m_object = ptr)->AddReference();
323  m_choice = e_Acceptor;
324  }
325 }
326 
328 {
329  CheckSelected(e_Non_coding_region);
330  return *static_cast<const TNon_coding_region*>(m_object);
331 }
332 
334 {
335  Select(e_Non_coding_region, NCBI_NS_NCBI::eDoNotResetVariant);
336  return *static_cast<TNon_coding_region*>(m_object);
337 }
338 
340 {
341  TNon_coding_region* ptr = &value;
342  if ( m_choice != e_Non_coding_region || m_object != ptr ) {
343  ResetSelection();
344  (m_object = ptr)->AddReference();
345  m_choice = e_Non_coding_region;
346  }
347 }
348 
349 // helper methods
350 
351 // type info
353 {
354  SET_INTERNAL_NAME("Gnomon-param", "param");
355  SET_CHOICE_MODULE("NCBI-GNOMON");
356  ADD_NAMED_REF_CHOICE_VARIANT("intergenic", m_object, CIntergenic_params);
357  ADD_NAMED_REF_CHOICE_VARIANT("intron", m_object, CIntron_params);
358  ADD_NAMED_REF_CHOICE_VARIANT("exon", m_object, CExon_params);
362  ADD_NAMED_REF_CHOICE_VARIANT("acceptor", m_object, CMarkov_chain_array);
363  ADD_NAMED_BUF_CHOICE_VARIANT("coding-region", m_Coding_region, STL_list, (STL_CRef, (CLASS, (CMarkov_chain_params))));
364  ADD_NAMED_REF_CHOICE_VARIANT("non-coding-region", m_object, CMarkov_chain_params);
365  info->CodeVersion(22301);
366  info->DataSpec(ncbi::EDataSpec::eASN);
367 }
369 
370 // constructor
372  : m_choice(e_not_set)
373 {
374 }
375 
376 // destructor
378 {
379  Reset();
380 }
381 
382 
384 {
385  if ( !m_Gc_content_range ) {
387  return;
388  }
389  (*m_Gc_content_range).Reset();
390 }
391 
393 {
394  m_Gc_content_range.Reset(&value);
395 }
396 
398 {
399  if ( !m_Param ) {
400  m_Param.Reset(new TParam());
401  return;
402  }
403  (*m_Param).Reset();
404 }
405 
407 {
408  m_Param.Reset(&value);
409 }
410 
412 {
414  ResetParam();
415 }
416 
418 {
419  SET_CLASS_MODULE("NCBI-GNOMON");
420  ADD_NAMED_REF_MEMBER("gc-content-range", m_Gc_content_range, C_Gc_content_range);
421  ADD_NAMED_REF_MEMBER("param", m_Param, C_Param);
422  info->RandomOrder();
423  info->CodeVersion(22301);
424  info->DataSpec(ncbi::EDataSpec::eASN);
425 }
427 
428 // constructor
430 {
431  memset(m_set_State,0,sizeof(m_set_State));
432  if ( !IsAllocatedInPool() ) {
434  ResetParam();
435  }
436 }
437 
438 // destructor
440 {
441 }
442 
443 
444 
445 END_objects_SCOPE // namespace ncbi::objects::
446 
448 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
BEGIN_NAMED_CHOICE_INFO("", CGnomon_param_Base::C_Param)
BEGIN_NAMED_BASE_CLASS_INFO("Gnomon-param", CGnomon_param)
BEGIN_NAMED_CLASS_INFO("", CGnomon_param_Base::C_Gc_content_range)
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.
CExon_params –.
Definition: Exon_params.hpp:66
CGnomon_param –.
CIntergenic_params –.
CIntron_params –.
CMarkov_chain_array –.
CMarkov_chain_params –.
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_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
#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
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
TAcceptor & SetAcceptor(void)
Select the variant.
TDonor & SetDonor(void)
Select the variant.
TStart & SetStart(void)
Select the variant.
virtual void Reset(void)
Reset the whole object.
const TNon_coding_region & GetNon_coding_region(void) const
Get the variant data.
const TStop & GetStop(void) const
Get the variant data.
const TStart & GetStart(void) const
Get the variant data.
TParam & SetParam(void)
Assign a value to Param data member.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
CRef< TGc_content_range > m_Gc_content_range
const TIntron & GetIntron(void) const
Get the variant data.
C_Gc_content_range TGc_content_range
CRef< TParam > m_Param
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
void Reset(void)
Reset the whole object.
TNon_coding_region & SetNon_coding_region(void)
Select the variant.
void Reset(void)
Reset the whole object.
TIntron & SetIntron(void)
Select the variant.
void ResetFrom(void)
Reset From data member.
TExon & SetExon(void)
Select the variant.
TIntergenic & SetIntergenic(void)
Select the variant.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
const TDonor & GetDonor(void) const
Get the variant data.
void ResetTo(void)
Reset To data member.
const TAcceptor & GetAcceptor(void) const
Get the variant data.
TGc_content_range & SetGc_content_range(void)
Assign a value to Gc_content_range data member.
virtual ~CGnomon_param_Base(void)
void ResetGc_content_range(void)
Reset Gc_content_range data member.
const TIntergenic & GetIntergenic(void) const
Get the variant data.
const TExon & GetExon(void) const
Get the variant data.
static const char *const sm_SelectionNames[]
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
TStop & SetStop(void)
Select the variant.
void ResetParam(void)
Reset Param data member.
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
Modified on Fri Dec 08 08:19:35 2023 by modify_doxy.py rev. 669887