NCBI C++ ToolKit
MolInfo_.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 MolInfo_.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/seq/seq.asn">seq.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seq/seq.def">seq.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_SEQ_MOLINFO_BASE_HPP
42 #define OBJECTS_SEQ_MOLINFO_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 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_Sequence
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///******* NOTE:
69 ///* mol-type, modif, method, and org are consolidated and expanded
70 ///* in Org-ref, BioSource, and MolInfo in this specification. They
71 ///* will be removed in later specifications. Do not use them in the
72 ///* the future. Instead expect the new structures.
73 ///*
74 ///***************************
75 ///********************************************************************
76 ///
77 /// MolInfo gives information on the
78 /// classification of the type and quality of the sequence
79 ///
80 /// WARNING: this will replace GIBB-mol, GIBB-mod, GIBB-method
81 ///
82 ///********************************************************************
83 ///
84 /// CMolInfo_Base --
85 ///
86 
88 {
90 public:
91  // constructor
92  CMolInfo_Base(void);
93  // destructor
94  virtual ~CMolInfo_Base(void);
95 
96  // type info
98 
99  enum EBiomol {
100  eBiomol_unknown = 0,
101  eBiomol_genomic = 1,
102  eBiomol_pre_RNA = 2, ///< precursor RNA of any sort really
103  eBiomol_mRNA = 3,
104  eBiomol_rRNA = 4,
105  eBiomol_tRNA = 5,
106  eBiomol_snRNA = 6,
107  eBiomol_scRNA = 7,
108  eBiomol_peptide = 8,
109  eBiomol_other_genetic = 9, ///< other genetic material
110  eBiomol_genomic_mRNA = 10, ///< reported a mix of genomic and cdna sequence
111  eBiomol_cRNA = 11, ///< viral RNA genome copy intermediate
112  eBiomol_snoRNA = 12, ///< small nucleolar RNA
113  eBiomol_transcribed_RNA = 13, ///< transcribed RNA other than existing classes
114  eBiomol_ncRNA = 14,
115  eBiomol_tmRNA = 15,
116  eBiomol_other = 255
117  };
118 
119  /// Access to EBiomol's attributes (values, names) as defined in spec
120  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EBiomol)(void);
121 
122  enum ETech {
123  eTech_unknown = 0,
124  eTech_standard = 1, ///< standard sequencing
125  eTech_est = 2, ///< Expressed Sequence Tag
126  eTech_sts = 3, ///< Sequence Tagged Site
127  eTech_survey = 4, ///< one-pass genomic sequence
128  eTech_genemap = 5, ///< from genetic mapping techniques
129  eTech_physmap = 6, ///< from physical mapping techniques
130  eTech_derived = 7, ///< derived from other data, not a primary entity
131  eTech_concept_trans = 8, ///< conceptual translation
132  eTech_seq_pept = 9, ///< peptide was sequenced
133  eTech_both = 10, ///< concept transl. w/ partial pept. seq.
134  eTech_seq_pept_overlap = 11, ///< sequenced peptide, ordered by overlap
135  eTech_seq_pept_homol = 12, ///< sequenced peptide, ordered by homology
136  eTech_concept_trans_a = 13, ///< conceptual transl. supplied by author
137  eTech_htgs_1 = 14, ///< unordered High Throughput sequence contig
138  eTech_htgs_2 = 15, ///< ordered High Throughput sequence contig
139  eTech_htgs_3 = 16, ///< finished High Throughput sequence
140  eTech_fli_cdna = 17, ///< full length insert cDNA
141  eTech_htgs_0 = 18, ///< single genomic reads for coordination
142  eTech_htc = 19, ///< high throughput cDNA
143  eTech_wgs = 20, ///< whole genome shotgun sequencing
144  eTech_barcode = 21, ///< barcode of life project
145  eTech_composite_wgs_htgs = 22, ///< composite of WGS and HTGS
146  eTech_tsa = 23, ///< transcriptome shotgun assembly
147  eTech_targeted = 24, ///< targeted locus sets/studies
148  eTech_other = 255 ///< use Source.techexp
149  };
150 
151  /// Access to ETech's attributes (values, names) as defined in spec
152  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ETech)(void);
153 
155  eCompleteness_unknown = 0,
156  eCompleteness_complete = 1, ///< complete biological entity
157  eCompleteness_partial = 2, ///< partial but no details given
158  eCompleteness_no_left = 3, ///< missing 5' or NH3 end
159  eCompleteness_no_right = 4, ///< missing 3' or COOH end
160  eCompleteness_no_ends = 5, ///< missing both ends
161  eCompleteness_has_left = 6, ///< 5' or NH3 end present
162  eCompleteness_has_right = 7, ///< 3' or COOH end present
163  eCompleteness_other = 255
164  };
165 
166  /// Access to ECompleteness's attributes (values, names) as defined in spec
167  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ECompleteness)(void);
168 
169  // types
170  typedef int TBiomol;
171  typedef int TTech;
172  typedef string TTechexp;
173  typedef int TCompleteness;
174  typedef string TGbmoltype;
175 
176  // member index
177  enum class E_memberIndex {
178  e__allMandatory = 0,
179  e_biomol,
180  e_tech,
181  e_techexp,
182  e_completeness,
183  e_gbmoltype
184  };
186 
187  // getters
188  // setters
189 
190  /// Check if a value has been assigned to Biomol data member.
191  ///
192  /// Data member Biomol is optional with default eBiomol_unknown;
193  /// its type is defined as 'typedef int TBiomol'
194  /// @return
195  /// - true, if a value has been assigned.
196  /// - false, otherwise.
197  bool IsSetBiomol(void) const;
198 
199  /// Check if it is safe to call GetBiomol method.
200  ///
201  /// @return
202  /// - true, if the data member is getatable.
203  /// - false, otherwise.
204  bool CanGetBiomol(void) const;
205 
206  /// Reset Biomol data member.
207  void ResetBiomol(void);
208 
209  /// Assign default value to Biomol data member.
210  void SetDefaultBiomol(void);
211 
212  /// Get the Biomol member data.
213  ///
214  /// @return
215  /// Copy of the member data.
216  TBiomol GetBiomol(void) const;
217 
218  /// Assign a value to Biomol data member.
219  ///
220  /// @param value
221  /// Value to assign
222  void SetBiomol(TBiomol value);
223 
224  /// Assign a value to Biomol data member.
225  ///
226  /// @return
227  /// Reference to the data value.
228  TBiomol& SetBiomol(void);
229 
230  /// Check if a value has been assigned to Tech data member.
231  ///
232  /// Data member Tech is optional with default eTech_unknown;
233  /// its type is defined as 'typedef int TTech'
234  /// @return
235  /// - true, if a value has been assigned.
236  /// - false, otherwise.
237  bool IsSetTech(void) const;
238 
239  /// Check if it is safe to call GetTech method.
240  ///
241  /// @return
242  /// - true, if the data member is getatable.
243  /// - false, otherwise.
244  bool CanGetTech(void) const;
245 
246  /// Reset Tech data member.
247  void ResetTech(void);
248 
249  /// Assign default value to Tech data member.
250  void SetDefaultTech(void);
251 
252  /// Get the Tech member data.
253  ///
254  /// @return
255  /// Copy of the member data.
256  TTech GetTech(void) const;
257 
258  /// Assign a value to Tech data member.
259  ///
260  /// @param value
261  /// Value to assign
262  void SetTech(TTech value);
263 
264  /// Assign a value to Tech data member.
265  ///
266  /// @return
267  /// Reference to the data value.
268  TTech& SetTech(void);
269 
270  /// explanation if tech not enough
271  ///
272  /// Completeness is not indicated in most records. For genomes, assume
273  /// the sequences are incomplete unless specifically marked as complete.
274  /// For mRNAs, assume the ends are not known exactly unless marked as
275  /// having the left or right end.
276  ///
277  /// Check if a value has been assigned to Techexp data member.
278  ///
279  /// Data member Techexp is optional;
280  /// its type is defined as 'typedef string TTechexp'
281  /// @return
282  /// - true, if a value has been assigned.
283  /// - false, otherwise.
284  bool IsSetTechexp(void) const;
285 
286  /// Check if it is safe to call GetTechexp method.
287  ///
288  /// @return
289  /// - true, if the data member is getatable.
290  /// - false, otherwise.
291  bool CanGetTechexp(void) const;
292 
293  /// Reset Techexp data member.
294  void ResetTechexp(void);
295 
296  /// Get the Techexp member data.
297  ///
298  /// @return
299  /// Reference to the member data.
300  const TTechexp& GetTechexp(void) const;
301 
302  /// Assign a value to Techexp data member.
303  ///
304  /// @param value
305  /// Value to assign
306  void SetTechexp(const TTechexp& value);
307  void SetTechexp(TTechexp&& value);
308 
309  /// Assign a value to Techexp data member.
310  ///
311  /// @return
312  /// Reference to the data value.
313  TTechexp& SetTechexp(void);
314 
315  /// Check if a value has been assigned to Completeness data member.
316  ///
317  /// Data member Completeness is optional with default eCompleteness_unknown;
318  /// its type is defined as 'typedef int TCompleteness'
319  /// @return
320  /// - true, if a value has been assigned.
321  /// - false, otherwise.
322  bool IsSetCompleteness(void) const;
323 
324  /// Check if it is safe to call GetCompleteness method.
325  ///
326  /// @return
327  /// - true, if the data member is getatable.
328  /// - false, otherwise.
329  bool CanGetCompleteness(void) const;
330 
331  /// Reset Completeness data member.
332  void ResetCompleteness(void);
333 
334  /// Assign default value to Completeness data member.
335  void SetDefaultCompleteness(void);
336 
337  /// Get the Completeness member data.
338  ///
339  /// @return
340  /// Copy of the member data.
341  TCompleteness GetCompleteness(void) const;
342 
343  /// Assign a value to Completeness data member.
344  ///
345  /// @param value
346  /// Value to assign
348 
349  /// Assign a value to Completeness data member.
350  ///
351  /// @return
352  /// Reference to the data value.
354 
355  /// identifies particular ncRNA
356  /// Check if a value has been assigned to Gbmoltype data member.
357  ///
358  /// Data member Gbmoltype is optional;
359  /// its type is defined as 'typedef string TGbmoltype'
360  /// @return
361  /// - true, if a value has been assigned.
362  /// - false, otherwise.
363  bool IsSetGbmoltype(void) const;
364 
365  /// Check if it is safe to call GetGbmoltype method.
366  ///
367  /// @return
368  /// - true, if the data member is getatable.
369  /// - false, otherwise.
370  bool CanGetGbmoltype(void) const;
371 
372  /// Reset Gbmoltype data member.
373  void ResetGbmoltype(void);
374 
375  /// Get the Gbmoltype member data.
376  ///
377  /// @return
378  /// Reference to the member data.
379  const TGbmoltype& GetGbmoltype(void) const;
380 
381  /// Assign a value to Gbmoltype data member.
382  ///
383  /// @param value
384  /// Value to assign
385  void SetGbmoltype(const TGbmoltype& value);
386  void SetGbmoltype(TGbmoltype&& value);
387 
388  /// Assign a value to Gbmoltype data member.
389  ///
390  /// @return
391  /// Reference to the data value.
392  TGbmoltype& SetGbmoltype(void);
393 
394  /// Reset the whole object
395  virtual void Reset(void);
396 
397 
398 private:
399  // Prohibit copy constructor and assignment operator
402 
403  // data
404  Uint4 m_set_State[1];
405  int m_Biomol;
406  int m_Tech;
407  string m_Techexp;
409  string m_Gbmoltype;
410 };
411 
412 /* @} */
413 
414 
415 
416 
417 
418 ///////////////////////////////////////////////////////////
419 ///////////////////// inline methods //////////////////////
420 ///////////////////////////////////////////////////////////
421 inline
423 {
424  return ((m_set_State[0] & 0x3) != 0);
425 }
426 
427 inline
429 {
430  return true;
431 }
432 
433 inline
435 {
437  m_set_State[0] &= ~0x3;
438 }
439 
440 inline
442 {
443  ResetBiomol();
444 }
445 
446 inline
448 {
449  return m_Biomol;
450 }
451 
452 inline
454 {
455  m_Biomol = value;
456  m_set_State[0] |= 0x3;
457 }
458 
459 inline
461 {
462 #ifdef _DEBUG
463  if (!IsSetBiomol()) {
464  memset(&m_Biomol,UnassignedByte(),sizeof(m_Biomol));
465  }
466 #endif
467  m_set_State[0] |= 0x1;
468  return m_Biomol;
469 }
470 
471 inline
472 bool CMolInfo_Base::IsSetTech(void) const
473 {
474  return ((m_set_State[0] & 0xc) != 0);
475 }
476 
477 inline
479 {
480  return true;
481 }
482 
483 inline
485 {
487  m_set_State[0] &= ~0xc;
488 }
489 
490 inline
492 {
493  ResetTech();
494 }
495 
496 inline
498 {
499  return m_Tech;
500 }
501 
502 inline
504 {
505  m_Tech = value;
506  m_set_State[0] |= 0xc;
507 }
508 
509 inline
511 {
512 #ifdef _DEBUG
513  if (!IsSetTech()) {
514  memset(&m_Tech,UnassignedByte(),sizeof(m_Tech));
515  }
516 #endif
517  m_set_State[0] |= 0x4;
518  return m_Tech;
519 }
520 
521 inline
523 {
524  return ((m_set_State[0] & 0x30) != 0);
525 }
526 
527 inline
529 {
530  return IsSetTechexp();
531 }
532 
533 inline
535 {
536  if (!CanGetTechexp()) {
537  ThrowUnassigned(2);
538  }
539  return m_Techexp;
540 }
541 
542 inline
544 {
545  m_Techexp = value;
546  m_set_State[0] |= 0x30;
547 }
548 
549 inline
551 {
552  m_Techexp = std::forward<CMolInfo_Base::TTechexp>(value);
553  m_set_State[0] |= 0x30;
554 }
555 
556 inline
558 {
559 #ifdef _DEBUG
560  if (!IsSetTechexp()) {
562  }
563 #endif
564  m_set_State[0] |= 0x10;
565  return m_Techexp;
566 }
567 
568 inline
570 {
571  return ((m_set_State[0] & 0xc0) != 0);
572 }
573 
574 inline
576 {
577  return true;
578 }
579 
580 inline
582 {
584  m_set_State[0] &= ~0xc0;
585 }
586 
587 inline
589 {
591 }
592 
593 inline
595 {
596  return m_Completeness;
597 }
598 
599 inline
601 {
603  m_set_State[0] |= 0xc0;
604 }
605 
606 inline
608 {
609 #ifdef _DEBUG
610  if (!IsSetCompleteness()) {
611  memset(&m_Completeness,UnassignedByte(),sizeof(m_Completeness));
612  }
613 #endif
614  m_set_State[0] |= 0x40;
615  return m_Completeness;
616 }
617 
618 inline
620 {
621  return ((m_set_State[0] & 0x300) != 0);
622 }
623 
624 inline
626 {
627  return IsSetGbmoltype();
628 }
629 
630 inline
632 {
633  if (!CanGetGbmoltype()) {
634  ThrowUnassigned(4);
635  }
636  return m_Gbmoltype;
637 }
638 
639 inline
641 {
642  m_Gbmoltype = value;
643  m_set_State[0] |= 0x300;
644 }
645 
646 inline
648 {
649  m_Gbmoltype = std::forward<CMolInfo_Base::TGbmoltype>(value);
650  m_set_State[0] |= 0x300;
651 }
652 
653 inline
655 {
656 #ifdef _DEBUG
657  if (!IsSetGbmoltype()) {
659  }
660 #endif
661  m_set_State[0] |= 0x100;
662  return m_Gbmoltype;
663 }
664 
665 ///////////////////////////////////////////////////////////
666 ////////////////// end of inline methods //////////////////
667 ///////////////////////////////////////////////////////////
668 
669 
670 
671 
672 
673 END_objects_SCOPE // namespace ncbi::objects::
674 
676 
677 
678 #endif // OBJECTS_SEQ_MOLINFO_BASE_HPP
******* NOTE: * mol-type, modif, method, and org are consolidated and expanded * in Org-ref,...
Definition: MolInfo_.hpp:88
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_SEQ_EXPORT
Definition: ncbi_export.h:825
const TGbmoltype & GetGbmoltype(void) const
Get the Gbmoltype member data.
Definition: MolInfo_.hpp:631
bool IsSetCompleteness(void) const
Check if a value has been assigned to Completeness data member.
Definition: MolInfo_.hpp:569
bool CanGetBiomol(void) const
Check if it is safe to call GetBiomol method.
Definition: MolInfo_.hpp:428
bool CanGetTechexp(void) const
Check if it is safe to call GetTechexp method.
Definition: MolInfo_.hpp:528
TTech & SetTech(void)
Assign a value to Tech data member.
Definition: MolInfo_.hpp:510
string m_Techexp
Definition: MolInfo_.hpp:407
Uint4 m_set_State[1]
Definition: MolInfo_.hpp:404
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
Definition: MolInfo_.hpp:185
bool IsSetTechexp(void) const
explanation if tech not enough
Definition: MolInfo_.hpp:522
bool CanGetGbmoltype(void) const
Check if it is safe to call GetGbmoltype method.
Definition: MolInfo_.hpp:625
string TTechexp
Definition: MolInfo_.hpp:172
void ResetCompleteness(void)
Reset Completeness data member.
Definition: MolInfo_.hpp:581
string m_Gbmoltype
Definition: MolInfo_.hpp:409
bool IsSetBiomol(void) const
Check if a value has been assigned to Biomol data member.
Definition: MolInfo_.hpp:422
TTech GetTech(void) const
Get the Tech member data.
Definition: MolInfo_.hpp:497
TTechexp & SetTechexp(void)
Assign a value to Techexp data member.
Definition: MolInfo_.hpp:557
TBiomol & SetBiomol(void)
Assign a value to Biomol data member.
Definition: MolInfo_.hpp:460
const TTechexp & GetTechexp(void) const
Get the Techexp member data.
Definition: MolInfo_.hpp:534
TGbmoltype & SetGbmoltype(void)
Assign a value to Gbmoltype data member.
Definition: MolInfo_.hpp:654
void ResetTech(void)
Reset Tech data member.
Definition: MolInfo_.hpp:484
CSerialObject Tparent
Definition: MolInfo_.hpp:89
DECLARE_INTERNAL_TYPE_INFO()
TCompleteness & SetCompleteness(void)
Assign a value to Completeness data member.
Definition: MolInfo_.hpp:607
TBiomol GetBiomol(void) const
Get the Biomol member data.
Definition: MolInfo_.hpp:447
void ResetBiomol(void)
Reset Biomol data member.
Definition: MolInfo_.hpp:434
CMolInfo_Base & operator=(const CMolInfo_Base &)
bool IsSetTech(void) const
Check if a value has been assigned to Tech data member.
Definition: MolInfo_.hpp:472
bool CanGetTech(void) const
Check if it is safe to call GetTech method.
Definition: MolInfo_.hpp:478
TCompleteness GetCompleteness(void) const
Get the Completeness member data.
Definition: MolInfo_.hpp:594
void SetDefaultTech(void)
Assign default value to Tech data member.
Definition: MolInfo_.hpp:491
bool CanGetCompleteness(void) const
Check if it is safe to call GetCompleteness method.
Definition: MolInfo_.hpp:575
void SetDefaultBiomol(void)
Assign default value to Biomol data member.
Definition: MolInfo_.hpp:441
void SetDefaultCompleteness(void)
Assign default value to Completeness data member.
Definition: MolInfo_.hpp:588
int m_Completeness
Definition: MolInfo_.hpp:408
CMolInfo_Base(const CMolInfo_Base &)
string TGbmoltype
Definition: MolInfo_.hpp:174
bool IsSetGbmoltype(void) const
identifies particular ncRNA Check if a value has been assigned to Gbmoltype data member.
Definition: MolInfo_.hpp:619
@ eCompleteness_unknown
Definition: MolInfo_.hpp:155
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void SetTech(CRef< objects::CSeq_entry > entry, objects::CMolInfo::TTech tech)
void SetCompleteness(CRef< objects::CSeq_entry > entry, objects::CMolInfo::TCompleteness completeness)
void SetBiomol(CRef< objects::CSeq_entry > entry, objects::CMolInfo::TBiomol biomol)
Modified on Thu Apr 11 15:18:01 2024 by modify_doxy.py rev. 669887