NCBI C++ ToolKit
GC_AssemblyUnit_.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 GC_AssemblyUnit_.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/genomecoll/genome_collection.asn">genome_collection.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/genomecoll/genome_collection.def">genome_collection.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_GENOMECOLL_GC_ASSEMBLYUNIT_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GC_ASSEMBLYUNIT_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 CDbtag;
61 class CGC_AssemblyDesc;
62 class CGC_Replicon;
63 class CGC_Scaf_stats;
64 class CGC_SequenceStats;
66 
67 
68 // generated classes
69 
70 
71 /** @addtogroup dataspec_NCBI_GenomeCollection
72  *
73  * @{
74  */
75 
76 /////////////////////////////////////////////////////////////////////////////
77 ///
78 /// CGC_AssemblyUnit_Base --
79 ///
80 
82 {
84 public:
85  // constructor
87  // destructor
88  virtual ~CGC_AssemblyUnit_Base(void);
89 
90  // type info
92 
93  /// 'class' defines the semantics of how to interpret this item
94  enum EClass {
95  eClass_haploid_unit = 1, ///< units for haploid/diploid assemblies
96  eClass_alt_loci = 2, ///< this unit represents one or more alternate loci for a haploid assembly
97  eClass_assembly_patch = 3, ///< assembly-patch
98  eClass_other = 255 ///< stopper
99  };
100 
101  /// Access to EClass's attributes (values, names) as defined in spec
102  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EClass)(void);
103 
104  // types
105  typedef list< CRef< CDbtag > > TId;
106  typedef int TClass;
108  typedef list< CRef< CGC_Replicon > > TMols;
109  typedef list< CRef< CGC_TaggedSequences > > TOther_sequences;
111  typedef list< CRef< CGC_Scaf_stats > > TUnplaced_stats;
112  typedef list< CRef< CGC_Scaf_stats > > TUnplaced_unlocalized_stats;
113 
114  // member index
115  enum class E_memberIndex {
116  e__allMandatory = 0,
117  e_id,
118  e_class,
119  e_desc,
120  e_mols,
121  e_other_sequences,
122  e_stats,
123  e_unplaced_stats,
124  e_unplaced_unlocalized_stats
125  };
127 
128  // getters
129  // setters
130 
131  /// The identifier of this assembly
132  /// Contains: GenColl internal id, GenColl accession.version,
133  /// AGP id, UCSC name, Ensembl name
134  /// Types of DbTags used:
135  /// db "GenColl", tag id <assembly-release-id>
136  /// db "GenColl", tag str <assembly-accession.version>
137  /// db "AGP", tag id <agp-sumbission-id>
138  /// db "GenColl_Chain", tag id <assembly-chain-id>
139  /// "Ensembl_name" and "UCSC_name" will not appear in the Unit level since
140  /// these organizations do not define assembly-units.
141  /// Check if a value has been assigned to Id data member.
142  ///
143  /// Data member Id is mandatory;
144  /// its type is defined as 'typedef list< CRef< CDbtag > > TId'
145  /// @return
146  /// - true, if a value has been assigned.
147  /// - false, otherwise.
148  bool IsSetId(void) const;
149 
150  /// Check if it is safe to call GetId method.
151  ///
152  /// @return
153  /// - true, if the data member is getatable.
154  /// - false, otherwise.
155  bool CanGetId(void) const;
156 
157  /// Reset Id data member.
158  void ResetId(void);
159 
160  /// Get the Id member data.
161  ///
162  /// @return
163  /// Reference to the member data.
164  const TId& GetId(void) const;
165 
166  /// Assign a value to Id data member.
167  ///
168  /// @return
169  /// Reference to the data value.
170  TId& SetId(void);
171 
172  /// Check if a value has been assigned to Class data member.
173  ///
174  /// Data member Class is mandatory;
175  /// its type is defined as 'typedef int TClass'
176  /// @return
177  /// - true, if a value has been assigned.
178  /// - false, otherwise.
179  bool IsSetClass(void) const;
180 
181  /// Check if it is safe to call GetClass method.
182  ///
183  /// @return
184  /// - true, if the data member is getatable.
185  /// - false, otherwise.
186  bool CanGetClass(void) const;
187 
188  /// Reset Class data member.
189  void ResetClass(void);
190 
191  /// Get the Class member data.
192  ///
193  /// @return
194  /// Copy of the member data.
195  TClass GetClass(void) const;
196 
197  /// Assign a value to Class data member.
198  ///
199  /// @param value
200  /// Value to assign
201  void SetClass(TClass value);
202 
203  /// Assign a value to Class data member.
204  ///
205  /// @return
206  /// Reference to the data value.
207  TClass& SetClass(void);
208 
209  /// descriptors live in a shared data block
210  /// Check if a value has been assigned to Desc data member.
211  ///
212  /// Data member Desc is mandatory;
213  /// its type is defined as 'typedef CGC_AssemblyDesc TDesc'
214  /// @return
215  /// - true, if a value has been assigned.
216  /// - false, otherwise.
217  bool IsSetDesc(void) const;
218 
219  /// Check if it is safe to call GetDesc method.
220  ///
221  /// @return
222  /// - true, if the data member is getatable.
223  /// - false, otherwise.
224  bool CanGetDesc(void) const;
225 
226  /// Reset Desc data member.
227  void ResetDesc(void);
228 
229  /// Get the Desc member data.
230  ///
231  /// @return
232  /// Reference to the member data.
233  const TDesc& GetDesc(void) const;
234 
235  /// Assign a value to Desc data member.
236  ///
237  /// @param value
238  /// Reference to value.
239  void SetDesc(TDesc& value);
240 
241  /// Assign a value to Desc data member.
242  ///
243  /// @return
244  /// Reference to the data value.
245  TDesc& SetDesc(void);
246 
247  /// collections of molecules for this assembly
248  /// Check if a value has been assigned to Mols data member.
249  ///
250  /// Data member Mols is optional;
251  /// its type is defined as 'typedef list< CRef< CGC_Replicon > > TMols'
252  /// @return
253  /// - true, if a value has been assigned.
254  /// - false, otherwise.
255  bool IsSetMols(void) const;
256 
257  /// Check if it is safe to call GetMols method.
258  ///
259  /// @return
260  /// - true, if the data member is getatable.
261  /// - false, otherwise.
262  bool CanGetMols(void) const;
263 
264  /// Reset Mols data member.
265  void ResetMols(void);
266 
267  /// Get the Mols member data.
268  ///
269  /// @return
270  /// Reference to the member data.
271  const TMols& GetMols(void) const;
272 
273  /// Assign a value to Mols data member.
274  ///
275  /// @return
276  /// Reference to the data value.
277  TMols& SetMols(void);
278 
279  /// On primary assembly-unit: here will be the unplaced sequences
280  /// On alt-loci: list of sequences aligned/unaligned to primary unit
281  /// Check if a value has been assigned to Other_sequences data member.
282  ///
283  /// Data member Other_sequences is optional;
284  /// its type is defined as 'typedef list< CRef< CGC_TaggedSequences > > TOther_sequences'
285  /// @return
286  /// - true, if a value has been assigned.
287  /// - false, otherwise.
288  bool IsSetOther_sequences(void) const;
289 
290  /// Check if it is safe to call GetOther_sequences method.
291  ///
292  /// @return
293  /// - true, if the data member is getatable.
294  /// - false, otherwise.
295  bool CanGetOther_sequences(void) const;
296 
297  /// Reset Other_sequences data member.
298  void ResetOther_sequences(void);
299 
300  /// Get the Other_sequences member data.
301  ///
302  /// @return
303  /// Reference to the member data.
304  const TOther_sequences& GetOther_sequences(void) const;
305 
306  /// Assign a value to Other_sequences data member.
307  ///
308  /// @return
309  /// Reference to the data value.
310  TOther_sequences& SetOther_sequences(void);
311 
312  /// statistics
313  /// "stats" field holds stats for all chromosomes combined:
314  /// ordered/unordered scaffolds
315  /// "unplaced-stats" holds stats for ChrUn which is omitted from "stats"
316  /// Check if a value has been assigned to Stats data member.
317  ///
318  /// Data member Stats is optional;
319  /// its type is defined as 'typedef CGC_SequenceStats TStats'
320  /// @return
321  /// - true, if a value has been assigned.
322  /// - false, otherwise.
323  bool IsSetStats(void) const;
324 
325  /// Check if it is safe to call GetStats method.
326  ///
327  /// @return
328  /// - true, if the data member is getatable.
329  /// - false, otherwise.
330  bool CanGetStats(void) const;
331 
332  /// Reset Stats data member.
333  void ResetStats(void);
334 
335  /// Get the Stats member data.
336  ///
337  /// @return
338  /// Reference to the member data.
339  const TStats& GetStats(void) const;
340 
341  /// Assign a value to Stats data member.
342  ///
343  /// @param value
344  /// Reference to value.
345  void SetStats(TStats& value);
346 
347  /// Assign a value to Stats data member.
348  ///
349  /// @return
350  /// Reference to the data value.
351  TStats& SetStats(void);
352 
353  /// Check if a value has been assigned to Unplaced_stats data member.
354  ///
355  /// Data member Unplaced_stats is optional;
356  /// its type is defined as 'typedef list< CRef< CGC_Scaf_stats > > TUnplaced_stats'
357  /// @return
358  /// - true, if a value has been assigned.
359  /// - false, otherwise.
360  bool IsSetUnplaced_stats(void) const;
361 
362  /// Check if it is safe to call GetUnplaced_stats method.
363  ///
364  /// @return
365  /// - true, if the data member is getatable.
366  /// - false, otherwise.
367  bool CanGetUnplaced_stats(void) const;
368 
369  /// Reset Unplaced_stats data member.
370  void ResetUnplaced_stats(void);
371 
372  /// Get the Unplaced_stats member data.
373  ///
374  /// @return
375  /// Reference to the member data.
376  const TUnplaced_stats& GetUnplaced_stats(void) const;
377 
378  /// Assign a value to Unplaced_stats data member.
379  ///
380  /// @return
381  /// Reference to the data value.
382  TUnplaced_stats& SetUnplaced_stats(void);
383 
384  /// Check if a value has been assigned to Unplaced_unlocalized_stats data member.
385  ///
386  /// Data member Unplaced_unlocalized_stats is optional;
387  /// its type is defined as 'typedef list< CRef< CGC_Scaf_stats > > TUnplaced_unlocalized_stats'
388  /// @return
389  /// - true, if a value has been assigned.
390  /// - false, otherwise.
391  bool IsSetUnplaced_unlocalized_stats(void) const;
392 
393  /// Check if it is safe to call GetUnplaced_unlocalized_stats method.
394  ///
395  /// @return
396  /// - true, if the data member is getatable.
397  /// - false, otherwise.
398  bool CanGetUnplaced_unlocalized_stats(void) const;
399 
400  /// Reset Unplaced_unlocalized_stats data member.
401  void ResetUnplaced_unlocalized_stats(void);
402 
403  /// Get the Unplaced_unlocalized_stats member data.
404  ///
405  /// @return
406  /// Reference to the member data.
407  const TUnplaced_unlocalized_stats& GetUnplaced_unlocalized_stats(void) const;
408 
409  /// Assign a value to Unplaced_unlocalized_stats data member.
410  ///
411  /// @return
412  /// Reference to the data value.
413  TUnplaced_unlocalized_stats& SetUnplaced_unlocalized_stats(void);
414 
415  /// Reset the whole object
416  virtual void Reset(void);
417 
418 
419 private:
420  // Prohibit copy constructor and assignment operator
423 
424  // data
425  Uint4 m_set_State[1];
426  list< CRef< CDbtag > > m_Id;
427  int m_Class;
429  list< CRef< CGC_Replicon > > m_Mols;
430  list< CRef< CGC_TaggedSequences > > m_Other_sequences;
432  list< CRef< CGC_Scaf_stats > > m_Unplaced_stats;
433  list< CRef< CGC_Scaf_stats > > m_Unplaced_unlocalized_stats;
434 };
435 
436 /* @} */
437 
438 
439 
440 
441 
442 ///////////////////////////////////////////////////////////
443 ///////////////////// inline methods //////////////////////
444 ///////////////////////////////////////////////////////////
445 inline
447 {
448  return ((m_set_State[0] & 0x3) != 0);
449 }
450 
451 inline
453 {
454  return true;
455 }
456 
457 inline
459 {
460  return m_Id;
461 }
462 
463 inline
465 {
466  m_set_State[0] |= 0x1;
467  return m_Id;
468 }
469 
470 inline
472 {
473  return ((m_set_State[0] & 0xc) != 0);
474 }
475 
476 inline
478 {
479  return IsSetClass();
480 }
481 
482 inline
484 {
485  m_Class = (EClass)(0);
486  m_set_State[0] &= ~0xc;
487 }
488 
489 inline
491 {
492  if (!CanGetClass()) {
493  ThrowUnassigned(1);
494  }
495  return m_Class;
496 }
497 
498 inline
500 {
501  m_Class = value;
502  m_set_State[0] |= 0xc;
503 }
504 
505 inline
507 {
508 #ifdef _DEBUG
509  if (!IsSetClass()) {
510  memset(&m_Class,UnassignedByte(),sizeof(m_Class));
511  }
512 #endif
513  m_set_State[0] |= 0x4;
514  return m_Class;
515 }
516 
517 inline
519 {
520  return m_Desc.NotEmpty();
521 }
522 
523 inline
525 {
526  return true;
527 }
528 
529 inline
531 {
532  if ( !m_Desc ) {
533  const_cast<CGC_AssemblyUnit_Base*>(this)->ResetDesc();
534  }
535  return (*m_Desc);
536 }
537 
538 inline
540 {
541  if ( !m_Desc ) {
542  ResetDesc();
543  }
544  return (*m_Desc);
545 }
546 
547 inline
549 {
550  return ((m_set_State[0] & 0xc0) != 0);
551 }
552 
553 inline
555 {
556  return true;
557 }
558 
559 inline
561 {
562  return m_Mols;
563 }
564 
565 inline
567 {
568  m_set_State[0] |= 0x40;
569  return m_Mols;
570 }
571 
572 inline
574 {
575  return ((m_set_State[0] & 0x300) != 0);
576 }
577 
578 inline
580 {
581  return true;
582 }
583 
584 inline
586 {
587  return m_Other_sequences;
588 }
589 
590 inline
592 {
593  m_set_State[0] |= 0x100;
594  return m_Other_sequences;
595 }
596 
597 inline
599 {
600  return m_Stats.NotEmpty();
601 }
602 
603 inline
605 {
606  return IsSetStats();
607 }
608 
609 inline
611 {
612  if (!CanGetStats()) {
613  ThrowUnassigned(5);
614  }
615  return (*m_Stats);
616 }
617 
618 inline
620 {
621  return ((m_set_State[0] & 0x3000) != 0);
622 }
623 
624 inline
626 {
627  return true;
628 }
629 
630 inline
632 {
633  return m_Unplaced_stats;
634 }
635 
636 inline
638 {
639  m_set_State[0] |= 0x1000;
640  return m_Unplaced_stats;
641 }
642 
643 inline
645 {
646  return ((m_set_State[0] & 0xc000) != 0);
647 }
648 
649 inline
651 {
652  return true;
653 }
654 
655 inline
657 {
659 }
660 
661 inline
663 {
664  m_set_State[0] |= 0x4000;
666 }
667 
668 ///////////////////////////////////////////////////////////
669 ////////////////// end of inline methods //////////////////
670 ///////////////////////////////////////////////////////////
671 
672 
673 
674 
675 
676 END_objects_SCOPE // namespace ncbi::objects::
677 
679 
680 
681 #endif // OBJECTS_GENOMECOLL_GC_ASSEMBLYUNIT_BASE_HPP
Definition: Dbtag.hpp:53
CGC_AssemblyDesc –.
CGC_AssemblyUnit_Base –.
CGC_Scaf_stats –.
CGC_SequenceStats –.
CGC_TaggedSequences –.
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
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
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_GENOME_COLLECTION_EXPORT
Definition: ncbi_export.h:528
bool CanGetDesc(void) const
Check if it is safe to call GetDesc method.
bool IsSetId(void) const
The identifier of this assembly Contains: GenColl internal id, GenColl accession.version,...
bool CanGetId(void) const
Check if it is safe to call GetId method.
TMols & SetMols(void)
Assign a value to Mols data member.
const TUnplaced_stats & GetUnplaced_stats(void) const
Get the Unplaced_stats member data.
const TUnplaced_unlocalized_stats & GetUnplaced_unlocalized_stats(void) const
Get the Unplaced_unlocalized_stats member data.
const TDesc & GetDesc(void) const
Get the Desc member data.
CGC_AssemblyUnit_Base(const CGC_AssemblyUnit_Base &)
CGC_SequenceStats TStats
void ResetClass(void)
Reset Class data member.
TClass GetClass(void) const
Get the Class member data.
bool CanGetClass(void) const
Check if it is safe to call GetClass method.
list< CRef< CDbtag > > TId
bool IsSetMols(void) const
collections of molecules for this assembly Check if a value has been assigned to Mols data member.
CGC_AssemblyUnit_Base & operator=(const CGC_AssemblyUnit_Base &)
list< CRef< CGC_Scaf_stats > > TUnplaced_stats
list< CRef< CGC_Replicon > > m_Mols
bool IsSetUnplaced_stats(void) const
Check if a value has been assigned to Unplaced_stats data member.
list< CRef< CGC_Scaf_stats > > m_Unplaced_unlocalized_stats
bool IsSetOther_sequences(void) const
On primary assembly-unit: here will be the unplaced sequences On alt-loci: list of sequences aligned/...
const TOther_sequences & GetOther_sequences(void) const
Get the Other_sequences member data.
void ResetDesc(void)
Reset Desc data member.
list< CRef< CDbtag > > m_Id
TDesc & SetDesc(void)
Assign a value to Desc data member.
TId & SetId(void)
Assign a value to Id data member.
bool IsSetDesc(void) const
descriptors live in a shared data block Check if a value has been assigned to Desc data member.
const TMols & GetMols(void) const
Get the Mols member data.
list< CRef< CGC_Replicon > > TMols
bool CanGetMols(void) const
Check if it is safe to call GetMols method.
TUnplaced_unlocalized_stats & SetUnplaced_unlocalized_stats(void)
Assign a value to Unplaced_unlocalized_stats data member.
bool IsSetUnplaced_unlocalized_stats(void) const
Check if a value has been assigned to Unplaced_unlocalized_stats data member.
const TStats & GetStats(void) const
Get the Stats member data.
TUnplaced_stats & SetUnplaced_stats(void)
Assign a value to Unplaced_stats data member.
bool CanGetOther_sequences(void) const
Check if it is safe to call GetOther_sequences method.
list< CRef< CGC_Scaf_stats > > m_Unplaced_stats
EClass
'class' defines the semantics of how to interpret this item
TClass & SetClass(void)
Assign a value to Class data member.
bool IsSetClass(void) const
Check if a value has been assigned to Class data member.
bool CanGetUnplaced_unlocalized_stats(void) const
Check if it is safe to call GetUnplaced_unlocalized_stats method.
TOther_sequences & SetOther_sequences(void)
Assign a value to Other_sequences data member.
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
bool CanGetStats(void) const
Check if it is safe to call GetStats method.
list< CRef< CGC_Scaf_stats > > TUnplaced_unlocalized_stats
bool CanGetUnplaced_stats(void) const
Check if it is safe to call GetUnplaced_stats method.
list< CRef< CGC_TaggedSequences > > m_Other_sequences
list< CRef< CGC_TaggedSequences > > TOther_sequences
bool IsSetStats(void) const
statistics "stats" field holds stats for all chromosomes combined: ordered/unordered scaffolds "unpla...
const TId & GetId(void) const
Get the Id member data.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:30 2024 by modify_doxy.py rev. 669887