NCBI C++ ToolKit
DomainQ_.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  * 'pubmed_mathml3.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
48 
49 BEGIN_objects_SCOPE // namespace ncbi::objects::
50 
51 
52 // generated classes
53 
55 {
56  if ( !m_Lowlimit ) {
57  m_Lowlimit.Reset(new TLowlimit());
58  return;
59  }
60  (*m_Lowlimit).Reset();
61 }
62 
64 {
65  m_Lowlimit.Reset(&value);
66 }
67 
69 {
70  m_Uplimit.Reset();
71 }
72 
74 {
75  m_Uplimit.Reset(&value);
76 }
77 
79 {
80  if ( !m_Uplimit )
81  m_Uplimit.Reset(new TUplimit());
82  return (*m_Uplimit);
83 }
84 
86 {
87  ResetLowlimit();
88  ResetUplimit();
89 }
90 
92 {
93  SET_INTERNAL_NAME("DomainQ.E", "LU");
94  SET_CLASS_MODULE("pubmed_mathml3");
95  ADD_NAMED_REF_MEMBER("lowlimit", m_Lowlimit, CLowlimit)->SetNsQualified(true);
96  ADD_NAMED_REF_MEMBER("uplimit", m_Uplimit, CUplimit)->SetOptional()->SetNsQualified(true);
97  info->RandomOrder();
98  info->CodeVersion(22400);
99  info->DataSpec(ncbi::EDataSpec::eXSD);
100 }
102 
103 // constructor
105 {
106  memset(m_set_State,0,sizeof(m_set_State));
107  if ( !IsAllocatedInPool() ) {
108  ResetLowlimit();
109  }
110 }
111 
112 // destructor
114 {
115 }
116 
117 
119 {
120  if ( m_choice != e_not_set )
121  ResetSelection();
122 }
123 
125 {
126  switch ( m_choice ) {
128  case e_Condition:
129  case e_LU:
130  m_object->RemoveReference();
131  break;
132  default:
133  break;
134  }
136 }
137 
138 void CDomainQ_Base::C_E::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
139 {
140  switch ( index ) {
142  (m_object = new(pool) ncbi::objects::CDomainofapplication())->AddReference();
143  break;
144  case e_Condition:
145  (m_object = new(pool) ncbi::objects::CCondition())->AddReference();
146  break;
147  case e_LU:
148  (m_object = new(pool) C_LU())->AddReference();
149  break;
150  default:
151  break;
152  }
153  m_choice = index;
154 }
155 
156 const char* const CDomainQ_Base::C_E::sm_SelectionNames[] = {
157  "not set",
158  "domainofapplication",
159  "condition",
160  "LU"
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 {
176  return *static_cast<const TDomainofapplication*>(m_object);
177 }
178 
180 {
182  return *static_cast<TDomainofapplication*>(m_object);
183 }
184 
186 {
187  TDomainofapplication* ptr = &value;
188  if ( m_choice != e_Domainofapplication || m_object != ptr ) {
189  ResetSelection();
190  (m_object = ptr)->AddReference();
192  }
193 }
194 
196 {
198  return *static_cast<const TCondition*>(m_object);
199 }
200 
202 {
204  return *static_cast<TCondition*>(m_object);
205 }
206 
208 {
209  TCondition* ptr = &value;
210  if ( m_choice != e_Condition || m_object != ptr ) {
211  ResetSelection();
212  (m_object = ptr)->AddReference();
214  }
215 }
216 
218 {
220  return *static_cast<const TLU*>(m_object);
221 }
222 
224 {
226  return *static_cast<TLU*>(m_object);
227 }
228 
230 {
231  TLU* ptr = &value;
232  if ( m_choice != e_LU || m_object != ptr ) {
233  ResetSelection();
234  (m_object = ptr)->AddReference();
235  m_choice = e_LU;
236  }
237 }
238 
239 // helper methods
240 
241 // type info
243 {
244  SET_INTERNAL_NAME("DomainQ", "E");
245  SET_CHOICE_MODULE("pubmed_mathml3");
246  ADD_NAMED_REF_CHOICE_VARIANT("domainofapplication", m_object, CDomainofapplication)->SetNsQualified(true);
247  ADD_NAMED_REF_CHOICE_VARIANT("condition", m_object, CCondition)->SetNsQualified(true);
248  ADD_NAMED_REF_CHOICE_VARIANT("LU", m_object, C_LU)->SetNotag();
249  info->CodeVersion(22400);
250  info->DataSpec(ncbi::EDataSpec::eXSD);
251 }
253 
254 // constructor
257 {
258 }
259 
260 // destructor
262 {
263  Reset();
264 }
265 
266 
268 {
269  m_data.clear();
270  m_set_State[0] &= ~0x3;
271 }
272 
274 {
275  SET_CLASS_MODULE("pubmed_mathml3");
276  SET_NAMESPACE("http://www.w3.org/1998/Math/MathML")->SetNsQualified(false);
277  ADD_NAMED_MEMBER("", m_data, STL_list, (STL_CRef, (CLASS, (C_E))))->SetSetFlag(MEMBER_PTR(m_set_State[0]));
278  info->RandomOrder();
279  info->CodeVersion(22400);
280  info->DataSpec(ncbi::EDataSpec::eXSD);
281 }
283 
284 // constructor
286 {
287  memset(m_set_State,0,sizeof(m_set_State));
288 }
289 
290 // destructor
292 {
293 }
294 
295 
296 
297 END_objects_SCOPE // namespace ncbi::objects::
298 
300 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
BEGIN_NAMED_BASE_IMPLICIT_CLASS_INFO("", CDomainQ)
Definition: DomainQ_.cpp:273
BEGIN_NAMED_CLASS_INFO("", CDomainQ_Base::C_E::C_LU)
Definition: DomainQ_.cpp:91
BEGIN_NAMED_CHOICE_INFO("", CDomainQ_Base::C_E)
Definition: DomainQ_.cpp:242
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
CCondition –.
Definition: Condition.hpp:66
CDomainQ –.
Definition: DomainQ.hpp:66
CDomainofapplication –.
CLowlimit –.
Definition: Lowlimit.hpp:66
CUplimit –.
Definition: Uplimit.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 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 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
@ 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
CDomainQ_Base(void)
Definition: DomainQ_.cpp:285
virtual void Reset(void)
Reset the whole object.
Definition: ContExp_.cpp:4748
static const char *const sm_SelectionNames[]
Definition: DomainQ_.hpp:384
void ResetSelection(void)
Reset the selection (set it to e_not_set).
Definition: DomainQ_.cpp:124
Uint4 m_set_State[1]
Definition: DomainQ_.hpp:438
NCBI_NS_NCBI::CSerialObject * m_object
Definition: DomainQ_.hpp:386
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: DomainQ_.cpp:163
const TLU & GetLU(void) const
Get the variant data.
Definition: DomainQ_.cpp:217
void ResetUplimit(void)
Reset Uplimit data member.
Definition: DomainQ_.cpp:68
const TDomainofapplication & GetDomainofapplication(void) const
Get the variant data.
Definition: DomainQ_.cpp:173
void Reset(void)
Reset data member.
Definition: DomainQ_.cpp:267
void ResetLowlimit(void)
Reset Lowlimit data member.
Definition: DomainQ_.cpp:54
CRef< TLowlimit > m_Lowlimit
Definition: DomainQ_.hpp:225
void Reset(void)
Reset the whole object.
Definition: DomainQ_.cpp:85
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
TCondition & SetCondition(void)
Select the variant.
Definition: DomainQ_.cpp:201
virtual ~CDomainQ_Base(void)
Definition: DomainQ_.cpp:291
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
Definition: DomainQ_.cpp:168
list< CRef< C_E > > m_data
Definition: DomainQ_.hpp:439
E_Choice
Choice variants.
Definition: DomainQ_.hpp:230
TLU & SetLU(void)
Select the variant.
Definition: DomainQ_.cpp:223
TDomainofapplication & SetDomainofapplication(void)
Select the variant.
Definition: DomainQ_.cpp:179
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
Definition: DomainQ_.cpp:138
void Reset(void)
Reset the whole object.
Definition: DomainQ_.cpp:118
const TCondition & GetCondition(void) const
Get the variant data.
Definition: DomainQ_.cpp:195
TUplimit & SetUplimit(void)
Assign a value to Uplimit data member.
Definition: DomainQ_.cpp:78
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
Definition: DomainQ_.hpp:509
TLowlimit & SetLowlimit(void)
Assign a value to Lowlimit data member.
Definition: DomainQ_.hpp:473
@ e_not_set
No variant selected.
Definition: DomainQ_.hpp:231
static MDB_envinfo info
Definition: mdb_load.c:37
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Jul 24 17:20:17 2024 by modify_doxy.py rev. 669887