NCBI C++ ToolKit
Trna_ext_.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 CTrna_ext_Base::C_Aa::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
63 {
64  switch ( index ) {
65  case e_Iupacaa:
66  m_Iupacaa = 0;
67  break;
68  case e_Ncbieaa:
69  m_Ncbieaa = 0;
70  break;
71  case e_Ncbi8aa:
72  m_Ncbi8aa = 0;
73  break;
74  case e_Ncbistdaa:
75  m_Ncbistdaa = 0;
76  break;
77  default:
78  break;
79  }
80  m_choice = index;
81 }
82 
83 const char* const CTrna_ext_Base::C_Aa::sm_SelectionNames[] = {
84  "not set",
85  "iupacaa",
86  "ncbieaa",
87  "ncbi8aa",
88  "ncbistdaa"
89 };
90 
92 {
93  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
94 }
95 
97 {
98  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
99 }
100 
101 // helper methods
102 
103 // type info
105 {
106  SET_INTERNAL_NAME("Trna-ext", "aa");
107  SET_CHOICE_MODULE("NCBI-RNA");
108  ADD_NAMED_STD_CHOICE_VARIANT("iupacaa", m_Iupacaa);
109  ADD_NAMED_STD_CHOICE_VARIANT("ncbieaa", m_Ncbieaa);
110  ADD_NAMED_STD_CHOICE_VARIANT("ncbi8aa", m_Ncbi8aa);
111  ADD_NAMED_STD_CHOICE_VARIANT("ncbistdaa", m_Ncbistdaa);
112  info->CodeVersion(22301);
113  info->DataSpec(ncbi::EDataSpec::eASN);
114 }
116 
117 // constructor
119  : m_choice(e_not_set)
120 {
121 }
122 
123 // destructor
125 {
126  Reset();
127 }
128 
129 
131 {
132  m_Aa.Reset();
133 }
134 
136 {
137  m_Aa.Reset(&value);
138 }
139 
141 {
142  if ( !m_Aa )
143  m_Aa.Reset(new TAa());
144  return (*m_Aa);
145 }
146 
148 {
149  m_Codon.clear();
150  m_set_State[0] &= ~0xc;
151 }
152 
154 {
155  m_Anticodon.Reset();
156 }
157 
159 {
160  m_Anticodon.Reset(&value);
161 }
162 
164 {
165  if ( !m_Anticodon )
166  m_Anticodon.Reset(new TAnticodon());
167  return (*m_Anticodon);
168 }
169 
171 {
172  ResetAa();
173  ResetCodon();
174  ResetAnticodon();
175 }
176 
178 {
179  SET_CLASS_MODULE("NCBI-RNA");
180  ADD_NAMED_REF_MEMBER("aa", m_Aa, C_Aa)->SetOptional();
181  ADD_NAMED_MEMBER("codon", m_Codon, STL_list_set, (STD, (int)))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
182  ADD_NAMED_REF_MEMBER("anticodon", m_Anticodon, CSeq_loc)->SetOptional();
183  info->RandomOrder();
184  info->CodeVersion(22301);
185  info->DataSpec(ncbi::EDataSpec::eASN);
186 }
188 
189 // constructor
191 {
192  memset(m_set_State,0,sizeof(m_set_State));
193 }
194 
195 // destructor
197 {
198 }
199 
200 
201 
202 END_objects_SCOPE // namespace ncbi::objects::
203 
205 
User-defined methods of the data storage class.
BEGIN_NAMED_CHOICE_INFO("", CTrna_ext_Base::C_Aa)
Definition: Trna_ext_.cpp:104
BEGIN_NAMED_BASE_CLASS_INFO("Trna-ext", CTrna_ext)
Definition: Trna_ext_.cpp:177
aa this carries
Definition: Trna_ext_.hpp:96
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 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
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TAnticodon & SetAnticodon(void)
Assign a value to Anticodon data member.
Definition: Trna_ext_.cpp:163
void Reset(void)
Reset the whole object.
Definition: Trna_ext_.cpp:51
void ResetAa(void)
Reset Aa data member.
Definition: Trna_ext_.cpp:130
virtual void Reset(void)
Reset the whole object.
Definition: Trna_ext_.cpp:170
CSeq_loc TAnticodon
Definition: Trna_ext_.hpp:307
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Trna_ext_.cpp:91
CRef< TAnticodon > m_Anticodon
Definition: Trna_ext_.hpp:441
static const char *const sm_SelectionNames[]
Definition: Trna_ext_.hpp:295
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: Trna_ext_.cpp:62
CRef< TAa > m_Aa
Definition: Trna_ext_.hpp:439
void ResetAnticodon(void)
Reset Anticodon data member.
Definition: Trna_ext_.cpp:153
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Trna_ext_.cpp:96
void ResetCodon(void)
Reset Codon data member.
Definition: Trna_ext_.cpp:147
E_Choice
Choice variants.
Definition: Trna_ext_.hpp:109
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Trna_ext_.cpp:57
CTrna_ext_Base(void)
Definition: Trna_ext_.cpp:190
list< int > m_Codon
Definition: Trna_ext_.hpp:440
TAa & SetAa(void)
Assign a value to Aa data member.
Definition: Trna_ext_.cpp:140
Uint4 m_set_State[1]
Definition: Trna_ext_.hpp:438
virtual ~CTrna_ext_Base(void)
Definition: Trna_ext_.cpp:196
@ e_not_set
No variant selected.
Definition: Trna_ext_.hpp:110
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
Modified on Wed Nov 29 02:24:26 2023 by modify_doxy.py rev. 669887