NCBI C++ ToolKit
Code_break_.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  * 'seqfeat.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
45 
46 BEGIN_objects_SCOPE // namespace ncbi::objects::
47 
48 
49 // generated classes
50 
52 {
53  if ( m_choice != e_not_set )
55 }
56 
58 {
59  m_choice = e_not_set;
60 }
61 
62 void CCode_break_Base::C_Aa::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
63 {
64  switch ( index ) {
65  case e_Ncbieaa:
66  m_Ncbieaa = 0;
67  break;
68  case e_Ncbi8aa:
69  m_Ncbi8aa = 0;
70  break;
71  case e_Ncbistdaa:
72  m_Ncbistdaa = 0;
73  break;
74  default:
75  break;
76  }
77  m_choice = index;
78 }
79 
80 const char* const CCode_break_Base::C_Aa::sm_SelectionNames[] = {
81  "not set",
82  "ncbieaa",
83  "ncbi8aa",
84  "ncbistdaa"
85 };
86 
88 {
89  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
90 }
91 
93 {
94  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
95 }
96 
97 // helper methods
98 
99 // type info
101 {
102  SET_INTERNAL_NAME("Code-break", "aa");
103  SET_CHOICE_MODULE("NCBI-Seqfeat");
104  ADD_NAMED_STD_CHOICE_VARIANT("ncbieaa", m_Ncbieaa);
105  ADD_NAMED_STD_CHOICE_VARIANT("ncbi8aa", m_Ncbi8aa);
106  ADD_NAMED_STD_CHOICE_VARIANT("ncbistdaa", m_Ncbistdaa);
107  info->CodeVersion(22400);
108  info->DataSpec(ncbi::EDataSpec::eASN);
109 }
111 
112 // constructor
114  : m_choice(e_not_set)
115 {
116 }
117 
118 // destructor
120 {
121  Reset();
122 }
123 
124 
126 {
127  if ( !m_Loc ) {
128  m_Loc.Reset(new TLoc());
129  return;
130  }
131  (*m_Loc).Reset();
132 }
133 
135 {
136  m_Loc.Reset(&value);
137 }
138 
140 {
141  if ( !m_Aa ) {
142  m_Aa.Reset(new TAa());
143  return;
144  }
145  (*m_Aa).Reset();
146 }
147 
149 {
150  m_Aa.Reset(&value);
151 }
152 
154 {
155  ResetLoc();
156  ResetAa();
157 }
158 
160 {
161  SET_CLASS_MODULE("NCBI-Seqfeat");
163  ADD_NAMED_REF_MEMBER("aa", m_Aa, C_Aa);
164  info->RandomOrder();
165  info->CodeVersion(22400);
166  info->DataSpec(ncbi::EDataSpec::eASN);
167 }
169 
170 // constructor
172 {
173  memset(m_set_State,0,sizeof(m_set_State));
174  if ( !IsAllocatedInPool() ) {
175  ResetLoc();
176  ResetAa();
177  }
178 }
179 
180 // destructor
182 {
183 }
184 
185 
186 
187 END_objects_SCOPE // namespace ncbi::objects::
188 
190 
User-defined methods of the data storage class.
BEGIN_NAMED_CHOICE_INFO("", CCode_break_Base::C_Aa)
BEGIN_NAMED_BASE_CLASS_INFO("Code-break", CCode_break)
CCode_break –.
Definition: Code_break.hpp:66
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 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 ADD_NAMED_STD_CHOICE_VARIANT(MemberAlias, MemberName)
Definition: serialimpl.hpp:388
#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
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 ResetAa(void)
Reset Aa data member.
virtual void Reset(void)
Reset the whole object.
TLoc & SetLoc(void)
Assign a value to Loc data member.
CRef< TLoc > m_Loc
void ResetLoc(void)
Reset Loc data member.
TAa & SetAa(void)
Assign a value to Aa data member.
static const char *const sm_SelectionNames[]
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: Code_break_.cpp:62
virtual ~CCode_break_Base(void)
Uint4 m_set_State[1]
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Code_break_.cpp:92
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Code_break_.cpp:87
CRef< TAa > m_Aa
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Code_break_.cpp:57
E_Choice
Choice variants.
void Reset(void)
Reset the whole object.
Definition: Code_break_.cpp:51
@ 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 Tue Jun 18 13:38:31 2024 by modify_doxy.py rev. 669887