NCBI C++ ToolKit
Bioseq_set_.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 Bioseq_set_.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/seqset/seqset.asn">seqset.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqset/seqset.def">seqset.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_SEQSET_BIOSEQ_SET_BASE_HPP
42 #define OBJECTS_SEQSET_BIOSEQ_SET_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 CDate;
62 class CDbtag;
63 class CObject_id;
64 class CSeq_annot;
65 class CSeq_descr;
66 class CSeq_entry;
67 
68 
69 // generated classes
70 
71 
72 /** @addtogroup dataspec_NCBI_Seqset
73  *
74  * @{
75  */
76 
77 /////////////////////////////////////////////////////////////////////////////
78 ///*** Sequence Collections ********************************
79 ///*
80 /// just a collection
81 ///
82 /// CBioseq_set_Base --
83 ///
84 
86 {
88 public:
89  // constructor
90  CBioseq_set_Base(void);
91  // destructor
92  virtual ~CBioseq_set_Base(void);
93 
94  // type info
96 
97  enum EClass {
98  eClass_not_set = 0,
99  eClass_nuc_prot = 1, ///< nuc acid and coded proteins
100  eClass_segset = 2, ///< segmented sequence + parts
101  eClass_conset = 3, ///< constructed sequence + parts
102  eClass_parts = 4, ///< parts for 2 or 3
103  eClass_gibb = 5, ///< geninfo backbone
104  eClass_gi = 6, ///< geninfo
105  eClass_genbank = 7, ///< converted genbank
106  eClass_pir = 8, ///< converted pir
107  eClass_pub_set = 9, ///< all the seqs from a single publication
108  eClass_equiv = 10, ///< a set of equivalent maps or seqs
109  eClass_swissprot = 11, ///< converted SWISSPROT
110  eClass_pdb_entry = 12, ///< a complete PDB entry
111  eClass_mut_set = 13, ///< set of mutations
112  eClass_pop_set = 14, ///< population study
113  eClass_phy_set = 15, ///< phylogenetic study
114  eClass_eco_set = 16, ///< ecological sample study
115  eClass_gen_prod_set = 17, ///< genomic products, chrom+mRNA+protein
116  eClass_wgs_set = 18, ///< whole genome shotgun project
117  eClass_named_annot = 19, ///< named annotation set
118  eClass_named_annot_prod = 20, ///< with instantiated mRNA+protein
119  eClass_read_set = 21, ///< set from a single read
120  eClass_paired_end_reads = 22, ///< paired sequences within a read-set
121  eClass_small_genome_set = 23, ///< viral segments or mitochondrial minicircles
122  eClass_other = 255
123  };
124 
125  /// Access to EClass's attributes (values, names) as defined in spec
126  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EClass)(void);
127 
128  // types
129  typedef CObject_id TId;
130  typedef CDbtag TColl;
131  typedef int TLevel;
132  typedef EClass TClass;
133  typedef string TRelease;
134  typedef CDate TDate;
136  typedef list< CRef< CSeq_entry > > TSeq_set;
137  typedef list< CRef< CSeq_annot > > TAnnot;
138 
139  // member index
140  enum class E_memberIndex {
141  e__allMandatory = 0,
142  e_id,
143  e_coll,
144  e_level,
145  e_class,
146  e_release,
147  e_date,
148  e_descr,
149  e_seq_set,
150  e_annot
151  };
153 
154  // getters
155  // setters
156 
157  /// Check if a value has been assigned to Id data member.
158  ///
159  /// Data member Id is optional;
160  /// its type is defined as 'typedef CObject_id TId'
161  /// @return
162  /// - true, if a value has been assigned.
163  /// - false, otherwise.
164  bool IsSetId(void) const;
165 
166  /// Check if it is safe to call GetId method.
167  ///
168  /// @return
169  /// - true, if the data member is getatable.
170  /// - false, otherwise.
171  bool CanGetId(void) const;
172 
173  /// Reset Id data member.
174  void ResetId(void);
175 
176  /// Get the Id member data.
177  ///
178  /// @return
179  /// Reference to the member data.
180  const TId& GetId(void) const;
181 
182  /// Assign a value to Id data member.
183  ///
184  /// @param value
185  /// Reference to value.
186  void SetId(TId& value);
187 
188  /// Assign a value to Id data member.
189  ///
190  /// @return
191  /// Reference to the data value.
192  TId& SetId(void);
193 
194  /// to identify a collection
195  /// Check if a value has been assigned to Coll data member.
196  ///
197  /// Data member Coll is optional;
198  /// its type is defined as 'typedef CDbtag TColl'
199  /// @return
200  /// - true, if a value has been assigned.
201  /// - false, otherwise.
202  bool IsSetColl(void) const;
203 
204  /// Check if it is safe to call GetColl method.
205  ///
206  /// @return
207  /// - true, if the data member is getatable.
208  /// - false, otherwise.
209  bool CanGetColl(void) const;
210 
211  /// Reset Coll data member.
212  void ResetColl(void);
213 
214  /// Get the Coll member data.
215  ///
216  /// @return
217  /// Reference to the member data.
218  const TColl& GetColl(void) const;
219 
220  /// Assign a value to Coll data member.
221  ///
222  /// @param value
223  /// Reference to value.
224  void SetColl(TColl& value);
225 
226  /// Assign a value to Coll data member.
227  ///
228  /// @return
229  /// Reference to the data value.
230  TColl& SetColl(void);
231 
232  /// nesting level
233  /// Check if a value has been assigned to Level data member.
234  ///
235  /// Data member Level is optional;
236  /// its type is defined as 'typedef int TLevel'
237  /// @return
238  /// - true, if a value has been assigned.
239  /// - false, otherwise.
240  bool IsSetLevel(void) const;
241 
242  /// Check if it is safe to call GetLevel method.
243  ///
244  /// @return
245  /// - true, if the data member is getatable.
246  /// - false, otherwise.
247  bool CanGetLevel(void) const;
248 
249  /// Reset Level data member.
250  void ResetLevel(void);
251 
252  /// Get the Level member data.
253  ///
254  /// @return
255  /// Copy of the member data.
256  TLevel GetLevel(void) const;
257 
258  /// Assign a value to Level data member.
259  ///
260  /// @param value
261  /// Value to assign
262  void SetLevel(TLevel value);
263 
264  /// Assign a value to Level data member.
265  ///
266  /// @return
267  /// Reference to the data value.
268  TLevel& SetLevel(void);
269 
270  /// Check if a value has been assigned to Class data member.
271  ///
272  /// Data member Class is optional with default eClass_not_set;
273  /// its type is defined as 'typedef EClass TClass'
274  /// @return
275  /// - true, if a value has been assigned.
276  /// - false, otherwise.
277  bool IsSetClass(void) const;
278 
279  /// Check if it is safe to call GetClass method.
280  ///
281  /// @return
282  /// - true, if the data member is getatable.
283  /// - false, otherwise.
284  bool CanGetClass(void) const;
285 
286  /// Reset Class data member.
287  void ResetClass(void);
288 
289  /// Assign default value to Class data member.
290  void SetDefaultClass(void);
291 
292  /// Get the Class member data.
293  ///
294  /// @return
295  /// Copy of the member data.
296  TClass GetClass(void) const;
297 
298  /// Assign a value to Class data member.
299  ///
300  /// @param value
301  /// Value to assign
302  void SetClass(TClass value);
303 
304  /// Assign a value to Class data member.
305  ///
306  /// @return
307  /// Reference to the data value.
308  TClass& SetClass(void);
309 
310  /// Check if a value has been assigned to Release data member.
311  ///
312  /// Data member Release is optional;
313  /// its type is defined as 'typedef string TRelease'
314  /// @return
315  /// - true, if a value has been assigned.
316  /// - false, otherwise.
317  bool IsSetRelease(void) const;
318 
319  /// Check if it is safe to call GetRelease method.
320  ///
321  /// @return
322  /// - true, if the data member is getatable.
323  /// - false, otherwise.
324  bool CanGetRelease(void) const;
325 
326  /// Reset Release data member.
327  void ResetRelease(void);
328 
329  /// Get the Release member data.
330  ///
331  /// @return
332  /// Reference to the member data.
333  const TRelease& GetRelease(void) const;
334 
335  /// Assign a value to Release data member.
336  ///
337  /// @param value
338  /// Value to assign
339  void SetRelease(const TRelease& value);
340  void SetRelease(TRelease&& value);
341 
342  /// Assign a value to Release data member.
343  ///
344  /// @return
345  /// Reference to the data value.
346  TRelease& SetRelease(void);
347 
348  /// Check if a value has been assigned to Date data member.
349  ///
350  /// Data member Date is optional;
351  /// its type is defined as 'typedef CDate TDate'
352  /// @return
353  /// - true, if a value has been assigned.
354  /// - false, otherwise.
355  bool IsSetDate(void) const;
356 
357  /// Check if it is safe to call GetDate method.
358  ///
359  /// @return
360  /// - true, if the data member is getatable.
361  /// - false, otherwise.
362  bool CanGetDate(void) const;
363 
364  /// Reset Date data member.
365  void ResetDate(void);
366 
367  /// Get the Date member data.
368  ///
369  /// @return
370  /// Reference to the member data.
371  const TDate& GetDate(void) const;
372 
373  /// Assign a value to Date data member.
374  ///
375  /// @param value
376  /// Reference to value.
377  void SetDate(TDate& value);
378 
379  /// Assign a value to Date data member.
380  ///
381  /// @return
382  /// Reference to the data value.
383  TDate& SetDate(void);
384 
385  /// Check if a value has been assigned to Descr data member.
386  ///
387  /// Data member Descr is optional;
388  /// its type is defined as 'typedef CSeq_descr TDescr'
389  /// @return
390  /// - true, if a value has been assigned.
391  /// - false, otherwise.
392  bool IsSetDescr(void) const;
393 
394  /// Check if it is safe to call GetDescr method.
395  ///
396  /// @return
397  /// - true, if the data member is getatable.
398  /// - false, otherwise.
399  bool CanGetDescr(void) const;
400 
401  /// Reset Descr data member.
402  void ResetDescr(void);
403 
404  /// Get the Descr member data.
405  ///
406  /// @return
407  /// Reference to the member data.
408  const TDescr& GetDescr(void) const;
409 
410  /// Assign a value to Descr data member.
411  ///
412  /// @param value
413  /// Reference to value.
414  void SetDescr(TDescr& value);
415 
416  /// Assign a value to Descr data member.
417  ///
418  /// @return
419  /// Reference to the data value.
420  TDescr& SetDescr(void);
421 
422  /// Check if a value has been assigned to Seq_set data member.
423  ///
424  /// Data member Seq_set is mandatory;
425  /// its type is defined as 'typedef list< CRef< CSeq_entry > > TSeq_set'
426  /// @return
427  /// - true, if a value has been assigned.
428  /// - false, otherwise.
429  bool IsSetSeq_set(void) const;
430 
431  /// Check if it is safe to call GetSeq_set method.
432  ///
433  /// @return
434  /// - true, if the data member is getatable.
435  /// - false, otherwise.
436  bool CanGetSeq_set(void) const;
437 
438  /// Reset Seq_set data member.
439  void ResetSeq_set(void);
440 
441  /// Get the Seq_set member data.
442  ///
443  /// @return
444  /// Reference to the member data.
445  const TSeq_set& GetSeq_set(void) const;
446 
447  /// Assign a value to Seq_set data member.
448  ///
449  /// @return
450  /// Reference to the data value.
451  TSeq_set& SetSeq_set(void);
452 
453  /// Check if a value has been assigned to Annot data member.
454  ///
455  /// Data member Annot is optional;
456  /// its type is defined as 'typedef list< CRef< CSeq_annot > > TAnnot'
457  /// @return
458  /// - true, if a value has been assigned.
459  /// - false, otherwise.
460  bool IsSetAnnot(void) const;
461 
462  /// Check if it is safe to call GetAnnot method.
463  ///
464  /// @return
465  /// - true, if the data member is getatable.
466  /// - false, otherwise.
467  bool CanGetAnnot(void) const;
468 
469  /// Reset Annot data member.
470  void ResetAnnot(void);
471 
472  /// Get the Annot member data.
473  ///
474  /// @return
475  /// Reference to the member data.
476  const TAnnot& GetAnnot(void) const;
477 
478  /// Assign a value to Annot data member.
479  ///
480  /// @return
481  /// Reference to the data value.
482  TAnnot& SetAnnot(void);
483 
484  /// Reset the whole object
485  virtual void Reset(void);
486 
487 
488 private:
489  // Prohibit copy constructor and assignment operator
492 
493  // data
494  Uint4 m_set_State[1];
497  int m_Level;
499  string m_Release;
502  list< CRef< CSeq_entry > > m_Seq_set;
503  list< CRef< CSeq_annot > > m_Annot;
504 };
505 
506 /* @} */
507 
508 
509 
510 
511 
512 ///////////////////////////////////////////////////////////
513 ///////////////////// inline methods //////////////////////
514 ///////////////////////////////////////////////////////////
515 inline
517 {
518  return m_Id.NotEmpty();
519 }
520 
521 inline
523 {
524  return IsSetId();
525 }
526 
527 inline
529 {
530  if (!CanGetId()) {
531  ThrowUnassigned(0);
532  }
533  return (*m_Id);
534 }
535 
536 inline
538 {
539  return m_Coll.NotEmpty();
540 }
541 
542 inline
544 {
545  return IsSetColl();
546 }
547 
548 inline
550 {
551  if (!CanGetColl()) {
552  ThrowUnassigned(1);
553  }
554  return (*m_Coll);
555 }
556 
557 inline
559 {
560  return ((m_set_State[0] & 0x30) != 0);
561 }
562 
563 inline
565 {
566  return IsSetLevel();
567 }
568 
569 inline
571 {
572  m_Level = 0;
573  m_set_State[0] &= ~0x30;
574 }
575 
576 inline
578 {
579  if (!CanGetLevel()) {
580  ThrowUnassigned(2);
581  }
582  return m_Level;
583 }
584 
585 inline
587 {
588  m_Level = value;
589  m_set_State[0] |= 0x30;
590 }
591 
592 inline
594 {
595 #ifdef _DEBUG
596  if (!IsSetLevel()) {
597  memset(&m_Level,UnassignedByte(),sizeof(m_Level));
598  }
599 #endif
600  m_set_State[0] |= 0x10;
601  return m_Level;
602 }
603 
604 inline
606 {
607  return ((m_set_State[0] & 0xc0) != 0);
608 }
609 
610 inline
612 {
613  return true;
614 }
615 
616 inline
618 {
620  m_set_State[0] &= ~0xc0;
621 }
622 
623 inline
625 {
626  ResetClass();
627 }
628 
629 inline
631 {
632  return m_Class;
633 }
634 
635 inline
637 {
638  m_Class = value;
639  m_set_State[0] |= 0xc0;
640 }
641 
642 inline
644 {
645 #ifdef _DEBUG
646  if (!IsSetClass()) {
647  memset(&m_Class,UnassignedByte(),sizeof(m_Class));
648  }
649 #endif
650  m_set_State[0] |= 0x40;
651  return m_Class;
652 }
653 
654 inline
656 {
657  return ((m_set_State[0] & 0x300) != 0);
658 }
659 
660 inline
662 {
663  return IsSetRelease();
664 }
665 
666 inline
668 {
669  if (!CanGetRelease()) {
670  ThrowUnassigned(4);
671  }
672  return m_Release;
673 }
674 
675 inline
677 {
678  m_Release = value;
679  m_set_State[0] |= 0x300;
680 }
681 
682 inline
684 {
685  m_Release = std::forward<CBioseq_set_Base::TRelease>(value);
686  m_set_State[0] |= 0x300;
687 }
688 
689 inline
691 {
692 #ifdef _DEBUG
693  if (!IsSetRelease()) {
695  }
696 #endif
697  m_set_State[0] |= 0x100;
698  return m_Release;
699 }
700 
701 inline
703 {
704  return m_Date.NotEmpty();
705 }
706 
707 inline
709 {
710  return IsSetDate();
711 }
712 
713 inline
715 {
716  if (!CanGetDate()) {
717  ThrowUnassigned(5);
718  }
719  return (*m_Date);
720 }
721 
722 inline
724 {
725  return m_Descr.NotEmpty();
726 }
727 
728 inline
730 {
731  return IsSetDescr();
732 }
733 
734 inline
736 {
737  if (!CanGetDescr()) {
738  ThrowUnassigned(6);
739  }
740  return (*m_Descr);
741 }
742 
743 inline
745 {
746  return ((m_set_State[0] & 0xc000) != 0);
747 }
748 
749 inline
751 {
752  return true;
753 }
754 
755 inline
757 {
758  return m_Seq_set;
759 }
760 
761 inline
763 {
764  m_set_State[0] |= 0x4000;
765  return m_Seq_set;
766 }
767 
768 inline
770 {
771  return ((m_set_State[0] & 0x30000) != 0);
772 }
773 
774 inline
776 {
777  return true;
778 }
779 
780 inline
782 {
783  return m_Annot;
784 }
785 
786 inline
788 {
789  m_set_State[0] |= 0x10000;
790  return m_Annot;
791 }
792 
793 ///////////////////////////////////////////////////////////
794 ////////////////// end of inline methods //////////////////
795 ///////////////////////////////////////////////////////////
796 
797 
798 
799 
800 
801 END_objects_SCOPE // namespace ncbi::objects::
802 
804 
805 
806 #endif // OBJECTS_SEQSET_BIOSEQ_SET_BASE_HPP
*** Sequence Collections ******************************** * just a collection
Definition: Bioseq_set_.hpp:86
Definition: Date.hpp:53
Definition: Dbtag.hpp:53
CRef –.
Definition: ncbiobj.hpp:618
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
Definition: Seq_entry.hpp:56
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
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_SEQSET_EXPORT
Definition: ncbi_export.h:793
CBioseq_set_Base & operator=(const CBioseq_set_Base &)
bool IsSetClass(void) const
Check if a value has been assigned to Class data member.
bool CanGetRelease(void) const
Check if it is safe to call GetRelease method.
Tparent::CMemberIndex< E_memberIndex, 10 > TmemberIndex
const TDescr & GetDescr(void) const
Get the Descr member data.
list< CRef< CSeq_entry > > m_Seq_set
TRelease & SetRelease(void)
Assign a value to Release data member.
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
bool IsSetColl(void) const
to identify a collection Check if a value has been assigned to Coll data member.
bool CanGetAnnot(void) const
Check if it is safe to call GetAnnot method.
bool CanGetSeq_set(void) const
Check if it is safe to call GetSeq_set method.
void SetDefaultClass(void)
Assign default value to Class data member.
CSeq_descr TDescr
bool CanGetDate(void) const
Check if it is safe to call GetDate method.
TClass GetClass(void) const
Get the Class member data.
CRef< TColl > m_Coll
bool IsSetDate(void) const
Check if a value has been assigned to Date data member.
bool IsSetRelease(void) const
Check if a value has been assigned to Release data member.
CRef< TDescr > m_Descr
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
list< CRef< CSeq_annot > > m_Annot
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
void ResetLevel(void)
Reset Level data member.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
Uint4 m_set_State[1]
bool IsSetSeq_set(void) const
Check if a value has been assigned to Seq_set data member.
CSerialObject Tparent
Definition: Bioseq_set_.hpp:87
const TRelease & GetRelease(void) const
Get the Release member data.
bool IsSetLevel(void) const
nesting level Check if a value has been assigned to Level data member.
bool IsSetDescr(void) const
Check if a value has been assigned to Descr data member.
void ResetClass(void)
Reset Class data member.
const TDate & GetDate(void) const
Get the Date member data.
bool CanGetClass(void) const
Check if it is safe to call GetClass method.
list< CRef< CSeq_annot > > TAnnot
TLevel & SetLevel(void)
Assign a value to Level data member.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
const TAnnot & GetAnnot(void) const
Get the Annot member data.
CBioseq_set_Base(const CBioseq_set_Base &)
bool CanGetColl(void) const
Check if it is safe to call GetColl method.
const TColl & GetColl(void) const
Get the Coll member data.
bool CanGetLevel(void) const
Check if it is safe to call GetLevel method.
TClass & SetClass(void)
Assign a value to Class data member.
list< CRef< CSeq_entry > > TSeq_set
bool CanGetId(void) const
Check if it is safe to call GetId method.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
CRef< TId > m_Id
const TId & GetId(void) const
Get the Id member data.
CRef< TDate > m_Date
TLevel GetLevel(void) const
Get the Level member data.
Modified on Wed Nov 29 02:25:44 2023 by modify_doxy.py rev. 669887