NCBI C++ ToolKit
GBReference_.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 GBReference_.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/gbseq/gbseq.asn">gbseq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/gbseq/gbseq.def">gbseq.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_GBSEQ_GBREFERENCE_BASE_HPP
42 #define OBJECTS_GBSEQ_GBREFERENCE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // forward declarations
62 class CGBXref;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_GBSeq
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///
75 /// CGBReference_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CGBReference_Base(void);
84  // destructor
85  virtual ~CGBReference_Base(void);
86 
87  // type info
89 
90  // types
91  typedef string TReference;
92  typedef string TPosition;
93  typedef list< CGBAuthor > TAuthors;
94  typedef string TConsortium;
95  typedef string TTitle;
96  typedef string TJournal;
97  typedef list< CRef< CGBXref > > TXref;
98  typedef int TPubmed;
99  typedef string TRemark;
100 
101  // member index
102  enum class E_memberIndex {
103  e__allMandatory = 0,
104  e_reference,
105  e_position,
106  e_authors,
107  e_consortium,
108  e_title,
109  e_journal,
110  e_xref,
111  e_pubmed,
112  e_remark
113  };
115 
116  // getters
117  // setters
118 
119  /// Check if a value has been assigned to Reference data member.
120  ///
121  /// Data member Reference is mandatory;
122  /// its type is defined as 'typedef string TReference'
123  /// @return
124  /// - true, if a value has been assigned.
125  /// - false, otherwise.
126  bool IsSetReference(void) const;
127 
128  /// Check if it is safe to call GetReference method.
129  ///
130  /// @return
131  /// - true, if the data member is getatable.
132  /// - false, otherwise.
133  bool CanGetReference(void) const;
134 
135  /// Reset Reference data member.
136  void ResetReference(void);
137 
138  /// Get the Reference member data.
139  ///
140  /// @return
141  /// Reference to the member data.
142  const TReference& GetReference(void) const;
143 
144  /// Assign a value to Reference data member.
145  ///
146  /// @param value
147  /// Value to assign
148  void SetReference(const TReference& value);
149  void SetReference(TReference&& value);
150 
151  /// Assign a value to Reference data member.
152  ///
153  /// @return
154  /// Reference to the data value.
155  TReference& SetReference(void);
156 
157  /// Check if a value has been assigned to Position data member.
158  ///
159  /// Data member Position is optional;
160  /// its type is defined as 'typedef string TPosition'
161  /// @return
162  /// - true, if a value has been assigned.
163  /// - false, otherwise.
164  bool IsSetPosition(void) const;
165 
166  /// Check if it is safe to call GetPosition method.
167  ///
168  /// @return
169  /// - true, if the data member is getatable.
170  /// - false, otherwise.
171  bool CanGetPosition(void) const;
172 
173  /// Reset Position data member.
174  void ResetPosition(void);
175 
176  /// Get the Position member data.
177  ///
178  /// @return
179  /// Reference to the member data.
180  const TPosition& GetPosition(void) const;
181 
182  /// Assign a value to Position data member.
183  ///
184  /// @param value
185  /// Value to assign
186  void SetPosition(const TPosition& value);
187  void SetPosition(TPosition&& value);
188 
189  /// Assign a value to Position data member.
190  ///
191  /// @return
192  /// Reference to the data value.
193  TPosition& SetPosition(void);
194 
195  /// Check if a value has been assigned to Authors data member.
196  ///
197  /// Data member Authors is optional;
198  /// its type is defined as 'typedef list< CGBAuthor > TAuthors'
199  /// @return
200  /// - true, if a value has been assigned.
201  /// - false, otherwise.
202  bool IsSetAuthors(void) const;
203 
204  /// Check if it is safe to call GetAuthors method.
205  ///
206  /// @return
207  /// - true, if the data member is getatable.
208  /// - false, otherwise.
209  bool CanGetAuthors(void) const;
210 
211  /// Reset Authors data member.
212  void ResetAuthors(void);
213 
214  /// Get the Authors member data.
215  ///
216  /// @return
217  /// Reference to the member data.
218  const TAuthors& GetAuthors(void) const;
219 
220  /// Assign a value to Authors data member.
221  ///
222  /// @return
223  /// Reference to the data value.
224  TAuthors& SetAuthors(void);
225 
226  /// Check if a value has been assigned to Consortium data member.
227  ///
228  /// Data member Consortium is optional;
229  /// its type is defined as 'typedef string TConsortium'
230  /// @return
231  /// - true, if a value has been assigned.
232  /// - false, otherwise.
233  bool IsSetConsortium(void) const;
234 
235  /// Check if it is safe to call GetConsortium method.
236  ///
237  /// @return
238  /// - true, if the data member is getatable.
239  /// - false, otherwise.
240  bool CanGetConsortium(void) const;
241 
242  /// Reset Consortium data member.
243  void ResetConsortium(void);
244 
245  /// Get the Consortium member data.
246  ///
247  /// @return
248  /// Reference to the member data.
249  const TConsortium& GetConsortium(void) const;
250 
251  /// Assign a value to Consortium data member.
252  ///
253  /// @param value
254  /// Value to assign
255  void SetConsortium(const TConsortium& value);
256  void SetConsortium(TConsortium&& value);
257 
258  /// Assign a value to Consortium data member.
259  ///
260  /// @return
261  /// Reference to the data value.
262  TConsortium& SetConsortium(void);
263 
264  /// Check if a value has been assigned to Title data member.
265  ///
266  /// Data member Title is optional;
267  /// its type is defined as 'typedef string TTitle'
268  /// @return
269  /// - true, if a value has been assigned.
270  /// - false, otherwise.
271  bool IsSetTitle(void) const;
272 
273  /// Check if it is safe to call GetTitle method.
274  ///
275  /// @return
276  /// - true, if the data member is getatable.
277  /// - false, otherwise.
278  bool CanGetTitle(void) const;
279 
280  /// Reset Title data member.
281  void ResetTitle(void);
282 
283  /// Get the Title member data.
284  ///
285  /// @return
286  /// Reference to the member data.
287  const TTitle& GetTitle(void) const;
288 
289  /// Assign a value to Title data member.
290  ///
291  /// @param value
292  /// Value to assign
293  void SetTitle(const TTitle& value);
294  void SetTitle(TTitle&& value);
295 
296  /// Assign a value to Title data member.
297  ///
298  /// @return
299  /// Reference to the data value.
300  TTitle& SetTitle(void);
301 
302  /// Check if a value has been assigned to Journal data member.
303  ///
304  /// Data member Journal is mandatory;
305  /// its type is defined as 'typedef string TJournal'
306  /// @return
307  /// - true, if a value has been assigned.
308  /// - false, otherwise.
309  bool IsSetJournal(void) const;
310 
311  /// Check if it is safe to call GetJournal method.
312  ///
313  /// @return
314  /// - true, if the data member is getatable.
315  /// - false, otherwise.
316  bool CanGetJournal(void) const;
317 
318  /// Reset Journal data member.
319  void ResetJournal(void);
320 
321  /// Get the Journal member data.
322  ///
323  /// @return
324  /// Reference to the member data.
325  const TJournal& GetJournal(void) const;
326 
327  /// Assign a value to Journal data member.
328  ///
329  /// @param value
330  /// Value to assign
331  void SetJournal(const TJournal& value);
332  void SetJournal(TJournal&& value);
333 
334  /// Assign a value to Journal data member.
335  ///
336  /// @return
337  /// Reference to the data value.
338  TJournal& SetJournal(void);
339 
340  /// Check if a value has been assigned to Xref data member.
341  ///
342  /// Data member Xref is optional;
343  /// its type is defined as 'typedef list< CRef< CGBXref > > TXref'
344  /// @return
345  /// - true, if a value has been assigned.
346  /// - false, otherwise.
347  bool IsSetXref(void) const;
348 
349  /// Check if it is safe to call GetXref method.
350  ///
351  /// @return
352  /// - true, if the data member is getatable.
353  /// - false, otherwise.
354  bool CanGetXref(void) const;
355 
356  /// Reset Xref data member.
357  void ResetXref(void);
358 
359  /// Get the Xref member data.
360  ///
361  /// @return
362  /// Reference to the member data.
363  const TXref& GetXref(void) const;
364 
365  /// Assign a value to Xref data member.
366  ///
367  /// @return
368  /// Reference to the data value.
369  TXref& SetXref(void);
370 
371  /// Check if a value has been assigned to Pubmed data member.
372  ///
373  /// Data member Pubmed is optional;
374  /// its type is defined as 'typedef int TPubmed'
375  /// @return
376  /// - true, if a value has been assigned.
377  /// - false, otherwise.
378  bool IsSetPubmed(void) const;
379 
380  /// Check if it is safe to call GetPubmed method.
381  ///
382  /// @return
383  /// - true, if the data member is getatable.
384  /// - false, otherwise.
385  bool CanGetPubmed(void) const;
386 
387  /// Reset Pubmed data member.
388  void ResetPubmed(void);
389 
390  /// Get the Pubmed member data.
391  ///
392  /// @return
393  /// Copy of the member data.
394  TPubmed GetPubmed(void) const;
395 
396  /// Assign a value to Pubmed data member.
397  ///
398  /// @param value
399  /// Value to assign
400  void SetPubmed(TPubmed value);
401 
402  /// Assign a value to Pubmed data member.
403  ///
404  /// @return
405  /// Reference to the data value.
406  TPubmed& SetPubmed(void);
407 
408  /// Check if a value has been assigned to Remark data member.
409  ///
410  /// Data member Remark is optional;
411  /// its type is defined as 'typedef string TRemark'
412  /// @return
413  /// - true, if a value has been assigned.
414  /// - false, otherwise.
415  bool IsSetRemark(void) const;
416 
417  /// Check if it is safe to call GetRemark method.
418  ///
419  /// @return
420  /// - true, if the data member is getatable.
421  /// - false, otherwise.
422  bool CanGetRemark(void) const;
423 
424  /// Reset Remark data member.
425  void ResetRemark(void);
426 
427  /// Get the Remark member data.
428  ///
429  /// @return
430  /// Reference to the member data.
431  const TRemark& GetRemark(void) const;
432 
433  /// Assign a value to Remark data member.
434  ///
435  /// @param value
436  /// Value to assign
437  void SetRemark(const TRemark& value);
438  void SetRemark(TRemark&& value);
439 
440  /// Assign a value to Remark data member.
441  ///
442  /// @return
443  /// Reference to the data value.
444  TRemark& SetRemark(void);
445 
446  /// Reset the whole object
447  virtual void Reset(void);
448 
449 
450 private:
451  // Prohibit copy constructor and assignment operator
454 
455  // data
456  Uint4 m_set_State[1];
457  string m_Reference;
458  string m_Position;
459  list< CGBAuthor > m_Authors;
460  string m_Consortium;
461  string m_Title;
462  string m_Journal;
463  list< CRef< CGBXref > > m_Xref;
464  int m_Pubmed;
465  string m_Remark;
466 };
467 
468 /* @} */
469 
470 
471 
472 
473 
474 ///////////////////////////////////////////////////////////
475 ///////////////////// inline methods //////////////////////
476 ///////////////////////////////////////////////////////////
477 inline
479 {
480  return ((m_set_State[0] & 0x3) != 0);
481 }
482 
483 inline
485 {
486  return IsSetReference();
487 }
488 
489 inline
491 {
492  if (!CanGetReference()) {
493  ThrowUnassigned(0);
494  }
495  return m_Reference;
496 }
497 
498 inline
500 {
501  m_Reference = value;
502  m_set_State[0] |= 0x3;
503 }
504 
505 inline
507 {
508  m_Reference = std::forward<CGBReference_Base::TReference>(value);
509  m_set_State[0] |= 0x3;
510 }
511 
512 inline
514 {
515 #ifdef _DEBUG
516  if (!IsSetReference()) {
518  }
519 #endif
520  m_set_State[0] |= 0x1;
521  return m_Reference;
522 }
523 
524 inline
526 {
527  return ((m_set_State[0] & 0xc) != 0);
528 }
529 
530 inline
532 {
533  return IsSetPosition();
534 }
535 
536 inline
538 {
539  if (!CanGetPosition()) {
540  ThrowUnassigned(1);
541  }
542  return m_Position;
543 }
544 
545 inline
547 {
548  m_Position = value;
549  m_set_State[0] |= 0xc;
550 }
551 
552 inline
554 {
555  m_Position = std::forward<CGBReference_Base::TPosition>(value);
556  m_set_State[0] |= 0xc;
557 }
558 
559 inline
561 {
562 #ifdef _DEBUG
563  if (!IsSetPosition()) {
565  }
566 #endif
567  m_set_State[0] |= 0x4;
568  return m_Position;
569 }
570 
571 inline
573 {
574  return ((m_set_State[0] & 0x30) != 0);
575 }
576 
577 inline
579 {
580  return true;
581 }
582 
583 inline
585 {
586  return m_Authors;
587 }
588 
589 inline
591 {
592  m_set_State[0] |= 0x10;
593  return m_Authors;
594 }
595 
596 inline
598 {
599  return ((m_set_State[0] & 0xc0) != 0);
600 }
601 
602 inline
604 {
605  return IsSetConsortium();
606 }
607 
608 inline
610 {
611  if (!CanGetConsortium()) {
612  ThrowUnassigned(3);
613  }
614  return m_Consortium;
615 }
616 
617 inline
619 {
621  m_set_State[0] |= 0xc0;
622 }
623 
624 inline
626 {
627  m_Consortium = std::forward<CGBReference_Base::TConsortium>(value);
628  m_set_State[0] |= 0xc0;
629 }
630 
631 inline
633 {
634 #ifdef _DEBUG
635  if (!IsSetConsortium()) {
637  }
638 #endif
639  m_set_State[0] |= 0x40;
640  return m_Consortium;
641 }
642 
643 inline
645 {
646  return ((m_set_State[0] & 0x300) != 0);
647 }
648 
649 inline
651 {
652  return IsSetTitle();
653 }
654 
655 inline
657 {
658  if (!CanGetTitle()) {
659  ThrowUnassigned(4);
660  }
661  return m_Title;
662 }
663 
664 inline
666 {
667  m_Title = value;
668  m_set_State[0] |= 0x300;
669 }
670 
671 inline
673 {
674  m_Title = std::forward<CGBReference_Base::TTitle>(value);
675  m_set_State[0] |= 0x300;
676 }
677 
678 inline
680 {
681 #ifdef _DEBUG
682  if (!IsSetTitle()) {
684  }
685 #endif
686  m_set_State[0] |= 0x100;
687  return m_Title;
688 }
689 
690 inline
692 {
693  return ((m_set_State[0] & 0xc00) != 0);
694 }
695 
696 inline
698 {
699  return IsSetJournal();
700 }
701 
702 inline
704 {
705  if (!CanGetJournal()) {
706  ThrowUnassigned(5);
707  }
708  return m_Journal;
709 }
710 
711 inline
713 {
714  m_Journal = value;
715  m_set_State[0] |= 0xc00;
716 }
717 
718 inline
720 {
721  m_Journal = std::forward<CGBReference_Base::TJournal>(value);
722  m_set_State[0] |= 0xc00;
723 }
724 
725 inline
727 {
728 #ifdef _DEBUG
729  if (!IsSetJournal()) {
731  }
732 #endif
733  m_set_State[0] |= 0x400;
734  return m_Journal;
735 }
736 
737 inline
739 {
740  return ((m_set_State[0] & 0x3000) != 0);
741 }
742 
743 inline
745 {
746  return true;
747 }
748 
749 inline
751 {
752  return m_Xref;
753 }
754 
755 inline
757 {
758  m_set_State[0] |= 0x1000;
759  return m_Xref;
760 }
761 
762 inline
764 {
765  return ((m_set_State[0] & 0xc000) != 0);
766 }
767 
768 inline
770 {
771  return IsSetPubmed();
772 }
773 
774 inline
776 {
777  m_Pubmed = 0;
778  m_set_State[0] &= ~0xc000;
779 }
780 
781 inline
783 {
784  if (!CanGetPubmed()) {
785  ThrowUnassigned(7);
786  }
787  return m_Pubmed;
788 }
789 
790 inline
792 {
793  m_Pubmed = value;
794  m_set_State[0] |= 0xc000;
795 }
796 
797 inline
799 {
800 #ifdef _DEBUG
801  if (!IsSetPubmed()) {
802  memset(&m_Pubmed,UnassignedByte(),sizeof(m_Pubmed));
803  }
804 #endif
805  m_set_State[0] |= 0x4000;
806  return m_Pubmed;
807 }
808 
809 inline
811 {
812  return ((m_set_State[0] & 0x30000) != 0);
813 }
814 
815 inline
817 {
818  return IsSetRemark();
819 }
820 
821 inline
823 {
824  if (!CanGetRemark()) {
825  ThrowUnassigned(8);
826  }
827  return m_Remark;
828 }
829 
830 inline
832 {
833  m_Remark = value;
834  m_set_State[0] |= 0x30000;
835 }
836 
837 inline
839 {
840  m_Remark = std::forward<CGBReference_Base::TRemark>(value);
841  m_set_State[0] |= 0x30000;
842 }
843 
844 inline
846 {
847 #ifdef _DEBUG
848  if (!IsSetRemark()) {
850  }
851 #endif
852  m_set_State[0] |= 0x10000;
853  return m_Remark;
854 }
855 
856 ///////////////////////////////////////////////////////////
857 ////////////////// end of inline methods //////////////////
858 ///////////////////////////////////////////////////////////
859 
860 
861 
862 
863 
864 END_objects_SCOPE // namespace ncbi::objects::
865 
867 
868 
869 #endif // OBJECTS_GBSEQ_GBREFERENCE_BASE_HPP
User-defined methods of the data storage class.
CGBReference_Base –.
CGBXref –.
Definition: GBXref.hpp:66
Base class for all serializable objects.
Definition: serialbase.hpp:150
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
Definition: seqtitle.cpp:106
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_GBSEQ_EXPORT
Definition: ncbi_export.h:504
list< CRef< CGBXref > > TXref
const TJournal & GetJournal(void) const
Get the Journal member data.
bool IsSetReference(void) const
Check if a value has been assigned to Reference data member.
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
list< CGBAuthor > TAuthors
TJournal & SetJournal(void)
Assign a value to Journal data member.
TPubmed GetPubmed(void) const
Get the Pubmed member data.
TReference & SetReference(void)
Assign a value to Reference data member.
TAuthors & SetAuthors(void)
Assign a value to Authors data member.
TXref & SetXref(void)
Assign a value to Xref data member.
bool IsSetPosition(void) const
Check if a value has been assigned to Position data member.
TPubmed & SetPubmed(void)
Assign a value to Pubmed data member.
TPosition & SetPosition(void)
Assign a value to Position data member.
bool CanGetConsortium(void) const
Check if it is safe to call GetConsortium method.
const TAuthors & GetAuthors(void) const
Get the Authors member data.
bool IsSetAuthors(void) const
Check if a value has been assigned to Authors data member.
bool IsSetJournal(void) const
Check if a value has been assigned to Journal data member.
const TPosition & GetPosition(void) const
Get the Position member data.
bool IsSetXref(void) const
Check if a value has been assigned to Xref data member.
CGBReference_Base(const CGBReference_Base &)
bool CanGetPubmed(void) const
Check if it is safe to call GetPubmed method.
TConsortium & SetConsortium(void)
Assign a value to Consortium data member.
bool CanGetXref(void) const
Check if it is safe to call GetXref method.
bool IsSetPubmed(void) const
Check if a value has been assigned to Pubmed data member.
Tparent::CMemberIndex< E_memberIndex, 10 > TmemberIndex
bool IsSetRemark(void) const
Check if a value has been assigned to Remark data member.
bool CanGetJournal(void) const
Check if it is safe to call GetJournal method.
bool IsSetConsortium(void) const
Check if a value has been assigned to Consortium data member.
bool CanGetReference(void) const
Check if it is safe to call GetReference method.
TRemark & SetRemark(void)
Assign a value to Remark data member.
CSerialObject Tparent
const TRemark & GetRemark(void) const
Get the Remark member data.
CGBReference_Base & operator=(const CGBReference_Base &)
list< CRef< CGBXref > > m_Xref
bool CanGetRemark(void) const
Check if it is safe to call GetRemark method.
const TXref & GetXref(void) const
Get the Xref member data.
const TTitle & GetTitle(void) const
Get the Title member data.
bool CanGetPosition(void) const
Check if it is safe to call GetPosition method.
bool CanGetTitle(void) const
Check if it is safe to call GetTitle method.
bool CanGetAuthors(void) const
Check if it is safe to call GetAuthors method.
TTitle & SetTitle(void)
Assign a value to Title data member.
const TReference & GetReference(void) const
Get the Reference member data.
list< CGBAuthor > m_Authors
void ResetPubmed(void)
Reset Pubmed data member.
const TConsortium & GetConsortium(void) const
Get the Consortium member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Sun May 05 05:16:10 2024 by modify_doxy.py rev. 669887