NCBI C++ ToolKit
HG_Commentary_.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 HG_Commentary_.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/homologene/homologene.asn">homologene.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/homologene/homologene.def">homologene.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_HOMOLOGENE_HG_COMMENTARY_BASE_HPP
42 #define OBJECTS_HOMOLOGENE_HG_COMMENTARY_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CHG_Commentary;
62 class CHG_Link;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_HomoloGene
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///
75 /// CHG_Commentary_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CHG_Commentary_Base(void);
84  // destructor
85  virtual ~CHG_Commentary_Base(void);
86 
87  // type info
89 
90  // types
91  typedef CHG_Link TLink;
92  typedef string TDescription;
93  typedef string TCaption;
94  typedef string TProvider;
95  typedef list< CRef< CHG_Link > > TOther_links;
96  typedef list< CRef< CHG_Commentary > > TOther_commentaries;
97  typedef int TTaxid;
98  typedef int TGeneid;
99 
100  // member index
101  enum class E_memberIndex {
102  e__allMandatory = 0,
103  e_link,
105  e_caption,
106  e_provider,
109  e_taxid,
110  e_geneid
111  };
113 
114  // getters
115  // setters
116 
117  /// Check if a value has been assigned to Link data member.
118  ///
119  /// Data member Link is mandatory;
120  /// its type is defined as 'typedef CHG_Link TLink'
121  /// @return
122  /// - true, if a value has been assigned.
123  /// - false, otherwise.
124  bool IsSetLink(void) const;
125 
126  /// Check if it is safe to call GetLink method.
127  ///
128  /// @return
129  /// - true, if the data member is getatable.
130  /// - false, otherwise.
131  bool CanGetLink(void) const;
132 
133  /// Reset Link data member.
134  void ResetLink(void);
135 
136  /// Get the Link member data.
137  ///
138  /// @return
139  /// Reference to the member data.
140  const TLink& GetLink(void) const;
141 
142  /// Assign a value to Link data member.
143  ///
144  /// @param value
145  /// Reference to value.
146  void SetLink(TLink& value);
147 
148  /// Assign a value to Link data member.
149  ///
150  /// @return
151  /// Reference to the data value.
152  TLink& SetLink(void);
153 
154  /// main description
155  /// Check if a value has been assigned to Description data member.
156  ///
157  /// Data member Description is optional;
158  /// its type is defined as 'typedef string TDescription'
159  /// @return
160  /// - true, if a value has been assigned.
161  /// - false, otherwise.
162  bool IsSetDescription(void) const;
163 
164  /// Check if it is safe to call GetDescription method.
165  ///
166  /// @return
167  /// - true, if the data member is getatable.
168  /// - false, otherwise.
169  bool CanGetDescription(void) const;
170 
171  /// Reset Description data member.
172  void ResetDescription(void);
173 
174  /// Get the Description member data.
175  ///
176  /// @return
177  /// Reference to the member data.
178  const TDescription& GetDescription(void) const;
179 
180  /// Assign a value to Description data member.
181  ///
182  /// @param value
183  /// Value to assign
184  void SetDescription(const TDescription& value);
186 
187  /// Assign a value to Description data member.
188  ///
189  /// @return
190  /// Reference to the data value.
192 
193  /// extra text
194  /// Check if a value has been assigned to Caption data member.
195  ///
196  /// Data member Caption is optional;
197  /// its type is defined as 'typedef string TCaption'
198  /// @return
199  /// - true, if a value has been assigned.
200  /// - false, otherwise.
201  bool IsSetCaption(void) const;
202 
203  /// Check if it is safe to call GetCaption method.
204  ///
205  /// @return
206  /// - true, if the data member is getatable.
207  /// - false, otherwise.
208  bool CanGetCaption(void) const;
209 
210  /// Reset Caption data member.
211  void ResetCaption(void);
212 
213  /// Get the Caption member data.
214  ///
215  /// @return
216  /// Reference to the member data.
217  const TCaption& GetCaption(void) const;
218 
219  /// Assign a value to Caption data member.
220  ///
221  /// @param value
222  /// Value to assign
223  void SetCaption(const TCaption& value);
224  void SetCaption(TCaption&& value);
225 
226  /// Assign a value to Caption data member.
227  ///
228  /// @return
229  /// Reference to the data value.
230  TCaption& SetCaption(void);
231 
232  /// Check if a value has been assigned to Provider data member.
233  ///
234  /// Data member Provider is optional;
235  /// its type is defined as 'typedef string TProvider'
236  /// @return
237  /// - true, if a value has been assigned.
238  /// - false, otherwise.
239  bool IsSetProvider(void) const;
240 
241  /// Check if it is safe to call GetProvider method.
242  ///
243  /// @return
244  /// - true, if the data member is getatable.
245  /// - false, otherwise.
246  bool CanGetProvider(void) const;
247 
248  /// Reset Provider data member.
249  void ResetProvider(void);
250 
251  /// Get the Provider member data.
252  ///
253  /// @return
254  /// Reference to the member data.
255  const TProvider& GetProvider(void) const;
256 
257  /// Assign a value to Provider data member.
258  ///
259  /// @param value
260  /// Value to assign
261  void SetProvider(const TProvider& value);
262  void SetProvider(TProvider&& value);
263 
264  /// Assign a value to Provider data member.
265  ///
266  /// @return
267  /// Reference to the data value.
268  TProvider& SetProvider(void);
269 
270  /// Check if a value has been assigned to Other_links data member.
271  ///
272  /// Data member Other_links is optional;
273  /// its type is defined as 'typedef list< CRef< CHG_Link > > TOther_links'
274  /// @return
275  /// - true, if a value has been assigned.
276  /// - false, otherwise.
277  bool IsSetOther_links(void) const;
278 
279  /// Check if it is safe to call GetOther_links method.
280  ///
281  /// @return
282  /// - true, if the data member is getatable.
283  /// - false, otherwise.
284  bool CanGetOther_links(void) const;
285 
286  /// Reset Other_links data member.
287  void ResetOther_links(void);
288 
289  /// Get the Other_links member data.
290  ///
291  /// @return
292  /// Reference to the member data.
293  const TOther_links& GetOther_links(void) const;
294 
295  /// Assign a value to Other_links data member.
296  ///
297  /// @return
298  /// Reference to the data value.
300 
301  /// Check if a value has been assigned to Other_commentaries data member.
302  ///
303  /// Data member Other_commentaries is optional;
304  /// its type is defined as 'typedef list< CRef< CHG_Commentary > > TOther_commentaries'
305  /// @return
306  /// - true, if a value has been assigned.
307  /// - false, otherwise.
308  bool IsSetOther_commentaries(void) const;
309 
310  /// Check if it is safe to call GetOther_commentaries method.
311  ///
312  /// @return
313  /// - true, if the data member is getatable.
314  /// - false, otherwise.
315  bool CanGetOther_commentaries(void) const;
316 
317  /// Reset Other_commentaries data member.
318  void ResetOther_commentaries(void);
319 
320  /// Get the Other_commentaries member data.
321  ///
322  /// @return
323  /// Reference to the member data.
324  const TOther_commentaries& GetOther_commentaries(void) const;
325 
326  /// Assign a value to Other_commentaries data member.
327  ///
328  /// @return
329  /// Reference to the data value.
331 
332  /// Check if a value has been assigned to Taxid data member.
333  ///
334  /// Data member Taxid is optional;
335  /// its type is defined as 'typedef int TTaxid'
336  /// @return
337  /// - true, if a value has been assigned.
338  /// - false, otherwise.
339  bool IsSetTaxid(void) const;
340 
341  /// Check if it is safe to call GetTaxid method.
342  ///
343  /// @return
344  /// - true, if the data member is getatable.
345  /// - false, otherwise.
346  bool CanGetTaxid(void) const;
347 
348  /// Reset Taxid data member.
349  void ResetTaxid(void);
350 
351  /// Get the Taxid member data.
352  ///
353  /// @return
354  /// Copy of the member data.
355  TTaxid GetTaxid(void) const;
356 
357  /// Assign a value to Taxid data member.
358  ///
359  /// @param value
360  /// Value to assign
361  void SetTaxid(TTaxid value);
362 
363  /// Assign a value to Taxid data member.
364  ///
365  /// @return
366  /// Reference to the data value.
367  TTaxid& SetTaxid(void);
368 
369  /// Check if a value has been assigned to Geneid data member.
370  ///
371  /// Data member Geneid is optional;
372  /// its type is defined as 'typedef int TGeneid'
373  /// @return
374  /// - true, if a value has been assigned.
375  /// - false, otherwise.
376  bool IsSetGeneid(void) const;
377 
378  /// Check if it is safe to call GetGeneid method.
379  ///
380  /// @return
381  /// - true, if the data member is getatable.
382  /// - false, otherwise.
383  bool CanGetGeneid(void) const;
384 
385  /// Reset Geneid data member.
386  void ResetGeneid(void);
387 
388  /// Get the Geneid member data.
389  ///
390  /// @return
391  /// Copy of the member data.
392  TGeneid GetGeneid(void) const;
393 
394  /// Assign a value to Geneid data member.
395  ///
396  /// @param value
397  /// Value to assign
398  void SetGeneid(TGeneid value);
399 
400  /// Assign a value to Geneid data member.
401  ///
402  /// @return
403  /// Reference to the data value.
404  TGeneid& SetGeneid(void);
405 
406  /// Reset the whole object
407  virtual void Reset(void);
408 
409 
410 private:
411  // Prohibit copy constructor and assignment operator
414 
415  // data
419  string m_Caption;
420  string m_Provider;
421  list< CRef< CHG_Link > > m_Other_links;
422  list< CRef< CHG_Commentary > > m_Other_commentaries;
423  int m_Taxid;
424  int m_Geneid;
425 };
426 
427 /* @} */
428 
429 
430 
431 
432 
433 ///////////////////////////////////////////////////////////
434 ///////////////////// inline methods //////////////////////
435 ///////////////////////////////////////////////////////////
436 inline
438 {
439  return m_Link.NotEmpty();
440 }
441 
442 inline
444 {
445  return true;
446 }
447 
448 inline
450 {
451  if ( !m_Link ) {
452  const_cast<CHG_Commentary_Base*>(this)->ResetLink();
453  }
454  return (*m_Link);
455 }
456 
457 inline
459 {
460  if ( !m_Link ) {
461  ResetLink();
462  }
463  return (*m_Link);
464 }
465 
466 inline
468 {
469  return ((m_set_State[0] & 0xc) != 0);
470 }
471 
472 inline
474 {
475  return IsSetDescription();
476 }
477 
478 inline
480 {
481  if (!CanGetDescription()) {
482  ThrowUnassigned(1);
483  }
484  return m_Description;
485 }
486 
487 inline
489 {
491  m_set_State[0] |= 0xc;
492 }
493 
494 inline
496 {
497  m_Description = std::forward<CHG_Commentary_Base::TDescription>(value);
498  m_set_State[0] |= 0xc;
499 }
500 
501 inline
503 {
504 #ifdef _DEBUG
505  if (!IsSetDescription()) {
507  }
508 #endif
509  m_set_State[0] |= 0x4;
510  return m_Description;
511 }
512 
513 inline
515 {
516  return ((m_set_State[0] & 0x30) != 0);
517 }
518 
519 inline
521 {
522  return IsSetCaption();
523 }
524 
525 inline
527 {
528  if (!CanGetCaption()) {
529  ThrowUnassigned(2);
530  }
531  return m_Caption;
532 }
533 
534 inline
536 {
537  m_Caption = value;
538  m_set_State[0] |= 0x30;
539 }
540 
541 inline
543 {
544  m_Caption = std::forward<CHG_Commentary_Base::TCaption>(value);
545  m_set_State[0] |= 0x30;
546 }
547 
548 inline
550 {
551 #ifdef _DEBUG
552  if (!IsSetCaption()) {
554  }
555 #endif
556  m_set_State[0] |= 0x10;
557  return m_Caption;
558 }
559 
560 inline
562 {
563  return ((m_set_State[0] & 0xc0) != 0);
564 }
565 
566 inline
568 {
569  return IsSetProvider();
570 }
571 
572 inline
574 {
575  if (!CanGetProvider()) {
576  ThrowUnassigned(3);
577  }
578  return m_Provider;
579 }
580 
581 inline
583 {
584  m_Provider = value;
585  m_set_State[0] |= 0xc0;
586 }
587 
588 inline
590 {
591  m_Provider = std::forward<CHG_Commentary_Base::TProvider>(value);
592  m_set_State[0] |= 0xc0;
593 }
594 
595 inline
597 {
598 #ifdef _DEBUG
599  if (!IsSetProvider()) {
601  }
602 #endif
603  m_set_State[0] |= 0x40;
604  return m_Provider;
605 }
606 
607 inline
609 {
610  return ((m_set_State[0] & 0x300) != 0);
611 }
612 
613 inline
615 {
616  return true;
617 }
618 
619 inline
621 {
622  return m_Other_links;
623 }
624 
625 inline
627 {
628  m_set_State[0] |= 0x100;
629  return m_Other_links;
630 }
631 
632 inline
634 {
635  return ((m_set_State[0] & 0xc00) != 0);
636 }
637 
638 inline
640 {
641  return true;
642 }
643 
644 inline
646 {
647  return m_Other_commentaries;
648 }
649 
650 inline
652 {
653  m_set_State[0] |= 0x400;
654  return m_Other_commentaries;
655 }
656 
657 inline
659 {
660  return ((m_set_State[0] & 0x3000) != 0);
661 }
662 
663 inline
665 {
666  return IsSetTaxid();
667 }
668 
669 inline
671 {
672  m_Taxid = 0;
673  m_set_State[0] &= ~0x3000;
674 }
675 
676 inline
678 {
679  if (!CanGetTaxid()) {
680  ThrowUnassigned(6);
681  }
682  return m_Taxid;
683 }
684 
685 inline
687 {
688  m_Taxid = value;
689  m_set_State[0] |= 0x3000;
690 }
691 
692 inline
694 {
695 #ifdef _DEBUG
696  if (!IsSetTaxid()) {
697  memset(&m_Taxid,UnassignedByte(),sizeof(m_Taxid));
698  }
699 #endif
700  m_set_State[0] |= 0x1000;
701  return m_Taxid;
702 }
703 
704 inline
706 {
707  return ((m_set_State[0] & 0xc000) != 0);
708 }
709 
710 inline
712 {
713  return IsSetGeneid();
714 }
715 
716 inline
718 {
719  m_Geneid = 0;
720  m_set_State[0] &= ~0xc000;
721 }
722 
723 inline
725 {
726  if (!CanGetGeneid()) {
727  ThrowUnassigned(7);
728  }
729  return m_Geneid;
730 }
731 
732 inline
734 {
735  m_Geneid = value;
736  m_set_State[0] |= 0xc000;
737 }
738 
739 inline
741 {
742 #ifdef _DEBUG
743  if (!IsSetGeneid()) {
744  memset(&m_Geneid,UnassignedByte(),sizeof(m_Geneid));
745  }
746 #endif
747  m_set_State[0] |= 0x4000;
748  return m_Geneid;
749 }
750 
751 ///////////////////////////////////////////////////////////
752 ////////////////// end of inline methods //////////////////
753 ///////////////////////////////////////////////////////////
754 
755 
756 
757 
758 
759 END_objects_SCOPE // namespace ncbi::objects::
760 
762 
763 
764 #endif // OBJECTS_HOMOLOGENE_HG_COMMENTARY_BASE_HPP
CHG_Commentary_Base –.
CHG_Commentary –.
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
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
list< CRef< CHG_Commentary > > m_Other_commentaries
const TOther_links & GetOther_links(void) const
Get the Other_links member data.
virtual void Reset(void)
Reset the whole object.
bool CanGetTaxid(void) const
Check if it is safe to call GetTaxid method.
virtual ~CHG_Commentary_Base(void)
void ResetTaxid(void)
Reset Taxid data member.
TCaption & SetCaption(void)
Assign a value to Caption data member.
TLink & SetLink(void)
Assign a value to Link data member.
void ResetLink(void)
Reset Link data member.
void ResetDescription(void)
Reset Description data member.
TProvider & SetProvider(void)
Assign a value to Provider data member.
bool IsSetTaxid(void) const
Check if a value has been assigned to Taxid data member.
bool CanGetProvider(void) const
Check if it is safe to call GetProvider method.
const TOther_commentaries & GetOther_commentaries(void) const
Get the Other_commentaries member data.
bool CanGetOther_links(void) const
Check if it is safe to call GetOther_links method.
TOther_links & SetOther_links(void)
Assign a value to Other_links data member.
void ResetGeneid(void)
Reset Geneid data member.
void ResetOther_links(void)
Reset Other_links data member.
bool IsSetProvider(void) const
Check if a value has been assigned to Provider data member.
void ResetOther_commentaries(void)
Reset Other_commentaries data member.
bool IsSetCaption(void) const
extra text Check if a value has been assigned to Caption data member.
const TLink & GetLink(void) const
Get the Link member data.
CHG_Commentary_Base & operator=(const CHG_Commentary_Base &)
CHG_Commentary_Base(const CHG_Commentary_Base &)
CSerialObject Tparent
bool CanGetCaption(void) const
Check if it is safe to call GetCaption method.
TTaxid & SetTaxid(void)
Assign a value to Taxid data member.
bool CanGetOther_commentaries(void) const
Check if it is safe to call GetOther_commentaries method.
TDescription & SetDescription(void)
Assign a value to Description data member.
bool IsSetDescription(void) const
main description Check if a value has been assigned to Description data member.
void ResetProvider(void)
Reset Provider data member.
list< CRef< CHG_Link > > TOther_links
const TDescription & GetDescription(void) const
Get the Description member data.
bool CanGetDescription(void) const
Check if it is safe to call GetDescription method.
const TCaption & GetCaption(void) const
Get the Caption member data.
bool CanGetGeneid(void) const
Check if it is safe to call GetGeneid method.
list< CRef< CHG_Link > > m_Other_links
bool IsSetOther_links(void) const
Check if a value has been assigned to Other_links data member.
TOther_commentaries & SetOther_commentaries(void)
Assign a value to Other_commentaries data member.
TTaxid GetTaxid(void) const
Get the Taxid member data.
TGeneid & SetGeneid(void)
Assign a value to Geneid data member.
bool CanGetLink(void) const
Check if it is safe to call GetLink method.
bool IsSetOther_commentaries(void) const
Check if a value has been assigned to Other_commentaries data member.
list< CRef< CHG_Commentary > > TOther_commentaries
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
const TProvider & GetProvider(void) const
Get the Provider member data.
bool IsSetGeneid(void) const
Check if a value has been assigned to Geneid data member.
TGeneid GetGeneid(void) const
Get the Geneid member data.
void ResetCaption(void)
Reset Caption data member.
bool IsSetLink(void) const
Check if a value has been assigned to Link data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:57:00 2024 by modify_doxy.py rev. 669887