NCBI C++ ToolKit
Title_.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  * 'biblio.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
42 #include <objects/biblio/Title.hpp>
44 
45 BEGIN_objects_SCOPE // namespace ncbi::objects::
46 
47 
48 // generated classes
49 
51 {
52  if ( m_choice != e_not_set )
54 }
55 
57 {
58  switch ( m_choice ) {
59  case e_Name:
60  case e_Tsub:
61  case e_Trans:
62  case e_Jta:
63  case e_Iso_jta:
64  case e_Ml_jta:
65  case e_Coden:
66  case e_Issn:
67  case e_Abr:
68  case e_Isbn:
69  m_string.Destruct();
70  break;
71  default:
72  break;
73  }
74  m_choice = e_not_set;
75 }
76 
77 void CTitle_Base::C_E::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* )
78 {
79  switch ( index ) {
80  case e_Name:
81  case e_Tsub:
82  case e_Trans:
83  case e_Jta:
84  case e_Iso_jta:
85  case e_Ml_jta:
86  case e_Coden:
87  case e_Issn:
88  case e_Abr:
89  case e_Isbn:
90  m_string.Construct();
91  break;
92  default:
93  break;
94  }
95  m_choice = index;
96 }
97 
98 const char* const CTitle_Base::C_E::sm_SelectionNames[] = {
99  "not set",
100  "name",
101  "tsub",
102  "trans",
103  "jta",
104  "iso-jta",
105  "ml-jta",
106  "coden",
107  "issn",
108  "abr",
109  "isbn"
110 };
111 
113 {
114  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
115 }
116 
118 {
119  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
120 }
121 
123 {
124  Select(e_Name, NCBI_NS_NCBI::eDoNotResetVariant);
125  *m_string = value;
126 }
127 
129 {
130  Select(e_Tsub, NCBI_NS_NCBI::eDoNotResetVariant);
131  *m_string = value;
132 }
133 
135 {
136  Select(e_Trans, NCBI_NS_NCBI::eDoNotResetVariant);
137  *m_string = value;
138 }
139 
141 {
142  Select(e_Jta, NCBI_NS_NCBI::eDoNotResetVariant);
143  *m_string = value;
144 }
145 
147 {
148  Select(e_Iso_jta, NCBI_NS_NCBI::eDoNotResetVariant);
149  *m_string = value;
150 }
151 
153 {
154  Select(e_Ml_jta, NCBI_NS_NCBI::eDoNotResetVariant);
155  *m_string = value;
156 }
157 
159 {
160  Select(e_Coden, NCBI_NS_NCBI::eDoNotResetVariant);
161  *m_string = value;
162 }
163 
165 {
166  Select(e_Issn, NCBI_NS_NCBI::eDoNotResetVariant);
167  *m_string = value;
168 }
169 
171 {
172  Select(e_Abr, NCBI_NS_NCBI::eDoNotResetVariant);
173  *m_string = value;
174 }
175 
177 {
178  Select(e_Isbn, NCBI_NS_NCBI::eDoNotResetVariant);
179  *m_string = value;
180 }
181 
182 // helper methods
183 
184 // type info
186 {
187  SET_INTERNAL_NAME("Title", "E");
188  SET_CHOICE_MODULE("NCBI-Biblio");
189  ADD_NAMED_BUF_CHOICE_VARIANT("name", m_string, STD, (string));
190  ADD_NAMED_BUF_CHOICE_VARIANT("tsub", m_string, STD, (string));
191  ADD_NAMED_BUF_CHOICE_VARIANT("trans", m_string, STD, (string));
192  ADD_NAMED_BUF_CHOICE_VARIANT("jta", m_string, STD, (string));
193  ADD_NAMED_BUF_CHOICE_VARIANT("iso-jta", m_string, STD, (string));
194  ADD_NAMED_BUF_CHOICE_VARIANT("ml-jta", m_string, STD, (string));
195  ADD_NAMED_BUF_CHOICE_VARIANT("coden", m_string, STD, (string));
196  ADD_NAMED_BUF_CHOICE_VARIANT("issn", m_string, STD, (string));
197  ADD_NAMED_BUF_CHOICE_VARIANT("abr", m_string, STD, (string));
198  ADD_NAMED_BUF_CHOICE_VARIANT("isbn", m_string, STD, (string));
199  info->CodeVersion(22400);
200  info->DataSpec(ncbi::EDataSpec::eASN);
201 }
203 
204 // constructor
206  : m_choice(e_not_set)
207 {
208 }
209 
210 // destructor
212 {
213  Reset();
214 }
215 
216 
218 {
219  m_data.clear();
220  m_set_State[0] &= ~0x3;
221 }
222 
224 {
225  SET_CLASS_MODULE("NCBI-Biblio");
226  ADD_NAMED_MEMBER("", m_data, STL_list_set, (STL_CRef, (CLASS, (C_E))))->SetSetFlag(MEMBER_PTR(m_set_State[0]));
227  info->RandomOrder();
228  info->CodeVersion(22400);
229  info->DataSpec(ncbi::EDataSpec::eASN);
230 }
232 
233 // constructor
235 {
236  memset(m_set_State,0,sizeof(m_set_State));
237 }
238 
239 // destructor
241 {
242 }
243 
244 
245 
246 END_objects_SCOPE // namespace ncbi::objects::
247 
249 
C_E –.
Definition: Title_.hpp:96
Definition: Title.hpp:51
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 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
@ eDoNotResetVariant
Definition: serialbase.hpp:78
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
TIsbn & SetIsbn(void)
Select the variant.
Definition: Title_.hpp:762
TTsub & SetTsub(void)
Select the variant.
Definition: Title_.hpp:602
E_Choice m_choice
Definition: Title_.hpp:465
TJta & SetJta(void)
Select the variant.
Definition: Title_.hpp:642
static const char *const sm_SelectionNames[]
Definition: Title_.hpp:469
list< CRef< C_E > > m_data
Definition: Title_.hpp:527
TMl_jta & SetMl_jta(void)
Select the variant.
Definition: Title_.hpp:682
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: Title_.cpp:56
TTrans & SetTrans(void)
Select the variant.
Definition: Title_.hpp:622
TIssn & SetIssn(void)
Select the variant.
Definition: Title_.hpp:722
void Reset(void)
Reset data member.
Definition: Title_.cpp:217
TIso_jta & SetIso_jta(void)
Select the variant.
Definition: Title_.hpp:662
virtual ~CTitle_Base(void)
Definition: Title_.cpp:240
string TIso_jta
Definition: Title_.hpp:179
E_Choice
Choice variants.
Definition: Title_.hpp:109
TName & SetName(void)
Select the variant.
Definition: Title_.hpp:582
TAbr & SetAbr(void)
Select the variant.
Definition: Title_.hpp:742
TCoden & SetCoden(void)
Select the variant.
Definition: Title_.hpp:702
void Reset(void)
Reset the whole object.
Definition: Title_.cpp:50
Uint4 m_set_State[1]
Definition: Title_.hpp:526
string TMl_jta
Definition: Title_.hpp:180
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: Title_.cpp:77
CTitle_Base(void)
Definition: Title_.cpp:234
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Title_.cpp:112
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: Title_.cpp:117
@ e_not_set
No variant selected.
Definition: Title_.hpp:110
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
BEGIN_NAMED_CHOICE_INFO("", CTitle_Base::C_E)
Definition: Title_.cpp:185
BEGIN_NAMED_BASE_IMPLICIT_CLASS_INFO("Title", CTitle)
Definition: Title_.cpp:223
Modified on Fri May 24 14:56:30 2024 by modify_doxy.py rev. 669887