NCBI C++ ToolKit
PMID_.hpp
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  */
27 
28 /// @file PMID_.hpp
29 /// Data storage class.
30 ///
31 /// This file was generated by application DATATOOL
32 /// using the following specifications:
33 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/efetch/efetch.xsd">efetch.xsd</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objtools/eutils/efetch/efetch.def">efetch.def</a>
36 ///
37 /// ATTENTION:
38 /// Don't edit or commit this file into CVS as this file will
39 /// be overridden (by DATATOOL) without warning!
40 
41 #ifndef eutils__OBJTOOLS_EUTILS_EFETCH_PMID_BASE_HPP
42 #define eutils__OBJTOOLS_EUTILS_EFETCH_PMID_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
50 #ifndef BEGIN_eutils_SCOPE
51 # define BEGIN_eutils_SCOPE BEGIN_SCOPE(eutils)
52 # define END_eutils_SCOPE END_SCOPE(eutils)
53 #endif
54 BEGIN_eutils_SCOPE // namespace eutils::
55 
56 
57 // generated classes
58 
59 
60 /** @addtogroup dataspec_efetch
61  *
62  * @{
63  */
64 
65 /////////////////////////////////////////////////////////////////////////////
66 ///
67 /// CPMID_Base --
68 ///
69 
70 class CPMID_Base : public NCBI_NS_NCBI::CSerialObject
71 {
72  typedef NCBI_NS_NCBI::CSerialObject Tparent;
73 public:
74  // constructor
75  CPMID_Base(void);
76  // destructor
77  virtual ~CPMID_Base(void);
78 
79  // type info
81 
82  /////////////////////////////////////////////////////////////////////////////
83  ///
84  /// C_Attlist --
85  ///
86 
87  class C_Attlist : public NCBI_NS_NCBI::CSerialObject
88  {
89  typedef NCBI_NS_NCBI::CSerialObject Tparent;
90  public:
91  // constructor
92  C_Attlist(void);
93  // destructor
94  ~C_Attlist(void);
95 
96  // type info
98 
99  // types
101 
102  // member index
103  enum class E_memberIndex {
104  e__allMandatory = 0,
105  e_Version
106  };
107  typedef Tparent::CMemberIndex<E_memberIndex, 2> TmemberIndex;
108 
109  // getters
110  // setters
111 
112  /// Check if a value has been assigned to Version data member.
113  ///
114  /// Data member Version is mandatory;
115  /// its type is defined as 'typedef NCBI_NS_STD::string TVersion'
116  /// @return
117  /// - true, if a value has been assigned.
118  /// - false, otherwise.
119  bool IsSetVersion(void) const;
120 
121  /// Check if it is safe to call GetVersion method.
122  ///
123  /// @return
124  /// - true, if the data member is getatable.
125  /// - false, otherwise.
126  bool CanGetVersion(void) const;
127 
128  /// Reset Version data member.
129  void ResetVersion(void);
130 
131  /// Get the Version member data.
132  ///
133  /// @return
134  /// Reference to the member data.
135  const TVersion& GetVersion(void) const;
136 
137  /// Assign a value to Version data member.
138  ///
139  /// @param value
140  /// Value to assign
141  void SetVersion(const TVersion& value);
142  void SetVersion(TVersion&& value);
143 
144  /// Assign a value to Version data member.
145  ///
146  /// @return
147  /// Reference to the data value.
148  TVersion& SetVersion(void);
149 
150  /// Reset the whole object
151  void Reset(void);
152 
153 
154  private:
155  // Prohibit copy constructor and assignment operator
158 
159  // data
162  };
163  // types
166 
167  // member index
168  enum class E_memberIndex {
169  e__allMandatory = 0,
170  e_Attlist,
171  e_PMID
172  };
173  typedef Tparent::CMemberIndex<E_memberIndex, 3> TmemberIndex;
174 
175  // getters
176  // setters
177 
178  /// Check if a value has been assigned to Attlist data member.
179  ///
180  /// Data member Attlist is mandatory;
181  /// its type is defined as 'typedef C_Attlist TAttlist'
182  /// @return
183  /// - true, if a value has been assigned.
184  /// - false, otherwise.
185  bool IsSetAttlist(void) const;
186 
187  /// Check if it is safe to call GetAttlist method.
188  ///
189  /// @return
190  /// - true, if the data member is getatable.
191  /// - false, otherwise.
192  bool CanGetAttlist(void) const;
193 
194  /// Reset Attlist data member.
195  void ResetAttlist(void);
196 
197  /// Get the Attlist member data.
198  ///
199  /// @return
200  /// Reference to the member data.
201  const TAttlist& GetAttlist(void) const;
202 
203  /// Assign a value to Attlist data member.
204  ///
205  /// @param value
206  /// Reference to value.
207  void SetAttlist(TAttlist& value);
208 
209  /// Assign a value to Attlist data member.
210  ///
211  /// @return
212  /// Reference to the data value.
213  TAttlist& SetAttlist(void);
214 
215  /// Check if a value has been assigned to PMID data member.
216  ///
217  /// Data member PMID is mandatory;
218  /// its type is defined as 'typedef NCBI_NS_STD::string TPMID'
219  /// @return
220  /// - true, if a value has been assigned.
221  /// - false, otherwise.
222  bool IsSetPMID(void) const;
223 
224  /// Check if it is safe to call GetPMID method.
225  ///
226  /// @return
227  /// - true, if the data member is getatable.
228  /// - false, otherwise.
229  bool CanGetPMID(void) const;
230 
231  /// Reset PMID data member.
232  void ResetPMID(void);
233 
234  /// Get the PMID member data.
235  ///
236  /// @return
237  /// Reference to the member data.
238  const TPMID& GetPMID(void) const;
239 
240  /// Assign a value to PMID data member.
241  ///
242  /// @param value
243  /// Value to assign
244  void SetPMID(const TPMID& value);
245  void SetPMID(TPMID&& value);
246 
247  /// Assign a value to PMID data member.
248  ///
249  /// @return
250  /// Reference to the data value.
251  TPMID& SetPMID(void);
252 
253  /// Reset the whole object
254  virtual void Reset(void);
255 
256 
257 private:
258  // Prohibit copy constructor and assignment operator
261 
262  // data
264  NCBI_NS_NCBI::CRef< TAttlist > m_Attlist;
266 };
267 
268 /* @} */
269 
270 
271 
272 
273 
274 ///////////////////////////////////////////////////////////
275 ///////////////////// inline methods //////////////////////
276 ///////////////////////////////////////////////////////////
277 inline
279 {
280  return ((m_set_State[0] & 0x3) != 0);
281 }
282 
283 inline
285 {
286  return IsSetVersion();
287 }
288 
289 inline
291 {
292  if (!CanGetVersion()) {
293  ThrowUnassigned(0);
294  }
295  return m_Version;
296 }
297 
298 inline
300 {
301  m_Version = value;
302  m_set_State[0] |= 0x3;
303 }
304 
305 inline
307 {
308  m_Version = std::forward<CPMID_Base::C_Attlist::TVersion>(value);
309  m_set_State[0] |= 0x3;
310 }
311 
312 inline
314 {
315 #ifdef _DEBUG
316  if (!IsSetVersion()) {
317  m_Version = UnassignedString();
318  }
319 #endif
320  m_set_State[0] |= 0x1;
321  return m_Version;
322 }
323 
324 inline
325 bool CPMID_Base::IsSetAttlist(void) const
326 {
327  return m_Attlist.NotEmpty();
328 }
329 
330 inline
332 {
333  return true;
334 }
335 
336 inline
338 {
339  if ( !m_Attlist ) {
340  const_cast<CPMID_Base*>(this)->ResetAttlist();
341  }
342  return (*m_Attlist);
343 }
344 
345 inline
347 {
348  if ( !m_Attlist ) {
349  ResetAttlist();
350  }
351  return (*m_Attlist);
352 }
353 
354 inline
355 bool CPMID_Base::IsSetPMID(void) const
356 {
357  return ((m_set_State[0] & 0xc) != 0);
358 }
359 
360 inline
361 bool CPMID_Base::CanGetPMID(void) const
362 {
363  return IsSetPMID();
364 }
365 
366 inline
368 {
369  if (!CanGetPMID()) {
370  ThrowUnassigned(1);
371  }
372  return m_PMID;
373 }
374 
375 inline
377 {
378  m_PMID = value;
379  m_set_State[0] |= 0xc;
380 }
381 
382 inline
384 {
385  m_PMID = std::forward<CPMID_Base::TPMID>(value);
386  m_set_State[0] |= 0xc;
387 }
388 
389 inline
391 {
392 #ifdef _DEBUG
393  if (!IsSetPMID()) {
394  m_PMID = UnassignedString();
395  }
396 #endif
397  m_set_State[0] |= 0x4;
398  return m_PMID;
399 }
400 
401 ///////////////////////////////////////////////////////////
402 ////////////////// end of inline methods //////////////////
403 ///////////////////////////////////////////////////////////
404 
405 
406 
407 
408 
409 END_eutils_SCOPE // namespace eutils::
410 
411 
412 #endif // eutils__OBJTOOLS_EUTILS_EFETCH_PMID_BASE_HPP
#define BEGIN_eutils_SCOPE
Definition: PMID_.hpp:51
#define END_eutils_SCOPE
Definition: PMID_.hpp:52
C_Attlist –.
Definition: PMID_.hpp:88
CPMID_Base –.
Definition: PMID_.hpp:71
string
Definition: cgiapp.hpp:687
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
C_Attlist TAttlist
Definition: PMID_.hpp:164
CPMID_Base(void)
Definition: PMID_.cpp:121
bool CanGetVersion(void) const
Check if it is safe to call GetVersion method.
Definition: PMID_.hpp:284
C_Attlist & operator=(const C_Attlist &)
NCBI_NS_NCBI::CSerialObject Tparent
Definition: PMID_.hpp:72
const TPMID & GetPMID(void) const
Get the PMID member data.
Definition: PMID_.hpp:367
NCBI_NS_NCBI::CSerialObject Tparent
Definition: PMID_.hpp:89
void ResetVersion(void)
Reset Version data member.
Definition: PMID_.cpp:48
C_Attlist(const C_Attlist &)
void Reset(void)
Reset the whole object.
Definition: PMID_.cpp:54
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
Definition: PMID_.hpp:346
bool CanGetPMID(void) const
Check if it is safe to call GetPMID method.
Definition: PMID_.hpp:361
NCBI_NS_STD::string m_Version
Definition: PMID_.hpp:161
virtual void Reset(void)
Reset the whole object.
Definition: PMID_.cpp:102
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
Definition: PMID_.hpp:337
TPMID & SetPMID(void)
Assign a value to PMID data member.
Definition: PMID_.hpp:390
const TVersion & GetVersion(void) const
Get the Version member data.
Definition: PMID_.hpp:290
CPMID_Base(const CPMID_Base &)
Uint4 m_set_State[1]
Definition: PMID_.hpp:160
NCBI_NS_STD::string TPMID
Definition: PMID_.hpp:165
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
Definition: PMID_.hpp:325
NCBI_NS_NCBI::CRef< TAttlist > m_Attlist
Definition: PMID_.hpp:264
Uint4 m_set_State[1]
Definition: PMID_.hpp:263
TVersion & SetVersion(void)
Assign a value to Version data member.
Definition: PMID_.hpp:313
bool IsSetPMID(void) const
Check if a value has been assigned to PMID data member.
Definition: PMID_.hpp:355
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: PMID_.hpp:173
virtual ~CPMID_Base(void)
Definition: PMID_.cpp:130
void ResetPMID(void)
Reset PMID data member.
Definition: PMID_.cpp:96
NCBI_NS_STD::string m_PMID
Definition: PMID_.hpp:265
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
Definition: PMID_.hpp:331
NCBI_NS_STD::string TVersion
Definition: PMID_.hpp:100
DECLARE_INTERNAL_TYPE_INFO()
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
Definition: PMID_.hpp:278
void ResetAttlist(void)
Reset Attlist data member.
Definition: PMID_.cpp:82
CPMID_Base & operator=(const CPMID_Base &)
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
Definition: PMID_.hpp:107
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 29 18:41:49 2024 by modify_doxy.py rev. 669887