NCBI C++ ToolKit
SectionTitle_.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  * 'efetch.xsd'.
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
43 BEGIN_eutils_SCOPE // namespace eutils::
44 
45 
46 // generated classes
47 
49 {
50  m_Book.erase();
51  m_set_State[0] &= ~0x3;
52 }
53 
55 {
56  m_Part.erase();
57  m_set_State[0] &= ~0xc;
58 }
59 
61 {
62  m_Sec.erase();
63  m_set_State[0] &= ~0x30;
64 }
65 
67 {
68  ResetBook();
69  ResetPart();
70  ResetSec();
71 }
72 
74 {
75  SET_INTERNAL_NAME("SectionTitle", "Attlist");
76  SET_CLASS_MODULE("efetch");
77  ADD_NAMED_STD_MEMBER("book", m_Book)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional()->SetNsQualified(false);
78  ADD_NAMED_STD_MEMBER("part", m_Part)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional()->SetNsQualified(false);
79  ADD_NAMED_STD_MEMBER("sec", m_Sec)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional()->SetNsQualified(false);
80  info->SetRandomOrder(true);
81  info->CodeVersion(22301);
82  info->DataSpec(ncbi::EDataSpec::eXSD);
83 }
85 
86 // constructor
88 {
89  memset(m_set_State,0,sizeof(m_set_State));
90 }
91 
92 // destructor
94 {
95 }
96 
97 
99 {
100  if ( m_choice != e_not_set )
101  ResetSelection();
102 }
103 
105 {
106  switch ( m_choice ) {
107  case e__CharData:
108  m_string.Destruct();
109  break;
110  case e_Text:
111  m_object->RemoveReference();
112  break;
113  default:
114  break;
115  }
116  m_choice = e_not_set;
117 }
118 
119 void CSectionTitle_Base::C_E_SectionTitle::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
120 {
121  switch ( index ) {
122  case e_Text:
123  (m_object = new(pool) eutils::CText())->AddReference();
124  break;
125  case e__CharData:
126  m_string.Construct();
127  break;
128  default:
129  break;
130  }
131  m_choice = index;
132 }
133 
135  "not set",
136  "-CharData",
137  "text"
138 };
139 
141 {
142  return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
143 }
144 
146 {
147  throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
148 }
149 
151 {
152  Select(e__CharData, NCBI_NS_NCBI::eDoNotResetVariant);
153  *m_string = value;
154 }
155 
157 {
158  CheckSelected(e_Text);
159  return *static_cast<const TText*>(m_object);
160 }
161 
163 {
164  Select(e_Text, NCBI_NS_NCBI::eDoNotResetVariant);
165  return *static_cast<TText*>(m_object);
166 }
167 
169 {
170  TText* ptr = &value;
171  if ( m_choice != e_Text || m_object != ptr ) {
172  ResetSelection();
173  (m_object = ptr)->AddReference();
174  m_choice = e_Text;
175  }
176 }
177 
178 // helper methods
179 
180 // type info
182 {
183  SET_INTERNAL_NAME("SectionTitle.SectionTitle", "E");
184  SET_CHOICE_MODULE("efetch");
185  SET_NAMESPACE("http://www.ncbi.nlm.nih.gov")->SetNsQualified(true);
186  ADD_NAMED_BUF_CHOICE_VARIANT("-CharData", m_string, STD, (NCBI_NS_STD::string))->SetNotag();
187  ADD_NAMED_REF_CHOICE_VARIANT("text", m_object, C_Text)->SetNotag();
188  info->CodeVersion(22301);
189  info->DataSpec(ncbi::EDataSpec::eXSD);
190 }
192 
193 // constructor
195  : m_choice(e_not_set)
196 {
197 }
198 
199 // destructor
201 {
202  Reset();
203 }
204 
205 
207 {
208  if ( !m_Attlist ) {
209  m_Attlist.Reset(new TAttlist());
210  return;
211  }
212  (*m_Attlist).Reset();
213 }
214 
216 {
217  m_Attlist.Reset(&value);
218 }
219 
221 {
222  m_SectionTitle.clear();
223  m_set_State[0] &= ~0xc;
224 }
225 
227 {
228  ResetAttlist();
230 }
231 
233 {
234  SET_CLASS_MODULE("efetch");
235  SET_NAMESPACE("http://www.ncbi.nlm.nih.gov")->SetNsQualified(true);
236  ADD_NAMED_REF_MEMBER("Attlist", m_Attlist, C_Attlist)->SetAttlist();
237  ADD_NAMED_MEMBER("SectionTitle", m_SectionTitle, STL_list, (STL_CRef, (CLASS, (C_E_SectionTitle))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional()->SetNotag();
238  info->RandomOrder();
239  info->CodeVersion(22301);
240  info->DataSpec(ncbi::EDataSpec::eXSD);
241 }
243 
244 // constructor
246 {
247  memset(m_set_State,0,sizeof(m_set_State));
248  if ( !IsAllocatedInPool() ) {
249  ResetAttlist();
250  }
251 }
252 
253 // destructor
255 {
256 }
257 
258 
259 
260 END_eutils_SCOPE // namespace eutils::
261 
#define BEGIN_eutils_SCOPE
Definition: Abstract_.hpp:51
#define END_eutils_SCOPE
Definition: Abstract_.hpp:52
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_CLASS_INFO("SectionTitle", CSectionTitle)
BEGIN_NAMED_CHOICE_INFO("", CSectionTitle_Base::C_E_SectionTitle)
BEGIN_NAMED_CLASS_INFO("", CSectionTitle_Base::C_Attlist)
CSectionTitle –.
CText –.
Definition: Text.hpp:64
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 SET_NAMESPACE(name)
Definition: serialimpl.hpp:450
#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 ResetPart(void)
Reset Part data member.
T_CharData & Set_CharData(void)
Select the variant.
void Reset(void)
Reset the whole object.
virtual ~CSectionTitle_Base(void)
const TText & GetText(void) const
Get the variant data.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
void Reset(void)
Reset the whole object.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_E_SectionTitle > > m_SectionTitle
virtual void Reset(void)
Reset the whole object.
void ResetSec(void)
Reset Sec data member.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
static const char *const sm_SelectionNames[]
void ResetSectionTitle(void)
Reset SectionTitle data member.
NCBI_NS_NCBI::CRef< TAttlist > m_Attlist
TText & SetText(void)
Select the variant.
void DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool *pool=0)
void ResetBook(void)
Reset Book data member.
void ResetAttlist(void)
Reset Attlist data member.
static NCBI_NS_STD::string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
@ e_not_set
static MDB_envinfo info
Definition: mdb_load.c:37
Modified on Thu Dec 07 10:07:40 2023 by modify_doxy.py rev. 669887