NCBI C++ ToolKit
ArticleId_.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 ArticleId_.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_ARTICLEID_BASE_HPP
42 #define eutils__OBJTOOLS_EUTILS_EFETCH_ARTICLEID_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 /// CArticleId_Base --
68 ///
69 
70 class CArticleId_Base : public NCBI_NS_NCBI::CSerialObject
71 {
72  typedef NCBI_NS_NCBI::CSerialObject Tparent;
73 public:
74  // constructor
76  // destructor
77  virtual ~CArticleId_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 
112  };
113 
114  /// Access to EAttlist_IdType's attributes (values, names) as defined in spec
115  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_IdType)(void);
116 
117  // types
119 
120  // member index
121  enum class E_memberIndex {
122  e__allMandatory = 0,
123  e_IdType
124  };
126 
127  // getters
128  // setters
129 
130  /// Check if a value has been assigned to IdType data member.
131  ///
132  /// Data member IdType is optional with default eAttlist_IdType_pubmed;
133  /// its type is defined as 'typedef EAttlist_IdType TIdType'
134  /// @return
135  /// - true, if a value has been assigned.
136  /// - false, otherwise.
137  bool IsSetIdType(void) const;
138 
139  /// Check if it is safe to call GetIdType method.
140  ///
141  /// @return
142  /// - true, if the data member is getatable.
143  /// - false, otherwise.
144  bool CanGetIdType(void) const;
145 
146  /// Reset IdType data member.
147  void ResetIdType(void);
148 
149  /// Assign default value to IdType data member.
150  void SetDefaultIdType(void);
151 
152  /// Get the IdType member data.
153  ///
154  /// @return
155  /// Copy of the member data.
156  TIdType GetIdType(void) const;
157 
158  /// Assign a value to IdType data member.
159  ///
160  /// @param value
161  /// Value to assign
162  void SetIdType(TIdType value);
163 
164  /// Assign a value to IdType data member.
165  ///
166  /// @return
167  /// Reference to the data value.
168  TIdType& SetIdType(void);
169 
170  /// Reset the whole object
171  void Reset(void);
172 
173 
174  private:
175  // Prohibit copy constructor and assignment operator
178 
179  // data
182  };
183  // types
186 
187  // member index
188  enum class E_memberIndex {
189  e__allMandatory = 0,
190  e_Attlist,
192  };
194 
195  // getters
196  // setters
197 
198  /// Check if a value has been assigned to Attlist data member.
199  ///
200  /// Data member Attlist is mandatory;
201  /// its type is defined as 'typedef C_Attlist TAttlist'
202  /// @return
203  /// - true, if a value has been assigned.
204  /// - false, otherwise.
205  bool IsSetAttlist(void) const;
206 
207  /// Check if it is safe to call GetAttlist method.
208  ///
209  /// @return
210  /// - true, if the data member is getatable.
211  /// - false, otherwise.
212  bool CanGetAttlist(void) const;
213 
214  /// Reset Attlist data member.
215  void ResetAttlist(void);
216 
217  /// Get the Attlist member data.
218  ///
219  /// @return
220  /// Reference to the member data.
221  const TAttlist& GetAttlist(void) const;
222 
223  /// Assign a value to Attlist data member.
224  ///
225  /// @param value
226  /// Reference to value.
227  void SetAttlist(TAttlist& value);
228 
229  /// Assign a value to Attlist data member.
230  ///
231  /// @return
232  /// Reference to the data value.
233  TAttlist& SetAttlist(void);
234 
235  /// Check if a value has been assigned to ArticleId data member.
236  ///
237  /// Data member ArticleId is mandatory;
238  /// its type is defined as 'typedef NCBI_NS_STD::string TArticleId'
239  /// @return
240  /// - true, if a value has been assigned.
241  /// - false, otherwise.
242  bool IsSetArticleId(void) const;
243 
244  /// Check if it is safe to call GetArticleId method.
245  ///
246  /// @return
247  /// - true, if the data member is getatable.
248  /// - false, otherwise.
249  bool CanGetArticleId(void) const;
250 
251  /// Reset ArticleId data member.
252  void ResetArticleId(void);
253 
254  /// Get the ArticleId member data.
255  ///
256  /// @return
257  /// Reference to the member data.
258  const TArticleId& GetArticleId(void) const;
259 
260  /// Assign a value to ArticleId data member.
261  ///
262  /// @param value
263  /// Value to assign
264  void SetArticleId(const TArticleId& value);
265  void SetArticleId(TArticleId&& value);
266 
267  /// Assign a value to ArticleId data member.
268  ///
269  /// @return
270  /// Reference to the data value.
271  TArticleId& SetArticleId(void);
272 
273  /// Reset the whole object
274  virtual void Reset(void);
275 
276 
277 private:
278  // Prohibit copy constructor and assignment operator
281 
282  // data
284  NCBI_NS_NCBI::CRef< TAttlist > m_Attlist;
286 };
287 
288 /* @} */
289 
290 
291 
292 
293 
294 ///////////////////////////////////////////////////////////
295 ///////////////////// inline methods //////////////////////
296 ///////////////////////////////////////////////////////////
297 inline
299 {
300  return ((m_set_State[0] & 0x3) != 0);
301 }
302 
303 inline
305 {
306  return true;
307 }
308 
309 inline
311 {
312  m_IdType = eAttlist_IdType_pubmed;
313  m_set_State[0] &= ~0x3;
314 }
315 
316 inline
318 {
319  ResetIdType();
320  m_set_State[0] |= 0x1;
321 }
322 
323 inline
325 {
326  return m_IdType;
327 }
328 
329 inline
331 {
332  m_IdType = value;
333  m_set_State[0] |= 0x3;
334 }
335 
336 inline
338 {
339 #ifdef _DEBUG
340  if (!IsSetIdType()) {
341  memset(&m_IdType,UnassignedByte(),sizeof(m_IdType));
342  }
343 #endif
344  m_set_State[0] |= 0x1;
345  return m_IdType;
346 }
347 
348 inline
350 {
351  return m_Attlist.NotEmpty();
352 }
353 
354 inline
356 {
357  return true;
358 }
359 
360 inline
362 {
363  if ( !m_Attlist ) {
364  const_cast<CArticleId_Base*>(this)->ResetAttlist();
365  }
366  return (*m_Attlist);
367 }
368 
369 inline
371 {
372  if ( !m_Attlist ) {
373  ResetAttlist();
374  }
375  return (*m_Attlist);
376 }
377 
378 inline
380 {
381  return ((m_set_State[0] & 0xc) != 0);
382 }
383 
384 inline
386 {
387  return IsSetArticleId();
388 }
389 
390 inline
392 {
393  if (!CanGetArticleId()) {
394  ThrowUnassigned(1);
395  }
396  return m_ArticleId;
397 }
398 
399 inline
401 {
402  m_ArticleId = value;
403  m_set_State[0] |= 0xc;
404 }
405 
406 inline
408 {
409  m_ArticleId = std::forward<CArticleId_Base::TArticleId>(value);
410  m_set_State[0] |= 0xc;
411 }
412 
413 inline
415 {
416 #ifdef _DEBUG
417  if (!IsSetArticleId()) {
419  }
420 #endif
421  m_set_State[0] |= 0x4;
422  return m_ArticleId;
423 }
424 
425 ///////////////////////////////////////////////////////////
426 ////////////////// end of inline methods //////////////////
427 ///////////////////////////////////////////////////////////
428 
429 
430 
431 
432 
433 END_eutils_SCOPE // namespace eutils::
434 
435 
436 #endif // eutils__OBJTOOLS_EUTILS_EFETCH_ARTICLEID_BASE_HPP
Article Ids can be many ids for an article.
Definition: ArticleId_.hpp:85
string
Definition: cgiapp.hpp:687
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
static string UnassignedString(void)
Definition: serialbase.hpp:175
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
void ResetIdType(void)
Reset IdType data member.
Definition: ArticleId_.hpp:310
NCBI_NS_NCBI::CSerialObject Tparent
Definition: ArticleId_.hpp:72
NCBI_NS_STD::string TArticleId
Definition: ArticleId_.hpp:185
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
Definition: ArticleId_.hpp:193
void ResetAttlist(void)
Reset Attlist data member.
Definition: ArticleId_.cpp:96
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
Definition: ArticleId_.hpp:349
TIdType GetIdType(void) const
Get the IdType member data.
Definition: ArticleId_.hpp:324
TIdType & SetIdType(void)
Assign a value to IdType data member.
Definition: ArticleId_.hpp:337
C_Attlist(const C_Attlist &)
const TArticleId & GetArticleId(void) const
Get the ArticleId member data.
Definition: ArticleId_.hpp:391
void SetDefaultIdType(void)
Assign default value to IdType data member.
Definition: ArticleId_.hpp:317
CArticleId_Base(const CArticleId_Base &)
bool CanGetArticleId(void) const
Check if it is safe to call GetArticleId method.
Definition: ArticleId_.hpp:385
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
Definition: ArticleId_.hpp:125
EAttlist_IdType m_IdType
Definition: ArticleId_.hpp:181
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
Definition: ArticleId_.hpp:370
NCBI_NS_STD::string m_ArticleId
Definition: ArticleId_.hpp:285
NCBI_NS_NCBI::CRef< TAttlist > m_Attlist
Definition: ArticleId_.hpp:284
bool IsSetArticleId(void) const
Check if a value has been assigned to ArticleId data member.
Definition: ArticleId_.hpp:379
Uint4 m_set_State[1]
Definition: ArticleId_.hpp:283
bool CanGetIdType(void) const
Check if it is safe to call GetIdType method.
Definition: ArticleId_.hpp:304
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
Definition: ArticleId_.hpp:355
C_Attlist TAttlist
Definition: ArticleId_.hpp:184
virtual ~CArticleId_Base(void)
TArticleId & SetArticleId(void)
Assign a value to ArticleId data member.
Definition: ArticleId_.hpp:414
void Reset(void)
Reset the whole object.
Definition: ArticleId_.cpp:67
NCBI_NS_NCBI::CSerialObject Tparent
Definition: ArticleId_.hpp:89
void ResetArticleId(void)
Reset ArticleId data member.
Definition: ArticleId_.cpp:110
bool IsSetIdType(void) const
Check if a value has been assigned to IdType data member.
Definition: ArticleId_.hpp:298
C_Attlist & operator=(const C_Attlist &)
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
Definition: ArticleId_.hpp:361
CArticleId_Base & operator=(const CArticleId_Base &)
virtual void Reset(void)
Reset the whole object.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define BEGIN_eutils_SCOPE
Definition: ArticleId_.hpp:51
#define END_eutils_SCOPE
Definition: ArticleId_.hpp:52
Modified on Wed Sep 04 15:01:47 2024 by modify_doxy.py rev. 669887