NCBI C++ ToolKit
ArticleDate_.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 ArticleDate_.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_ARTICLEDATE_BASE_HPP
42 #define eutils__OBJTOOLS_EUTILS_EFETCH_ARTICLEDATE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 #ifndef BEGIN_eutils_SCOPE
47 # define BEGIN_eutils_SCOPE BEGIN_SCOPE(eutils)
48 # define END_eutils_SCOPE END_SCOPE(eutils)
49 #endif
50 BEGIN_eutils_SCOPE // namespace eutils::
51 
52 
53 // forward declarations
54 class CDay;
55 class CMonth;
56 class CYear;
57 
58 
59 // generated classes
60 
61 
62 /** @addtogroup dataspec_efetch
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CArticleDate_Base --
70 ///
71 
72 class CArticleDate_Base : public NCBI_NS_NCBI::CSerialObject
73 {
74  typedef NCBI_NS_NCBI::CSerialObject Tparent;
75 public:
76  // constructor
77  CArticleDate_Base(void);
78  // destructor
79  virtual ~CArticleDate_Base(void);
80 
81  // type info
83 
84  /////////////////////////////////////////////////////////////////////////////
85  ///
86  /// C_Attlist --
87  ///
88 
89  class C_Attlist : public NCBI_NS_NCBI::CSerialObject
90  {
91  typedef NCBI_NS_NCBI::CSerialObject Tparent;
92  public:
93  // constructor
94  C_Attlist(void);
95  // destructor
96  ~C_Attlist(void);
97 
98  // type info
100 
103  };
104 
105  /// Access to EAttlist_DateType's attributes (values, names) as defined in spec
106  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EAttlist_DateType)(void);
107 
108  // types
110 
111  // member index
112  enum class E_memberIndex {
113  e__allMandatory = 0,
114  e_DateType
115  };
116  typedef Tparent::CMemberIndex<E_memberIndex, 2> TmemberIndex;
117 
118  // getters
119  // setters
120 
121  /// Check if a value has been assigned to DateType data member.
122  ///
123  /// Data member DateType is optional with default eAttlist_DateType_Electronic;
124  /// its type is defined as 'typedef EAttlist_DateType TDateType'
125  /// @return
126  /// - true, if a value has been assigned.
127  /// - false, otherwise.
128  bool IsSetDateType(void) const;
129 
130  /// Check if it is safe to call GetDateType method.
131  ///
132  /// @return
133  /// - true, if the data member is getatable.
134  /// - false, otherwise.
135  bool CanGetDateType(void) const;
136 
137  /// Reset DateType data member.
138  void ResetDateType(void);
139 
140  /// Assign default value to DateType data member.
141  void SetDefaultDateType(void);
142 
143  /// Get the DateType member data.
144  ///
145  /// @return
146  /// Copy of the member data.
147  TDateType GetDateType(void) const;
148 
149  /// Assign a value to DateType data member.
150  ///
151  /// @param value
152  /// Value to assign
154 
155  /// Assign a value to DateType data member.
156  ///
157  /// @return
158  /// Reference to the data value.
159  TDateType& SetDateType(void);
160 
161  /// Reset the whole object
162  void Reset(void);
163 
164 
165  private:
166  // Prohibit copy constructor and assignment operator
169 
170  // data
173  };
174  // types
176  typedef CYear TYear;
177  typedef CMonth TMonth;
178  typedef CDay TDay;
179 
180  // member index
181  enum class E_memberIndex {
182  e__allMandatory = 0,
183  e_Attlist,
184  e_Year,
185  e_Month,
186  e_Day
187  };
188  typedef Tparent::CMemberIndex<E_memberIndex, 5> TmemberIndex;
189 
190  // getters
191  // setters
192 
193  /// Check if a value has been assigned to Attlist data member.
194  ///
195  /// Data member Attlist is mandatory;
196  /// its type is defined as 'typedef C_Attlist TAttlist'
197  /// @return
198  /// - true, if a value has been assigned.
199  /// - false, otherwise.
200  bool IsSetAttlist(void) const;
201 
202  /// Check if it is safe to call GetAttlist method.
203  ///
204  /// @return
205  /// - true, if the data member is getatable.
206  /// - false, otherwise.
207  bool CanGetAttlist(void) const;
208 
209  /// Reset Attlist data member.
210  void ResetAttlist(void);
211 
212  /// Get the Attlist member data.
213  ///
214  /// @return
215  /// Reference to the member data.
216  const TAttlist& GetAttlist(void) const;
217 
218  /// Assign a value to Attlist data member.
219  ///
220  /// @param value
221  /// Reference to value.
222  void SetAttlist(TAttlist& value);
223 
224  /// Assign a value to Attlist data member.
225  ///
226  /// @return
227  /// Reference to the data value.
228  TAttlist& SetAttlist(void);
229 
230  /// Check if a value has been assigned to Year data member.
231  ///
232  /// Data member Year is mandatory;
233  /// its type is defined as 'typedef CYear TYear'
234  /// @return
235  /// - true, if a value has been assigned.
236  /// - false, otherwise.
237  bool IsSetYear(void) const;
238 
239  /// Check if it is safe to call GetYear method.
240  ///
241  /// @return
242  /// - true, if the data member is getatable.
243  /// - false, otherwise.
244  bool CanGetYear(void) const;
245 
246  /// Reset Year data member.
247  void ResetYear(void);
248 
249  /// Get the Year member data.
250  ///
251  /// @return
252  /// Reference to the member data.
253  const TYear& GetYear(void) const;
254 
255  /// Assign a value to Year data member.
256  ///
257  /// @param value
258  /// Reference to value.
259  void SetYear(TYear& value);
260 
261  /// Assign a value to Year data member.
262  ///
263  /// @return
264  /// Reference to the data value.
265  TYear& SetYear(void);
266 
267  /// Check if a value has been assigned to Month data member.
268  ///
269  /// Data member Month is mandatory;
270  /// its type is defined as 'typedef CMonth TMonth'
271  /// @return
272  /// - true, if a value has been assigned.
273  /// - false, otherwise.
274  bool IsSetMonth(void) const;
275 
276  /// Check if it is safe to call GetMonth method.
277  ///
278  /// @return
279  /// - true, if the data member is getatable.
280  /// - false, otherwise.
281  bool CanGetMonth(void) const;
282 
283  /// Reset Month data member.
284  void ResetMonth(void);
285 
286  /// Get the Month member data.
287  ///
288  /// @return
289  /// Reference to the member data.
290  const TMonth& GetMonth(void) const;
291 
292  /// Assign a value to Month data member.
293  ///
294  /// @param value
295  /// Reference to value.
296  void SetMonth(TMonth& value);
297 
298  /// Assign a value to Month data member.
299  ///
300  /// @return
301  /// Reference to the data value.
302  TMonth& SetMonth(void);
303 
304  /// Check if a value has been assigned to Day data member.
305  ///
306  /// Data member Day is mandatory;
307  /// its type is defined as 'typedef CDay TDay'
308  /// @return
309  /// - true, if a value has been assigned.
310  /// - false, otherwise.
311  bool IsSetDay(void) const;
312 
313  /// Check if it is safe to call GetDay method.
314  ///
315  /// @return
316  /// - true, if the data member is getatable.
317  /// - false, otherwise.
318  bool CanGetDay(void) const;
319 
320  /// Reset Day data member.
321  void ResetDay(void);
322 
323  /// Get the Day member data.
324  ///
325  /// @return
326  /// Reference to the member data.
327  const TDay& GetDay(void) const;
328 
329  /// Assign a value to Day data member.
330  ///
331  /// @param value
332  /// Reference to value.
333  void SetDay(TDay& value);
334 
335  /// Assign a value to Day data member.
336  ///
337  /// @return
338  /// Reference to the data value.
339  TDay& SetDay(void);
340 
341  /// Reset the whole object
342  virtual void Reset(void);
343 
344 
345 private:
346  // Prohibit copy constructor and assignment operator
349 
350  // data
352  NCBI_NS_NCBI::CRef< TAttlist > m_Attlist;
353  NCBI_NS_NCBI::CRef< TYear > m_Year;
354  NCBI_NS_NCBI::CRef< TMonth > m_Month;
355  NCBI_NS_NCBI::CRef< TDay > m_Day;
356 };
357 
358 /* @} */
359 
360 
361 
362 
363 
364 ///////////////////////////////////////////////////////////
365 ///////////////////// inline methods //////////////////////
366 ///////////////////////////////////////////////////////////
367 inline
369 {
370  return ((m_set_State[0] & 0x3) != 0);
371 }
372 
373 inline
375 {
376  return true;
377 }
378 
379 inline
381 {
382  m_DateType = eAttlist_DateType_Electronic;
383  m_set_State[0] &= ~0x3;
384 }
385 
386 inline
388 {
389  ResetDateType();
390  m_set_State[0] |= 0x1;
391 }
392 
393 inline
395 {
396  return m_DateType;
397 }
398 
399 inline
401 {
402  m_DateType = value;
403  m_set_State[0] |= 0x3;
404 }
405 
406 inline
408 {
409 #ifdef _DEBUG
410  if (!IsSetDateType()) {
411  memset(&m_DateType,UnassignedByte(),sizeof(m_DateType));
412  }
413 #endif
414  m_set_State[0] |= 0x1;
415  return m_DateType;
416 }
417 
418 inline
420 {
421  return m_Attlist.NotEmpty();
422 }
423 
424 inline
426 {
427  return true;
428 }
429 
430 inline
432 {
433  if ( !m_Attlist ) {
434  const_cast<CArticleDate_Base*>(this)->ResetAttlist();
435  }
436  return (*m_Attlist);
437 }
438 
439 inline
441 {
442  if ( !m_Attlist ) {
443  ResetAttlist();
444  }
445  return (*m_Attlist);
446 }
447 
448 inline
450 {
451  return m_Year.NotEmpty();
452 }
453 
454 inline
456 {
457  return true;
458 }
459 
460 inline
462 {
463  if ( !m_Year ) {
464  const_cast<CArticleDate_Base*>(this)->ResetYear();
465  }
466  return (*m_Year);
467 }
468 
469 inline
471 {
472  if ( !m_Year ) {
473  ResetYear();
474  }
475  return (*m_Year);
476 }
477 
478 inline
480 {
481  return m_Month.NotEmpty();
482 }
483 
484 inline
486 {
487  return true;
488 }
489 
490 inline
492 {
493  if ( !m_Month ) {
494  const_cast<CArticleDate_Base*>(this)->ResetMonth();
495  }
496  return (*m_Month);
497 }
498 
499 inline
501 {
502  if ( !m_Month ) {
503  ResetMonth();
504  }
505  return (*m_Month);
506 }
507 
508 inline
510 {
511  return m_Day.NotEmpty();
512 }
513 
514 inline
516 {
517  return true;
518 }
519 
520 inline
522 {
523  if ( !m_Day ) {
524  const_cast<CArticleDate_Base*>(this)->ResetDay();
525  }
526  return (*m_Day);
527 }
528 
529 inline
531 {
532  if ( !m_Day ) {
533  ResetDay();
534  }
535  return (*m_Day);
536 }
537 
538 ///////////////////////////////////////////////////////////
539 ////////////////// end of inline methods //////////////////
540 ///////////////////////////////////////////////////////////
541 
542 
543 
544 
545 
546 END_eutils_SCOPE // namespace eutils::
547 
548 
549 #endif // eutils__OBJTOOLS_EUTILS_EFETCH_ARTICLEDATE_BASE_HPP
#define BEGIN_eutils_SCOPE
#define END_eutils_SCOPE
CArticleDate_Base –.
CDay –.
Definition: Day.hpp:64
CMonth –.
Definition: Month.hpp:64
CYear –.
Definition: Year.hpp:64
char value[7]
Definition: config.c:431
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
C_Attlist & operator=(const C_Attlist &)
TDay & SetDay(void)
Assign a value to Day data member.
const TAttlist & GetAttlist(void) const
Get the Attlist member data.
TMonth & SetMonth(void)
Assign a value to Month data member.
C_Attlist(const C_Attlist &)
NCBI_NS_NCBI::CRef< TYear > m_Year
bool CanGetMonth(void) const
Check if it is safe to call GetMonth method.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool IsSetMonth(void) const
Check if a value has been assigned to Month data member.
bool CanGetAttlist(void) const
Check if it is safe to call GetAttlist method.
void ResetYear(void)
Reset Year data member.
EAttlist_DateType m_DateType
TYear & SetYear(void)
Assign a value to Year data member.
bool CanGetDateType(void) const
Check if it is safe to call GetDateType method.
void SetDefaultDateType(void)
Assign default value to DateType data member.
Tparent::CMemberIndex< E_memberIndex, 2 > TmemberIndex
void ResetAttlist(void)
Reset Attlist data member.
NCBI_NS_NCBI::CSerialObject Tparent
NCBI_NS_NCBI::CRef< TAttlist > m_Attlist
virtual void Reset(void)
Reset the whole object.
TAttlist & SetAttlist(void)
Assign a value to Attlist data member.
NCBI_NS_NCBI::CSerialObject Tparent
TDateType GetDateType(void) const
Get the DateType member data.
TDateType & SetDateType(void)
Assign a value to DateType data member.
bool CanGetDay(void) const
Check if it is safe to call GetDay method.
bool IsSetDay(void) const
Check if a value has been assigned to Day data member.
bool IsSetYear(void) const
Check if a value has been assigned to Year data member.
void ResetDay(void)
Reset Day data member.
void Reset(void)
Reset the whole object.
bool IsSetDateType(void) const
Check if a value has been assigned to DateType data member.
const TMonth & GetMonth(void) const
Get the Month member data.
virtual ~CArticleDate_Base(void)
NCBI_NS_NCBI::CRef< TDay > m_Day
bool CanGetYear(void) const
Check if it is safe to call GetYear method.
CArticleDate_Base & operator=(const CArticleDate_Base &)
NCBI_NS_NCBI::CRef< TMonth > m_Month
void ResetDateType(void)
Reset DateType data member.
const TDay & GetDay(void) const
Get the Day member data.
CArticleDate_Base(const CArticleDate_Base &)
void ResetMonth(void)
Reset Month data member.
bool IsSetAttlist(void) const
Check if a value has been assigned to Attlist data member.
const TYear & GetYear(void) const
Get the Year member data.
Modified on Tue Dec 05 02:23:20 2023 by modify_doxy.py rev. 669887