NCBI C++ ToolKit
GBFeature_.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 GBFeature_.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_GBFEATURE_BASE_HPP
42 #define OBJECTS_GBSEQ_GBFEATURE_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 CGBInterval;
62 class CGBQualifier;
63 class CGBXref;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_GBSeq
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CGBFeature_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CGBFeature_Base(void);
85  // destructor
86  virtual ~CGBFeature_Base(void);
87 
88  // type info
90 
91  // types
92  typedef string TKey;
93  typedef string TLocation;
94  typedef list< CRef< CGBInterval > > TIntervals;
95  typedef string TOperator;
96  typedef bool TPartial5;
97  typedef bool TPartial3;
98  typedef list< CRef< CGBQualifier > > TQuals;
99  typedef list< CRef< CGBXref > > TXrefs;
100 
101  // member index
102  enum class E_memberIndex {
103  e__allMandatory = 0,
104  e_key,
105  e_location,
106  e_intervals,
107  e_operator,
108  e_partial5,
109  e_partial3,
110  e_quals,
111  e_xrefs
112  };
114 
115  // getters
116  // setters
117 
118  /// Check if a value has been assigned to Key data member.
119  ///
120  /// Data member Key is mandatory;
121  /// its type is defined as 'typedef string TKey'
122  /// @return
123  /// - true, if a value has been assigned.
124  /// - false, otherwise.
125  bool IsSetKey(void) const;
126 
127  /// Check if it is safe to call GetKey method.
128  ///
129  /// @return
130  /// - true, if the data member is getatable.
131  /// - false, otherwise.
132  bool CanGetKey(void) const;
133 
134  /// Reset Key data member.
135  void ResetKey(void);
136 
137  /// Get the Key member data.
138  ///
139  /// @return
140  /// Reference to the member data.
141  const TKey& GetKey(void) const;
142 
143  /// Assign a value to Key data member.
144  ///
145  /// @param value
146  /// Value to assign
147  void SetKey(const TKey& value);
148  void SetKey(TKey&& value);
149 
150  /// Assign a value to Key data member.
151  ///
152  /// @return
153  /// Reference to the data value.
154  TKey& SetKey(void);
155 
156  /// Check if a value has been assigned to Location data member.
157  ///
158  /// Data member Location is mandatory;
159  /// its type is defined as 'typedef string TLocation'
160  /// @return
161  /// - true, if a value has been assigned.
162  /// - false, otherwise.
163  bool IsSetLocation(void) const;
164 
165  /// Check if it is safe to call GetLocation method.
166  ///
167  /// @return
168  /// - true, if the data member is getatable.
169  /// - false, otherwise.
170  bool CanGetLocation(void) const;
171 
172  /// Reset Location data member.
173  void ResetLocation(void);
174 
175  /// Get the Location member data.
176  ///
177  /// @return
178  /// Reference to the member data.
179  const TLocation& GetLocation(void) const;
180 
181  /// Assign a value to Location data member.
182  ///
183  /// @param value
184  /// Value to assign
185  void SetLocation(const TLocation& value);
186  void SetLocation(TLocation&& value);
187 
188  /// Assign a value to Location data member.
189  ///
190  /// @return
191  /// Reference to the data value.
192  TLocation& SetLocation(void);
193 
194  /// Check if a value has been assigned to Intervals data member.
195  ///
196  /// Data member Intervals is optional;
197  /// its type is defined as 'typedef list< CRef< CGBInterval > > TIntervals'
198  /// @return
199  /// - true, if a value has been assigned.
200  /// - false, otherwise.
201  bool IsSetIntervals(void) const;
202 
203  /// Check if it is safe to call GetIntervals method.
204  ///
205  /// @return
206  /// - true, if the data member is getatable.
207  /// - false, otherwise.
208  bool CanGetIntervals(void) const;
209 
210  /// Reset Intervals data member.
211  void ResetIntervals(void);
212 
213  /// Get the Intervals member data.
214  ///
215  /// @return
216  /// Reference to the member data.
217  const TIntervals& GetIntervals(void) const;
218 
219  /// Assign a value to Intervals data member.
220  ///
221  /// @return
222  /// Reference to the data value.
223  TIntervals& SetIntervals(void);
224 
225  /// Check if a value has been assigned to Operator data member.
226  ///
227  /// Data member Operator is optional;
228  /// its type is defined as 'typedef string TOperator'
229  /// @return
230  /// - true, if a value has been assigned.
231  /// - false, otherwise.
232  bool IsSetOperator(void) const;
233 
234  /// Check if it is safe to call GetOperator method.
235  ///
236  /// @return
237  /// - true, if the data member is getatable.
238  /// - false, otherwise.
239  bool CanGetOperator(void) const;
240 
241  /// Reset Operator data member.
242  void ResetOperator(void);
243 
244  /// Get the Operator member data.
245  ///
246  /// @return
247  /// Reference to the member data.
248  const TOperator& GetOperator(void) const;
249 
250  /// Assign a value to Operator data member.
251  ///
252  /// @param value
253  /// Value to assign
254  void SetOperator(const TOperator& value);
255  void SetOperator(TOperator&& value);
256 
257  /// Assign a value to Operator data member.
258  ///
259  /// @return
260  /// Reference to the data value.
261  TOperator& SetOperator(void);
262 
263  /// Check if a value has been assigned to Partial5 data member.
264  ///
265  /// Data member Partial5 is optional;
266  /// its type is defined as 'typedef bool TPartial5'
267  /// @return
268  /// - true, if a value has been assigned.
269  /// - false, otherwise.
270  bool IsSetPartial5(void) const;
271 
272  /// Check if it is safe to call GetPartial5 method.
273  ///
274  /// @return
275  /// - true, if the data member is getatable.
276  /// - false, otherwise.
277  bool CanGetPartial5(void) const;
278 
279  /// Reset Partial5 data member.
280  void ResetPartial5(void);
281 
282  /// Get the Partial5 member data.
283  ///
284  /// @return
285  /// Copy of the member data.
286  TPartial5 GetPartial5(void) const;
287 
288  /// Assign a value to Partial5 data member.
289  ///
290  /// @param value
291  /// Value to assign
292  void SetPartial5(TPartial5 value);
293 
294  /// Assign a value to Partial5 data member.
295  ///
296  /// @return
297  /// Reference to the data value.
298  TPartial5& SetPartial5(void);
299 
300  /// Check if a value has been assigned to Partial3 data member.
301  ///
302  /// Data member Partial3 is optional;
303  /// its type is defined as 'typedef bool TPartial3'
304  /// @return
305  /// - true, if a value has been assigned.
306  /// - false, otherwise.
307  bool IsSetPartial3(void) const;
308 
309  /// Check if it is safe to call GetPartial3 method.
310  ///
311  /// @return
312  /// - true, if the data member is getatable.
313  /// - false, otherwise.
314  bool CanGetPartial3(void) const;
315 
316  /// Reset Partial3 data member.
317  void ResetPartial3(void);
318 
319  /// Get the Partial3 member data.
320  ///
321  /// @return
322  /// Copy of the member data.
323  TPartial3 GetPartial3(void) const;
324 
325  /// Assign a value to Partial3 data member.
326  ///
327  /// @param value
328  /// Value to assign
329  void SetPartial3(TPartial3 value);
330 
331  /// Assign a value to Partial3 data member.
332  ///
333  /// @return
334  /// Reference to the data value.
335  TPartial3& SetPartial3(void);
336 
337  /// Check if a value has been assigned to Quals data member.
338  ///
339  /// Data member Quals is optional;
340  /// its type is defined as 'typedef list< CRef< CGBQualifier > > TQuals'
341  /// @return
342  /// - true, if a value has been assigned.
343  /// - false, otherwise.
344  bool IsSetQuals(void) const;
345 
346  /// Check if it is safe to call GetQuals method.
347  ///
348  /// @return
349  /// - true, if the data member is getatable.
350  /// - false, otherwise.
351  bool CanGetQuals(void) const;
352 
353  /// Reset Quals data member.
354  void ResetQuals(void);
355 
356  /// Get the Quals member data.
357  ///
358  /// @return
359  /// Reference to the member data.
360  const TQuals& GetQuals(void) const;
361 
362  /// Assign a value to Quals data member.
363  ///
364  /// @return
365  /// Reference to the data value.
366  TQuals& SetQuals(void);
367 
368  /// Check if a value has been assigned to Xrefs data member.
369  ///
370  /// Data member Xrefs is optional;
371  /// its type is defined as 'typedef list< CRef< CGBXref > > TXrefs'
372  /// @return
373  /// - true, if a value has been assigned.
374  /// - false, otherwise.
375  bool IsSetXrefs(void) const;
376 
377  /// Check if it is safe to call GetXrefs method.
378  ///
379  /// @return
380  /// - true, if the data member is getatable.
381  /// - false, otherwise.
382  bool CanGetXrefs(void) const;
383 
384  /// Reset Xrefs data member.
385  void ResetXrefs(void);
386 
387  /// Get the Xrefs member data.
388  ///
389  /// @return
390  /// Reference to the member data.
391  const TXrefs& GetXrefs(void) const;
392 
393  /// Assign a value to Xrefs data member.
394  ///
395  /// @return
396  /// Reference to the data value.
397  TXrefs& SetXrefs(void);
398 
399  /// Reset the whole object
400  virtual void Reset(void);
401 
402 
403 private:
404  // Prohibit copy constructor and assignment operator
407 
408  // data
409  Uint4 m_set_State[1];
410  string m_Key;
411  string m_Location;
412  list< CRef< CGBInterval > > m_Intervals;
413  string m_Operator;
416  list< CRef< CGBQualifier > > m_Quals;
417  list< CRef< CGBXref > > m_Xrefs;
418 };
419 
420 /* @} */
421 
422 
423 
424 
425 
426 ///////////////////////////////////////////////////////////
427 ///////////////////// inline methods //////////////////////
428 ///////////////////////////////////////////////////////////
429 inline
431 {
432  return ((m_set_State[0] & 0x3) != 0);
433 }
434 
435 inline
437 {
438  return IsSetKey();
439 }
440 
441 inline
443 {
444  if (!CanGetKey()) {
445  ThrowUnassigned(0);
446  }
447  return m_Key;
448 }
449 
450 inline
452 {
453  m_Key = value;
454  m_set_State[0] |= 0x3;
455 }
456 
457 inline
459 {
460  m_Key = std::forward<CGBFeature_Base::TKey>(value);
461  m_set_State[0] |= 0x3;
462 }
463 
464 inline
466 {
467 #ifdef _DEBUG
468  if (!IsSetKey()) {
470  }
471 #endif
472  m_set_State[0] |= 0x1;
473  return m_Key;
474 }
475 
476 inline
478 {
479  return ((m_set_State[0] & 0xc) != 0);
480 }
481 
482 inline
484 {
485  return IsSetLocation();
486 }
487 
488 inline
490 {
491  if (!CanGetLocation()) {
492  ThrowUnassigned(1);
493  }
494  return m_Location;
495 }
496 
497 inline
499 {
500  m_Location = value;
501  m_set_State[0] |= 0xc;
502 }
503 
504 inline
506 {
507  m_Location = std::forward<CGBFeature_Base::TLocation>(value);
508  m_set_State[0] |= 0xc;
509 }
510 
511 inline
513 {
514 #ifdef _DEBUG
515  if (!IsSetLocation()) {
517  }
518 #endif
519  m_set_State[0] |= 0x4;
520  return m_Location;
521 }
522 
523 inline
525 {
526  return ((m_set_State[0] & 0x30) != 0);
527 }
528 
529 inline
531 {
532  return true;
533 }
534 
535 inline
537 {
538  return m_Intervals;
539 }
540 
541 inline
543 {
544  m_set_State[0] |= 0x10;
545  return m_Intervals;
546 }
547 
548 inline
550 {
551  return ((m_set_State[0] & 0xc0) != 0);
552 }
553 
554 inline
556 {
557  return IsSetOperator();
558 }
559 
560 inline
562 {
563  if (!CanGetOperator()) {
564  ThrowUnassigned(3);
565  }
566  return m_Operator;
567 }
568 
569 inline
571 {
572  m_Operator = value;
573  m_set_State[0] |= 0xc0;
574 }
575 
576 inline
578 {
579  m_Operator = std::forward<CGBFeature_Base::TOperator>(value);
580  m_set_State[0] |= 0xc0;
581 }
582 
583 inline
585 {
586 #ifdef _DEBUG
587  if (!IsSetOperator()) {
589  }
590 #endif
591  m_set_State[0] |= 0x40;
592  return m_Operator;
593 }
594 
595 inline
597 {
598  return ((m_set_State[0] & 0x300) != 0);
599 }
600 
601 inline
603 {
604  return IsSetPartial5();
605 }
606 
607 inline
609 {
610  m_Partial5 = 0;
611  m_set_State[0] &= ~0x300;
612 }
613 
614 inline
616 {
617  if (!CanGetPartial5()) {
618  ThrowUnassigned(4);
619  }
620  return m_Partial5;
621 }
622 
623 inline
625 {
626  m_Partial5 = value;
627  m_set_State[0] |= 0x300;
628 }
629 
630 inline
632 {
633 #ifdef _DEBUG
634  if (!IsSetPartial5()) {
635  memset(&m_Partial5,UnassignedByte(),sizeof(m_Partial5));
636  }
637 #endif
638  m_set_State[0] |= 0x100;
639  return m_Partial5;
640 }
641 
642 inline
644 {
645  return ((m_set_State[0] & 0xc00) != 0);
646 }
647 
648 inline
650 {
651  return IsSetPartial3();
652 }
653 
654 inline
656 {
657  m_Partial3 = 0;
658  m_set_State[0] &= ~0xc00;
659 }
660 
661 inline
663 {
664  if (!CanGetPartial3()) {
665  ThrowUnassigned(5);
666  }
667  return m_Partial3;
668 }
669 
670 inline
672 {
673  m_Partial3 = value;
674  m_set_State[0] |= 0xc00;
675 }
676 
677 inline
679 {
680 #ifdef _DEBUG
681  if (!IsSetPartial3()) {
682  memset(&m_Partial3,UnassignedByte(),sizeof(m_Partial3));
683  }
684 #endif
685  m_set_State[0] |= 0x400;
686  return m_Partial3;
687 }
688 
689 inline
691 {
692  return ((m_set_State[0] & 0x3000) != 0);
693 }
694 
695 inline
697 {
698  return true;
699 }
700 
701 inline
703 {
704  return m_Quals;
705 }
706 
707 inline
709 {
710  m_set_State[0] |= 0x1000;
711  return m_Quals;
712 }
713 
714 inline
716 {
717  return ((m_set_State[0] & 0xc000) != 0);
718 }
719 
720 inline
722 {
723  return true;
724 }
725 
726 inline
728 {
729  return m_Xrefs;
730 }
731 
732 inline
734 {
735  m_set_State[0] |= 0x4000;
736  return m_Xrefs;
737 }
738 
739 ///////////////////////////////////////////////////////////
740 ////////////////// end of inline methods //////////////////
741 ///////////////////////////////////////////////////////////
742 
743 
744 
745 
746 
747 END_objects_SCOPE // namespace ncbi::objects::
748 
750 
751 
752 #endif // OBJECTS_GBSEQ_GBFEATURE_BASE_HPP
CGBFeature_Base –.
Definition: GBFeature_.hpp:80
CGBInterval –.
Definition: GBInterval.hpp:66
CGBQualifier –.
Definition: GBQualifier.hpp:66
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
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
const TQuals & GetQuals(void) const
Get the Quals member data.
Definition: GBFeature_.hpp:702
TKey & SetKey(void)
Assign a value to Key data member.
Definition: GBFeature_.hpp:465
TXrefs & SetXrefs(void)
Assign a value to Xrefs data member.
Definition: GBFeature_.hpp:733
list< CRef< CGBQualifier > > TQuals
Definition: GBFeature_.hpp:98
CGBFeature_Base & operator=(const CGBFeature_Base &)
bool IsSetIntervals(void) const
Check if a value has been assigned to Intervals data member.
Definition: GBFeature_.hpp:524
const TXrefs & GetXrefs(void) const
Get the Xrefs member data.
Definition: GBFeature_.hpp:727
bool CanGetIntervals(void) const
Check if it is safe to call GetIntervals method.
Definition: GBFeature_.hpp:530
list< CRef< CGBInterval > > m_Intervals
Definition: GBFeature_.hpp:412
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
Definition: GBFeature_.hpp:113
bool IsSetXrefs(void) const
Check if a value has been assigned to Xrefs data member.
Definition: GBFeature_.hpp:715
bool CanGetOperator(void) const
Check if it is safe to call GetOperator method.
Definition: GBFeature_.hpp:555
bool IsSetQuals(void) const
Check if a value has been assigned to Quals data member.
Definition: GBFeature_.hpp:690
bool CanGetXrefs(void) const
Check if it is safe to call GetXrefs method.
Definition: GBFeature_.hpp:721
bool CanGetKey(void) const
Check if it is safe to call GetKey method.
Definition: GBFeature_.hpp:436
bool CanGetPartial3(void) const
Check if it is safe to call GetPartial3 method.
Definition: GBFeature_.hpp:649
const TIntervals & GetIntervals(void) const
Get the Intervals member data.
Definition: GBFeature_.hpp:536
TOperator & SetOperator(void)
Assign a value to Operator data member.
Definition: GBFeature_.hpp:584
TIntervals & SetIntervals(void)
Assign a value to Intervals data member.
Definition: GBFeature_.hpp:542
list< CRef< CGBXref > > TXrefs
Definition: GBFeature_.hpp:99
bool CanGetPartial5(void) const
Check if it is safe to call GetPartial5 method.
Definition: GBFeature_.hpp:602
TPartial5 GetPartial5(void) const
Get the Partial5 member data.
Definition: GBFeature_.hpp:615
const TOperator & GetOperator(void) const
Get the Operator member data.
Definition: GBFeature_.hpp:561
void ResetPartial5(void)
Reset Partial5 data member.
Definition: GBFeature_.hpp:608
list< CRef< CGBInterval > > TIntervals
Definition: GBFeature_.hpp:94
bool IsSetKey(void) const
Check if a value has been assigned to Key data member.
Definition: GBFeature_.hpp:430
void ResetPartial3(void)
Reset Partial3 data member.
Definition: GBFeature_.hpp:655
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
Definition: GBFeature_.hpp:483
list< CRef< CGBXref > > m_Xrefs
Definition: GBFeature_.hpp:417
list< CRef< CGBQualifier > > m_Quals
Definition: GBFeature_.hpp:416
bool IsSetPartial5(void) const
Check if a value has been assigned to Partial5 data member.
Definition: GBFeature_.hpp:596
TPartial3 GetPartial3(void) const
Get the Partial3 member data.
Definition: GBFeature_.hpp:662
const TKey & GetKey(void) const
Get the Key member data.
Definition: GBFeature_.hpp:442
TQuals & SetQuals(void)
Assign a value to Quals data member.
Definition: GBFeature_.hpp:708
TPartial3 & SetPartial3(void)
Assign a value to Partial3 data member.
Definition: GBFeature_.hpp:678
TLocation & SetLocation(void)
Assign a value to Location data member.
Definition: GBFeature_.hpp:512
bool IsSetLocation(void) const
Check if a value has been assigned to Location data member.
Definition: GBFeature_.hpp:477
CGBFeature_Base(const CGBFeature_Base &)
const TLocation & GetLocation(void) const
Get the Location member data.
Definition: GBFeature_.hpp:489
TPartial5 & SetPartial5(void)
Assign a value to Partial5 data member.
Definition: GBFeature_.hpp:631
bool IsSetPartial3(void) const
Check if a value has been assigned to Partial3 data member.
Definition: GBFeature_.hpp:643
Uint4 m_set_State[1]
Definition: GBFeature_.hpp:409
CSerialObject Tparent
Definition: GBFeature_.hpp:81
bool IsSetOperator(void) const
Check if a value has been assigned to Operator data member.
Definition: GBFeature_.hpp:549
bool CanGetQuals(void) const
Check if it is safe to call GetQuals method.
Definition: GBFeature_.hpp:696
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun Jun 16 04:32:55 2024 by modify_doxy.py rev. 669887