NCBI C++ ToolKit
Cit_sub_.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 Cit_sub_.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/objects/biblio/biblio.asn">biblio.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/biblio/biblio.def">biblio.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 OBJECTS_BIBLIO_CIT_SUB_BASE_HPP
42 #define OBJECTS_BIBLIO_CIT_SUB_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 
51 
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
55 #endif
56 BEGIN_objects_SCOPE // namespace ncbi::objects::
57 
58 
59 // forward declarations
60 class CAuth_list;
61 class CDate;
62 class CImprint;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Biblio
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 /// NOTE: this is just to cite a
75 /// direct data submission, see NCBI-Submit
76 /// for the form of a sequence submission
77 /// citation for a direct submission
78 ///
79 /// CCit_sub_Base --
80 ///
81 
83 {
85 public:
86  // constructor
87  CCit_sub_Base(void);
88  // destructor
89  virtual ~CCit_sub_Base(void);
90 
91  // type info
93 
94  /// medium of submission
95  enum EMedium {
96  eMedium_paper = 1,
97  eMedium_tape = 2,
98  eMedium_floppy = 3,
99  eMedium_email = 4,
100  eMedium_other = 255
101  };
102 
103  /// Access to EMedium's attributes (values, names) as defined in spec
104  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EMedium)(void);
105 
106  // types
108  typedef CImprint TImp;
109  typedef EMedium TMedium;
110  typedef CDate TDate;
111  typedef string TDescr;
112 
113  // member index
114  enum class E_memberIndex {
115  e__allMandatory = 0,
116  e_authors,
117  e_imp,
118  e_medium,
119  e_date,
120  e_descr
121  };
123 
124  // getters
125  // setters
126 
127  /// not necessarily authors of the paper
128  /// Check if a value has been assigned to Authors data member.
129  ///
130  /// Data member Authors is mandatory;
131  /// its type is defined as 'typedef CAuth_list TAuthors'
132  /// @return
133  /// - true, if a value has been assigned.
134  /// - false, otherwise.
135  bool IsSetAuthors(void) const;
136 
137  /// Check if it is safe to call GetAuthors method.
138  ///
139  /// @return
140  /// - true, if the data member is getatable.
141  /// - false, otherwise.
142  bool CanGetAuthors(void) const;
143 
144  /// Reset Authors data member.
145  void ResetAuthors(void);
146 
147  /// Get the Authors member data.
148  ///
149  /// @return
150  /// Reference to the member data.
151  const TAuthors& GetAuthors(void) const;
152 
153  /// Assign a value to Authors data member.
154  ///
155  /// @param value
156  /// Reference to value.
157  void SetAuthors(TAuthors& value);
158 
159  /// Assign a value to Authors data member.
160  ///
161  /// @return
162  /// Reference to the data value.
163  TAuthors& SetAuthors(void);
164 
165  /// this only used to get date.. will go
166  /// Check if a value has been assigned to Imp data member.
167  ///
168  /// Data member Imp is optional;
169  /// its type is defined as 'typedef CImprint TImp'
170  /// @return
171  /// - true, if a value has been assigned.
172  /// - false, otherwise.
173  bool IsSetImp(void) const;
174 
175  /// Check if it is safe to call GetImp method.
176  ///
177  /// @return
178  /// - true, if the data member is getatable.
179  /// - false, otherwise.
180  bool CanGetImp(void) const;
181 
182  /// Reset Imp data member.
183  void ResetImp(void);
184 
185  /// Get the Imp member data.
186  ///
187  /// @return
188  /// Reference to the member data.
189  const TImp& GetImp(void) const;
190 
191  /// Assign a value to Imp data member.
192  ///
193  /// @param value
194  /// Reference to value.
195  void SetImp(TImp& value);
196 
197  /// Assign a value to Imp data member.
198  ///
199  /// @return
200  /// Reference to the data value.
201  TImp& SetImp(void);
202 
203  /// Check if a value has been assigned to Medium data member.
204  ///
205  /// Data member Medium is optional;
206  /// its type is defined as 'typedef EMedium TMedium'
207  /// @return
208  /// - true, if a value has been assigned.
209  /// - false, otherwise.
210  bool IsSetMedium(void) const;
211 
212  /// Check if it is safe to call GetMedium method.
213  ///
214  /// @return
215  /// - true, if the data member is getatable.
216  /// - false, otherwise.
217  bool CanGetMedium(void) const;
218 
219  /// Reset Medium data member.
220  void ResetMedium(void);
221 
222  /// Get the Medium member data.
223  ///
224  /// @return
225  /// Copy of the member data.
226  TMedium GetMedium(void) const;
227 
228  /// Assign a value to Medium data member.
229  ///
230  /// @param value
231  /// Value to assign
232  void SetMedium(TMedium value);
233 
234  /// Assign a value to Medium data member.
235  ///
236  /// @return
237  /// Reference to the data value.
238  TMedium& SetMedium(void);
239 
240  /// replaces imp, will become required
241  /// Check if a value has been assigned to Date data member.
242  ///
243  /// Data member Date is optional;
244  /// its type is defined as 'typedef CDate TDate'
245  /// @return
246  /// - true, if a value has been assigned.
247  /// - false, otherwise.
248  bool IsSetDate(void) const;
249 
250  /// Check if it is safe to call GetDate method.
251  ///
252  /// @return
253  /// - true, if the data member is getatable.
254  /// - false, otherwise.
255  bool CanGetDate(void) const;
256 
257  /// Reset Date data member.
258  void ResetDate(void);
259 
260  /// Get the Date member data.
261  ///
262  /// @return
263  /// Reference to the member data.
264  const TDate& GetDate(void) const;
265 
266  /// Assign a value to Date data member.
267  ///
268  /// @param value
269  /// Reference to value.
270  void SetDate(TDate& value);
271 
272  /// Assign a value to Date data member.
273  ///
274  /// @return
275  /// Reference to the data value.
276  TDate& SetDate(void);
277 
278  /// description of changes for public view
279  /// Check if a value has been assigned to Descr data member.
280  ///
281  /// Data member Descr is optional;
282  /// its type is defined as 'typedef string TDescr'
283  /// @return
284  /// - true, if a value has been assigned.
285  /// - false, otherwise.
286  bool IsSetDescr(void) const;
287 
288  /// Check if it is safe to call GetDescr method.
289  ///
290  /// @return
291  /// - true, if the data member is getatable.
292  /// - false, otherwise.
293  bool CanGetDescr(void) const;
294 
295  /// Reset Descr data member.
296  void ResetDescr(void);
297 
298  /// Get the Descr member data.
299  ///
300  /// @return
301  /// Reference to the member data.
302  const TDescr& GetDescr(void) const;
303 
304  /// Assign a value to Descr data member.
305  ///
306  /// @param value
307  /// Value to assign
308  void SetDescr(const TDescr& value);
309  void SetDescr(TDescr&& value);
310 
311  /// Assign a value to Descr data member.
312  ///
313  /// @return
314  /// Reference to the data value.
315  TDescr& SetDescr(void);
316 
317  /// Reset the whole object
318  virtual void Reset(void);
319 
320 
321 private:
322  // Prohibit copy constructor and assignment operator
325 
326  // data
327  Uint4 m_set_State[1];
332  string m_Descr;
333 };
334 
335 /* @} */
336 
337 
338 
339 
340 
341 ///////////////////////////////////////////////////////////
342 ///////////////////// inline methods //////////////////////
343 ///////////////////////////////////////////////////////////
344 inline
346 {
347  return m_Authors.NotEmpty();
348 }
349 
350 inline
352 {
353  return true;
354 }
355 
356 inline
358 {
359  if ( !m_Authors ) {
360  const_cast<CCit_sub_Base*>(this)->ResetAuthors();
361  }
362  return (*m_Authors);
363 }
364 
365 inline
367 {
368  if ( !m_Authors ) {
369  ResetAuthors();
370  }
371  return (*m_Authors);
372 }
373 
374 inline
375 bool CCit_sub_Base::IsSetImp(void) const
376 {
377  return m_Imp.NotEmpty();
378 }
379 
380 inline
381 bool CCit_sub_Base::CanGetImp(void) const
382 {
383  return IsSetImp();
384 }
385 
386 inline
388 {
389  if (!CanGetImp()) {
390  ThrowUnassigned(1);
391  }
392  return (*m_Imp);
393 }
394 
395 inline
397 {
398  return ((m_set_State[0] & 0x30) != 0);
399 }
400 
401 inline
403 {
404  return IsSetMedium();
405 }
406 
407 inline
409 {
410  m_Medium = (EMedium)(0);
411  m_set_State[0] &= ~0x30;
412 }
413 
414 inline
416 {
417  if (!CanGetMedium()) {
418  ThrowUnassigned(2);
419  }
420  return m_Medium;
421 }
422 
423 inline
425 {
426  m_Medium = value;
427  m_set_State[0] |= 0x30;
428 }
429 
430 inline
432 {
433 #ifdef _DEBUG
434  if (!IsSetMedium()) {
435  memset(&m_Medium,UnassignedByte(),sizeof(m_Medium));
436  }
437 #endif
438  m_set_State[0] |= 0x10;
439  return m_Medium;
440 }
441 
442 inline
443 bool CCit_sub_Base::IsSetDate(void) const
444 {
445  return m_Date.NotEmpty();
446 }
447 
448 inline
450 {
451  return IsSetDate();
452 }
453 
454 inline
456 {
457  if (!CanGetDate()) {
458  ThrowUnassigned(3);
459  }
460  return (*m_Date);
461 }
462 
463 inline
465 {
466  return ((m_set_State[0] & 0x300) != 0);
467 }
468 
469 inline
471 {
472  return IsSetDescr();
473 }
474 
475 inline
477 {
478  if (!CanGetDescr()) {
479  ThrowUnassigned(4);
480  }
481  return m_Descr;
482 }
483 
484 inline
486 {
487  m_Descr = value;
488  m_set_State[0] |= 0x300;
489 }
490 
491 inline
493 {
494  m_Descr = std::forward<CCit_sub_Base::TDescr>(value);
495  m_set_State[0] |= 0x300;
496 }
497 
498 inline
500 {
501 #ifdef _DEBUG
502  if (!IsSetDescr()) {
504  }
505 #endif
506  m_set_State[0] |= 0x100;
507  return m_Descr;
508 }
509 
510 ///////////////////////////////////////////////////////////
511 ////////////////// end of inline methods //////////////////
512 ///////////////////////////////////////////////////////////
513 
514 
515 
516 
517 
518 END_objects_SCOPE // namespace ncbi::objects::
519 
521 
522 
523 #endif // OBJECTS_BIBLIO_CIT_SUB_BASE_HPP
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
NOTE: this is just to cite a direct data submission, see NCBI-Submit for the form of a sequence submi...
Definition: Cit_sub_.hpp:83
Definition: Date.hpp:53
CImprint –.
Definition: Imprint.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_BIBLIO_EXPORT
Definition: ncbi_export.h:312
const TDescr & GetDescr(void) const
Get the Descr member data.
Definition: Cit_sub_.hpp:476
const TDate & GetDate(void) const
Get the Date member data.
Definition: Cit_sub_.hpp:455
bool IsSetDescr(void) const
description of changes for public view Check if a value has been assigned to Descr data member.
Definition: Cit_sub_.hpp:464
TDescr & SetDescr(void)
Assign a value to Descr data member.
Definition: Cit_sub_.hpp:499
void ResetAuthors(void)
Reset Authors data member.
Definition: Cit_sub_.cpp:65
TAuthors & SetAuthors(void)
Assign a value to Authors data member.
Definition: Cit_sub_.hpp:366
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
Definition: Cit_sub_.hpp:470
bool CanGetMedium(void) const
Check if it is safe to call GetMedium method.
Definition: Cit_sub_.hpp:402
TMedium GetMedium(void) const
Get the Medium member data.
Definition: Cit_sub_.hpp:415
bool CanGetImp(void) const
Check if it is safe to call GetImp method.
Definition: Cit_sub_.hpp:381
string TDescr
Definition: Cit_sub_.hpp:111
bool CanGetDate(void) const
Check if it is safe to call GetDate method.
Definition: Cit_sub_.hpp:449
const TAuthors & GetAuthors(void) const
Get the Authors member data.
Definition: Cit_sub_.hpp:357
CImprint TImp
Definition: Cit_sub_.hpp:108
string m_Descr
Definition: Cit_sub_.hpp:332
bool IsSetAuthors(void) const
not necessarily authors of the paper Check if a value has been assigned to Authors data member.
Definition: Cit_sub_.hpp:345
void ResetMedium(void)
Reset Medium data member.
Definition: Cit_sub_.hpp:408
CCit_sub_Base & operator=(const CCit_sub_Base &)
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
Definition: Cit_sub_.hpp:351
bool IsSetDate(void) const
replaces imp, will become required Check if a value has been assigned to Date data member.
Definition: Cit_sub_.hpp:443
CAuth_list TAuthors
Definition: Cit_sub_.hpp:107
EMedium TMedium
Definition: Cit_sub_.hpp:109
const TImp & GetImp(void) const
Get the Imp member data.
Definition: Cit_sub_.hpp:387
CRef< TDate > m_Date
Definition: Cit_sub_.hpp:331
TMedium & SetMedium(void)
Assign a value to Medium data member.
Definition: Cit_sub_.hpp:431
bool IsSetImp(void) const
this only used to get date.
Definition: Cit_sub_.hpp:375
EMedium
medium of submission
Definition: Cit_sub_.hpp:95
CRef< TAuthors > m_Authors
Definition: Cit_sub_.hpp:328
CRef< TImp > m_Imp
Definition: Cit_sub_.hpp:329
EMedium m_Medium
Definition: Cit_sub_.hpp:330
DECLARE_INTERNAL_TYPE_INFO()
CCit_sub_Base(const CCit_sub_Base &)
bool IsSetMedium(void) const
Check if a value has been assigned to Medium data member.
Definition: Cit_sub_.hpp:396
Uint4 m_set_State[1]
Definition: Cit_sub_.hpp:327
CSerialObject Tparent
Definition: Cit_sub_.hpp:84
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
Definition: Cit_sub_.hpp:122
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Thu May 30 12:27:17 2024 by modify_doxy.py rev. 669887