NCBI C++ ToolKit
BioSource_.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 BioSource_.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/seqfeat/seqfeat.asn">seqfeat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqfeat/seqfeat.def">seqfeat.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_SEQFEAT_BIOSOURCE_BASE_HPP
42 #define OBJECTS_SEQFEAT_BIOSOURCE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
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 // forward declarations
60 class COrg_ref;
61 class CPCRReactionSet;
62 class CSubSource;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_BioSource
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///********************************************************************
75 ///
76 /// BioSource gives the source of the biological material
77 /// for sequences
78 ///
79 ///********************************************************************
80 ///
81 /// CBioSource_Base --
82 ///
83 
85 {
87 public:
88  // constructor
89  CBioSource_Base(void);
90  // destructor
91  virtual ~CBioSource_Base(void);
92 
93  // type info
95 
96  /// biological context
97  enum EGenome {
98  eGenome_unknown = 0,
99  eGenome_genomic = 1,
100  eGenome_chloroplast = 2,
101  eGenome_chromoplast = 3,
102  eGenome_kinetoplast = 4,
103  eGenome_mitochondrion = 5,
104  eGenome_plastid = 6,
105  eGenome_macronuclear = 7,
106  eGenome_extrachrom = 8,
107  eGenome_plasmid = 9,
108  eGenome_transposon = 10,
109  eGenome_insertion_seq = 11,
110  eGenome_cyanelle = 12,
111  eGenome_proviral = 13,
112  eGenome_virion = 14,
113  eGenome_nucleomorph = 15,
114  eGenome_apicoplast = 16,
115  eGenome_leucoplast = 17,
116  eGenome_proplastid = 18,
117  eGenome_endogenous_virus = 19,
118  eGenome_hydrogenosome = 20,
119  eGenome_chromosome = 21,
120  eGenome_chromatophore = 22,
121  eGenome_plasmid_in_mitochondrion = 23,
122  eGenome_plasmid_in_plastid = 24
123  };
124 
125  /// Access to EGenome's attributes (values, names) as defined in spec
126  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EGenome)(void);
127 
128  enum EOrigin {
129  eOrigin_unknown = 0,
130  eOrigin_natural = 1, ///< normal biological entity
131  eOrigin_natmut = 2, ///< naturally occurring mutant
132  eOrigin_mut = 3, ///< artificially mutagenized
133  eOrigin_artificial = 4, ///< artificially engineered
134  eOrigin_synthetic = 5, ///< purely synthetic
135  eOrigin_other = 255
136  };
137 
138  /// Access to EOrigin's attributes (values, names) as defined in spec
139  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EOrigin)(void);
140 
141  // types
142  typedef int TGenome;
143  typedef int TOrigin;
144  typedef COrg_ref TOrg;
145  typedef list< CRef< CSubSource > > TSubtype;
147 
148  // member index
149  enum class E_memberIndex {
150  e__allMandatory = 0,
151  e_genome,
152  e_origin,
153  e_org,
154  e_subtype,
155  e_is_focus,
156  e_pcr_primers
157  };
159 
160  // getters
161  // setters
162 
163  /// Check if a value has been assigned to Genome data member.
164  ///
165  /// Data member Genome is optional with default eGenome_unknown;
166  /// its type is defined as 'typedef int TGenome'
167  /// @return
168  /// - true, if a value has been assigned.
169  /// - false, otherwise.
170  bool IsSetGenome(void) const;
171 
172  /// Check if it is safe to call GetGenome method.
173  ///
174  /// @return
175  /// - true, if the data member is getatable.
176  /// - false, otherwise.
177  bool CanGetGenome(void) const;
178 
179  /// Reset Genome data member.
180  void ResetGenome(void);
181 
182  /// Assign default value to Genome data member.
183  void SetDefaultGenome(void);
184 
185  /// Get the Genome member data.
186  ///
187  /// @return
188  /// Copy of the member data.
189  TGenome GetGenome(void) const;
190 
191  /// Assign a value to Genome data member.
192  ///
193  /// @param value
194  /// Value to assign
195  void SetGenome(TGenome value);
196 
197  /// Assign a value to Genome data member.
198  ///
199  /// @return
200  /// Reference to the data value.
201  TGenome& SetGenome(void);
202 
203  /// Check if a value has been assigned to Origin data member.
204  ///
205  /// Data member Origin is optional with default eOrigin_unknown;
206  /// its type is defined as 'typedef int TOrigin'
207  /// @return
208  /// - true, if a value has been assigned.
209  /// - false, otherwise.
210  bool IsSetOrigin(void) const;
211 
212  /// Check if it is safe to call GetOrigin method.
213  ///
214  /// @return
215  /// - true, if the data member is getatable.
216  /// - false, otherwise.
217  bool CanGetOrigin(void) const;
218 
219  /// Reset Origin data member.
220  void ResetOrigin(void);
221 
222  /// Assign default value to Origin data member.
223  void SetDefaultOrigin(void);
224 
225  /// Get the Origin member data.
226  ///
227  /// @return
228  /// Copy of the member data.
229  TOrigin GetOrigin(void) const;
230 
231  /// Assign a value to Origin data member.
232  ///
233  /// @param value
234  /// Value to assign
235  void SetOrigin(TOrigin value);
236 
237  /// Assign a value to Origin data member.
238  ///
239  /// @return
240  /// Reference to the data value.
241  TOrigin& SetOrigin(void);
242 
243  /// Check if a value has been assigned to Org data member.
244  ///
245  /// Data member Org is mandatory;
246  /// its type is defined as 'typedef COrg_ref TOrg'
247  /// @return
248  /// - true, if a value has been assigned.
249  /// - false, otherwise.
250  bool IsSetOrg(void) const;
251 
252  /// Check if it is safe to call GetOrg method.
253  ///
254  /// @return
255  /// - true, if the data member is getatable.
256  /// - false, otherwise.
257  bool CanGetOrg(void) const;
258 
259  /// Reset Org data member.
260  void ResetOrg(void);
261 
262  /// Get the Org member data.
263  ///
264  /// @return
265  /// Reference to the member data.
266  const TOrg& GetOrg(void) const;
267 
268  /// Assign a value to Org data member.
269  ///
270  /// @param value
271  /// Reference to value.
272  void SetOrg(TOrg& value);
273 
274  /// Assign a value to Org data member.
275  ///
276  /// @return
277  /// Reference to the data value.
278  TOrg& SetOrg(void);
279 
280  /// Check if a value has been assigned to Subtype data member.
281  ///
282  /// Data member Subtype is optional;
283  /// its type is defined as 'typedef list< CRef< CSubSource > > TSubtype'
284  /// @return
285  /// - true, if a value has been assigned.
286  /// - false, otherwise.
287  bool IsSetSubtype(void) const;
288 
289  /// Check if it is safe to call GetSubtype method.
290  ///
291  /// @return
292  /// - true, if the data member is getatable.
293  /// - false, otherwise.
294  bool CanGetSubtype(void) const;
295 
296  /// Reset Subtype data member.
297  void ResetSubtype(void);
298 
299  /// Get the Subtype member data.
300  ///
301  /// @return
302  /// Reference to the member data.
303  const TSubtype& GetSubtype(void) const;
304 
305  /// Assign a value to Subtype data member.
306  ///
307  /// @return
308  /// Reference to the data value.
309  TSubtype& SetSubtype(void);
310 
311  /// to distinguish biological focus
312  /// Check if a value has been assigned to Is_focus data member.
313  ///
314  /// Data member Is_focus is optional
315  /// @return
316  /// - true, if a value has been assigned.
317  /// - false, otherwise.
318  bool IsSetIs_focus(void) const;
319 
320  /// Check if value of Is_focus member is getatable.
321  ///
322  /// @return
323  /// - false; the data member of type 'NULL' has no value.
324  bool CanGetIs_focus(void) const;
325 
326  /// Reset Is_focus data member.
327  void ResetIs_focus(void);
328 
329  /// Set NULL data member (assign 'NULL' value to Is_focus data member).
330  void SetIs_focus(void);
331 
332  /// Check if a value has been assigned to Pcr_primers data member.
333  ///
334  /// Data member Pcr_primers is optional;
335  /// its type is defined as 'typedef CPCRReactionSet TPcr_primers'
336  /// @return
337  /// - true, if a value has been assigned.
338  /// - false, otherwise.
339  bool IsSetPcr_primers(void) const;
340 
341  /// Check if it is safe to call GetPcr_primers method.
342  ///
343  /// @return
344  /// - true, if the data member is getatable.
345  /// - false, otherwise.
346  bool CanGetPcr_primers(void) const;
347 
348  /// Reset Pcr_primers data member.
349  void ResetPcr_primers(void);
350 
351  /// Get the Pcr_primers member data.
352  ///
353  /// @return
354  /// Reference to the member data.
355  const TPcr_primers& GetPcr_primers(void) const;
356 
357  /// Assign a value to Pcr_primers data member.
358  ///
359  /// @param value
360  /// Reference to value.
361  void SetPcr_primers(TPcr_primers& value);
362 
363  /// Assign a value to Pcr_primers data member.
364  ///
365  /// @return
366  /// Reference to the data value.
367  TPcr_primers& SetPcr_primers(void);
368 
369  /// Reset the whole object
370  virtual void Reset(void);
371 
372 
373 private:
374  // Prohibit copy constructor and assignment operator
377 
378  // data
379  Uint4 m_set_State[1];
380  int m_Genome;
381  int m_Origin;
383  list< CRef< CSubSource > > m_Subtype;
385 };
386 
387 /* @} */
388 
389 
390 
391 
392 
393 ///////////////////////////////////////////////////////////
394 ///////////////////// inline methods //////////////////////
395 ///////////////////////////////////////////////////////////
396 inline
398 {
399  return ((m_set_State[0] & 0x3) != 0);
400 }
401 
402 inline
404 {
405  return true;
406 }
407 
408 inline
410 {
412  m_set_State[0] &= ~0x3;
413 }
414 
415 inline
417 {
418  ResetGenome();
419 }
420 
421 inline
423 {
424  return m_Genome;
425 }
426 
427 inline
429 {
430  m_Genome = value;
431  m_set_State[0] |= 0x3;
432 }
433 
434 inline
436 {
437 #ifdef _DEBUG
438  if (!IsSetGenome()) {
439  memset(&m_Genome,UnassignedByte(),sizeof(m_Genome));
440  }
441 #endif
442  m_set_State[0] |= 0x1;
443  return m_Genome;
444 }
445 
446 inline
448 {
449  return ((m_set_State[0] & 0xc) != 0);
450 }
451 
452 inline
454 {
455  return true;
456 }
457 
458 inline
460 {
462  m_set_State[0] &= ~0xc;
463 }
464 
465 inline
467 {
468  ResetOrigin();
469 }
470 
471 inline
473 {
474  return m_Origin;
475 }
476 
477 inline
479 {
480  m_Origin = value;
481  m_set_State[0] |= 0xc;
482 }
483 
484 inline
486 {
487 #ifdef _DEBUG
488  if (!IsSetOrigin()) {
489  memset(&m_Origin,UnassignedByte(),sizeof(m_Origin));
490  }
491 #endif
492  m_set_State[0] |= 0x4;
493  return m_Origin;
494 }
495 
496 inline
498 {
499  return m_Org.NotEmpty();
500 }
501 
502 inline
504 {
505  return true;
506 }
507 
508 inline
510 {
511  if ( !m_Org ) {
512  const_cast<CBioSource_Base*>(this)->ResetOrg();
513  }
514  return (*m_Org);
515 }
516 
517 inline
519 {
520  if ( !m_Org ) {
521  ResetOrg();
522  }
523  return (*m_Org);
524 }
525 
526 inline
528 {
529  return ((m_set_State[0] & 0xc0) != 0);
530 }
531 
532 inline
534 {
535  return true;
536 }
537 
538 inline
540 {
541  return m_Subtype;
542 }
543 
544 inline
546 {
547  m_set_State[0] |= 0x40;
548  return m_Subtype;
549 }
550 
551 inline
553 {
554  return ((m_set_State[0] & 0x300) != 0);
555 }
556 
557 inline
559 {
560  return false;
561 }
562 
563 inline
565 {
566  m_set_State[0] &= ~0x300;
567 }
568 
569 inline
571 {
572  m_set_State[0] |= 0x300;
573 }
574 
575 inline
577 {
578  return m_Pcr_primers.NotEmpty();
579 }
580 
581 inline
583 {
584  return IsSetPcr_primers();
585 }
586 
587 inline
589 {
590  if (!CanGetPcr_primers()) {
591  ThrowUnassigned(5);
592  }
593  return (*m_Pcr_primers);
594 }
595 
596 ///////////////////////////////////////////////////////////
597 ////////////////// end of inline methods //////////////////
598 ///////////////////////////////////////////////////////////
599 
600 
601 
602 
603 
604 END_objects_SCOPE // namespace ncbi::objects::
605 
607 
608 
609 #endif // OBJECTS_SEQFEAT_BIOSOURCE_BASE_HPP
********************************************************************
Definition: BioSource_.hpp:85
CPCRReactionSet –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
int GetSubtype(CFieldNamePanel *field_name_panel, string &ncRNA_class)
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
const TSubtype & GetSubtype(void) const
Get the Subtype member data.
Definition: BioSource_.hpp:539
const TPcr_primers & GetPcr_primers(void) const
Get the Pcr_primers member data.
Definition: BioSource_.hpp:588
TGenome GetGenome(void) const
Get the Genome member data.
Definition: BioSource_.hpp:422
Uint4 m_set_State[1]
Definition: BioSource_.hpp:379
TOrigin GetOrigin(void) const
Get the Origin member data.
Definition: BioSource_.hpp:472
void ResetGenome(void)
Reset Genome data member.
Definition: BioSource_.hpp:409
void ResetOrigin(void)
Reset Origin data member.
Definition: BioSource_.hpp:459
CRef< TOrg > m_Org
Definition: BioSource_.hpp:382
bool CanGetSubtype(void) const
Check if it is safe to call GetSubtype method.
Definition: BioSource_.hpp:533
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: BioSource_.hpp:497
bool CanGetOrg(void) const
Check if it is safe to call GetOrg method.
Definition: BioSource_.hpp:503
CPCRReactionSet TPcr_primers
Definition: BioSource_.hpp:146
list< CRef< CSubSource > > TSubtype
Definition: BioSource_.hpp:145
bool IsSetSubtype(void) const
Check if a value has been assigned to Subtype data member.
Definition: BioSource_.hpp:527
CSerialObject Tparent
Definition: BioSource_.hpp:86
TGenome & SetGenome(void)
Assign a value to Genome data member.
Definition: BioSource_.hpp:435
bool IsSetPcr_primers(void) const
Check if a value has been assigned to Pcr_primers data member.
Definition: BioSource_.hpp:576
void SetIs_focus(void)
Set NULL data member (assign 'NULL' value to Is_focus data member).
Definition: BioSource_.hpp:570
void ResetIs_focus(void)
Reset Is_focus data member.
Definition: BioSource_.hpp:564
bool CanGetGenome(void) const
Check if it is safe to call GetGenome method.
Definition: BioSource_.hpp:403
bool CanGetOrigin(void) const
Check if it is safe to call GetOrigin method.
Definition: BioSource_.hpp:453
const TOrg & GetOrg(void) const
Get the Org member data.
Definition: BioSource_.hpp:509
bool IsSetOrigin(void) const
Check if a value has been assigned to Origin data member.
Definition: BioSource_.hpp:447
TOrg & SetOrg(void)
Assign a value to Org data member.
Definition: BioSource_.hpp:518
bool CanGetPcr_primers(void) const
Check if it is safe to call GetPcr_primers method.
Definition: BioSource_.hpp:582
bool CanGetIs_focus(void) const
Check if value of Is_focus member is getatable.
Definition: BioSource_.hpp:558
CBioSource_Base(const CBioSource_Base &)
bool IsSetGenome(void) const
Check if a value has been assigned to Genome data member.
Definition: BioSource_.hpp:397
list< CRef< CSubSource > > m_Subtype
Definition: BioSource_.hpp:383
CRef< TPcr_primers > m_Pcr_primers
Definition: BioSource_.hpp:384
void ResetOrg(void)
Reset Org data member.
Definition: BioSource_.cpp:99
void SetDefaultOrigin(void)
Assign default value to Origin data member.
Definition: BioSource_.hpp:466
bool IsSetIs_focus(void) const
to distinguish biological focus Check if a value has been assigned to Is_focus data member.
Definition: BioSource_.hpp:552
void SetDefaultGenome(void)
Assign default value to Genome data member.
Definition: BioSource_.hpp:416
TOrigin & SetOrigin(void)
Assign a value to Origin data member.
Definition: BioSource_.hpp:485
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
Definition: BioSource_.hpp:158
EGenome
biological context
Definition: BioSource_.hpp:97
TSubtype & SetSubtype(void)
Assign a value to Subtype data member.
Definition: BioSource_.hpp:545
CBioSource_Base & operator=(const CBioSource_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
void SetGenome(CRef< objects::CSeq_entry > entry, objects::CBioSource::TGenome genome)
void SetOrigin(CRef< objects::CSeq_entry > entry, objects::CBioSource::TOrigin origin)
Modified on Thu Apr 11 15:07:22 2024 by modify_doxy.py rev. 669887