NCBI C++ ToolKit
GC_AssemblySet_.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_AssemblySet_.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_ASSEMBLYSET_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GC_ASSEMBLYSET_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_Assembly;
62 class CGC_AssemblyDesc;
63 class CGC_SequenceStats;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_GenomeCollection
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CGC_AssemblySet_Base --
77 ///
78 
80 {
82 public:
83  // constructor
85  // destructor
86  virtual ~CGC_AssemblySet_Base(void);
87 
88  // type info
90 
91  /// set type: Assembly-Sets can be of 2 categories
92  enum ESet_type {
93  eSet_type_full_assembly = 0, ///< full-assembly: set of asm-units
94  eSet_type_assembly_set = 100, ///<set of full-assemblies stopper
95  eSet_type_other = 255
96  };
97 
98  /// Access to ESet_type's attributes (values, names) as defined in spec
99  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ESet_type)(void);
100 
101  /// 'class' defines the semantics of how to interpret this item
102  enum EClass {
103  eClass_full_assembly = 0, ///< general type of full-assembly (not expected to be used)
104  eClass_haploid = 1, ///< this assembly represents a single haploid assembly in its entirety
105  eClass_haploid_with_alt_loci = 2, ///< this assembly has exactly one unit and at least one alt-loci
106  eClass_diploid = 3, ///< assembly represents a diploid assembly; we expect at least two haploid-unit assemblies contained herein
107  eClass_unresolved_diploid = 4, ///< unresolved-diploid: single unit which includes the diploid sequences
108  eClass_alternate_haplotype = 5, ///< second part of diploid; linked to another haploid full-assembly this one is alt-loci or second full-haploid
109  eClass_alternate_pseudohaplotype = 6,
110  eClass_annotation_target_set = 101, ///< assembly is a collection for annotation
111  eClass_analysis_set = 102, ///< analysis set used for sequencing by alignments
112  eClass_other = 255 ///< stopper
113  };
114 
115  /// Access to EClass's attributes (values, names) as defined in spec
116  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EClass)(void);
117 
118  // types
119  typedef list< CRef< CDbtag > > TId;
120  typedef int TSet_type;
121  typedef int TClass;
124  typedef list< CRef< CGC_Assembly > > TMore_assemblies;
126 
127  // member index
128  enum class E_memberIndex {
129  e__allMandatory = 0,
130  e_id,
131  e_set_type,
132  e_class,
133  e_desc,
134  e_primary_assembly,
135  e_more_assemblies,
136  e_stats
137  };
139 
140  // getters
141  // setters
142 
143  /// The identifier of this assembly
144  /// examples: GC internal id, Assembly-accession.version
145  /// Types of DbTags used:
146  /// db "GenColl", tag id <assembly-release-id>
147  /// db "GenColl", tag str <assembly-accession.version>
148  /// db "AGP", tag id <agp-sumbission-id>
149  /// db "GenColl_Chain", tag id <assembly-chain-id>
150  /// db "UCSC_name", tag str <UCSC identifier for assembly>
151  /// db "Ensembl_name",tag str <Ensembl identifier for assembly>
152  /// Check if a value has been assigned to Id data member.
153  ///
154  /// Data member Id is mandatory;
155  /// its type is defined as 'typedef list< CRef< CDbtag > > TId'
156  /// @return
157  /// - true, if a value has been assigned.
158  /// - false, otherwise.
159  bool IsSetId(void) const;
160 
161  /// Check if it is safe to call GetId method.
162  ///
163  /// @return
164  /// - true, if the data member is getatable.
165  /// - false, otherwise.
166  bool CanGetId(void) const;
167 
168  /// Reset Id data member.
169  void ResetId(void);
170 
171  /// Get the Id member data.
172  ///
173  /// @return
174  /// Reference to the member data.
175  const TId& GetId(void) const;
176 
177  /// Assign a value to Id data member.
178  ///
179  /// @return
180  /// Reference to the data value.
181  TId& SetId(void);
182 
183  /// Check if a value has been assigned to Set_type data member.
184  ///
185  /// Data member Set_type is mandatory;
186  /// its type is defined as 'typedef int TSet_type'
187  /// @return
188  /// - true, if a value has been assigned.
189  /// - false, otherwise.
190  bool IsSetSet_type(void) const;
191 
192  /// Check if it is safe to call GetSet_type method.
193  ///
194  /// @return
195  /// - true, if the data member is getatable.
196  /// - false, otherwise.
197  bool CanGetSet_type(void) const;
198 
199  /// Reset Set_type data member.
200  void ResetSet_type(void);
201 
202  /// Get the Set_type member data.
203  ///
204  /// @return
205  /// Copy of the member data.
206  TSet_type GetSet_type(void) const;
207 
208  /// Assign a value to Set_type data member.
209  ///
210  /// @param value
211  /// Value to assign
212  void SetSet_type(TSet_type value);
213 
214  /// Assign a value to Set_type data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TSet_type& SetSet_type(void);
219 
220  /// Check if a value has been assigned to Class data member.
221  ///
222  /// Data member Class is mandatory;
223  /// its type is defined as 'typedef int TClass'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetClass(void) const;
228 
229  /// Check if it is safe to call GetClass method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetClass(void) const;
235 
236  /// Reset Class data member.
237  void ResetClass(void);
238 
239  /// Get the Class member data.
240  ///
241  /// @return
242  /// Copy of the member data.
243  TClass GetClass(void) const;
244 
245  /// Assign a value to Class data member.
246  ///
247  /// @param value
248  /// Value to assign
249  void SetClass(TClass value);
250 
251  /// Assign a value to Class data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  TClass& SetClass(void);
256 
257  /// descriptors live in a shared data block
258  /// Check if a value has been assigned to Desc data member.
259  ///
260  /// Data member Desc is mandatory;
261  /// its type is defined as 'typedef CGC_AssemblyDesc TDesc'
262  /// @return
263  /// - true, if a value has been assigned.
264  /// - false, otherwise.
265  bool IsSetDesc(void) const;
266 
267  /// Check if it is safe to call GetDesc method.
268  ///
269  /// @return
270  /// - true, if the data member is getatable.
271  /// - false, otherwise.
272  bool CanGetDesc(void) const;
273 
274  /// Reset Desc data member.
275  void ResetDesc(void);
276 
277  /// Get the Desc member data.
278  ///
279  /// @return
280  /// Reference to the member data.
281  const TDesc& GetDesc(void) const;
282 
283  /// Assign a value to Desc data member.
284  ///
285  /// @param value
286  /// Reference to value.
287  void SetDesc(TDesc& value);
288 
289  /// Assign a value to Desc data member.
290  ///
291  /// @return
292  /// Reference to the data value.
293  TDesc& SetDesc(void);
294 
295  /// we contain hierarchically a set of assemblies
296  /// Check if a value has been assigned to Primary_assembly data member.
297  ///
298  /// Data member Primary_assembly is mandatory;
299  /// its type is defined as 'typedef CGC_Assembly TPrimary_assembly'
300  /// @return
301  /// - true, if a value has been assigned.
302  /// - false, otherwise.
303  bool IsSetPrimary_assembly(void) const;
304 
305  /// Check if it is safe to call GetPrimary_assembly method.
306  ///
307  /// @return
308  /// - true, if the data member is getatable.
309  /// - false, otherwise.
310  bool CanGetPrimary_assembly(void) const;
311 
312  /// Reset Primary_assembly data member.
313  void ResetPrimary_assembly(void);
314 
315  /// Get the Primary_assembly member data.
316  ///
317  /// @return
318  /// Reference to the member data.
319  const TPrimary_assembly& GetPrimary_assembly(void) const;
320 
321  /// Assign a value to Primary_assembly data member.
322  ///
323  /// @param value
324  /// Reference to value.
325  void SetPrimary_assembly(TPrimary_assembly& value);
326 
327  /// Assign a value to Primary_assembly data member.
328  ///
329  /// @return
330  /// Reference to the data value.
331  TPrimary_assembly& SetPrimary_assembly(void);
332 
333  /// Check if a value has been assigned to More_assemblies data member.
334  ///
335  /// Data member More_assemblies is optional;
336  /// its type is defined as 'typedef list< CRef< CGC_Assembly > > TMore_assemblies'
337  /// @return
338  /// - true, if a value has been assigned.
339  /// - false, otherwise.
340  bool IsSetMore_assemblies(void) const;
341 
342  /// Check if it is safe to call GetMore_assemblies method.
343  ///
344  /// @return
345  /// - true, if the data member is getatable.
346  /// - false, otherwise.
347  bool CanGetMore_assemblies(void) const;
348 
349  /// Reset More_assemblies data member.
350  void ResetMore_assemblies(void);
351 
352  /// Get the More_assemblies member data.
353  ///
354  /// @return
355  /// Reference to the member data.
356  const TMore_assemblies& GetMore_assemblies(void) const;
357 
358  /// Assign a value to More_assemblies data member.
359  ///
360  /// @return
361  /// Reference to the data value.
362  TMore_assemblies& SetMore_assemblies(void);
363 
364  /// statistics
365  /// "stats" field holds stats for all chromosomes combined:
366  /// Check if a value has been assigned to Stats data member.
367  ///
368  /// Data member Stats is optional;
369  /// its type is defined as 'typedef CGC_SequenceStats TStats'
370  /// @return
371  /// - true, if a value has been assigned.
372  /// - false, otherwise.
373  bool IsSetStats(void) const;
374 
375  /// Check if it is safe to call GetStats method.
376  ///
377  /// @return
378  /// - true, if the data member is getatable.
379  /// - false, otherwise.
380  bool CanGetStats(void) const;
381 
382  /// Reset Stats data member.
383  void ResetStats(void);
384 
385  /// Get the Stats member data.
386  ///
387  /// @return
388  /// Reference to the member data.
389  const TStats& GetStats(void) const;
390 
391  /// Assign a value to Stats data member.
392  ///
393  /// @param value
394  /// Reference to value.
395  void SetStats(TStats& value);
396 
397  /// Assign a value to Stats data member.
398  ///
399  /// @return
400  /// Reference to the data value.
401  TStats& SetStats(void);
402 
403  /// Reset the whole object
404  virtual void Reset(void);
405 
406 
407 private:
408  // Prohibit copy constructor and assignment operator
411 
412  // data
413  Uint4 m_set_State[1];
414  list< CRef< CDbtag > > m_Id;
416  int m_Class;
419  list< CRef< CGC_Assembly > > m_More_assemblies;
421 };
422 
423 /* @} */
424 
425 
426 
427 
428 
429 ///////////////////////////////////////////////////////////
430 ///////////////////// inline methods //////////////////////
431 ///////////////////////////////////////////////////////////
432 inline
434 {
435  return ((m_set_State[0] & 0x3) != 0);
436 }
437 
438 inline
440 {
441  return true;
442 }
443 
444 inline
446 {
447  return m_Id;
448 }
449 
450 inline
452 {
453  m_set_State[0] |= 0x1;
454  return m_Id;
455 }
456 
457 inline
459 {
460  return ((m_set_State[0] & 0xc) != 0);
461 }
462 
463 inline
465 {
466  return IsSetSet_type();
467 }
468 
469 inline
471 {
472  m_Set_type = (ESet_type)(0);
473  m_set_State[0] &= ~0xc;
474 }
475 
476 inline
478 {
479  if (!CanGetSet_type()) {
480  ThrowUnassigned(1);
481  }
482  return m_Set_type;
483 }
484 
485 inline
487 {
488  m_Set_type = value;
489  m_set_State[0] |= 0xc;
490 }
491 
492 inline
494 {
495 #ifdef _DEBUG
496  if (!IsSetSet_type()) {
497  memset(&m_Set_type,UnassignedByte(),sizeof(m_Set_type));
498  }
499 #endif
500  m_set_State[0] |= 0x4;
501  return m_Set_type;
502 }
503 
504 inline
506 {
507  return ((m_set_State[0] & 0x30) != 0);
508 }
509 
510 inline
512 {
513  return IsSetClass();
514 }
515 
516 inline
518 {
519  m_Class = (EClass)(0);
520  m_set_State[0] &= ~0x30;
521 }
522 
523 inline
525 {
526  if (!CanGetClass()) {
527  ThrowUnassigned(2);
528  }
529  return m_Class;
530 }
531 
532 inline
534 {
535  m_Class = value;
536  m_set_State[0] |= 0x30;
537 }
538 
539 inline
541 {
542 #ifdef _DEBUG
543  if (!IsSetClass()) {
544  memset(&m_Class,UnassignedByte(),sizeof(m_Class));
545  }
546 #endif
547  m_set_State[0] |= 0x10;
548  return m_Class;
549 }
550 
551 inline
553 {
554  return m_Desc.NotEmpty();
555 }
556 
557 inline
559 {
560  return true;
561 }
562 
563 inline
565 {
566  if ( !m_Desc ) {
567  const_cast<CGC_AssemblySet_Base*>(this)->ResetDesc();
568  }
569  return (*m_Desc);
570 }
571 
572 inline
574 {
575  if ( !m_Desc ) {
576  ResetDesc();
577  }
578  return (*m_Desc);
579 }
580 
581 inline
583 {
584  return m_Primary_assembly.NotEmpty();
585 }
586 
587 inline
589 {
590  return true;
591 }
592 
593 inline
595 {
596  if ( !m_Primary_assembly ) {
597  const_cast<CGC_AssemblySet_Base*>(this)->ResetPrimary_assembly();
598  }
599  return (*m_Primary_assembly);
600 }
601 
602 inline
604 {
605  if ( !m_Primary_assembly ) {
607  }
608  return (*m_Primary_assembly);
609 }
610 
611 inline
613 {
614  return ((m_set_State[0] & 0xc00) != 0);
615 }
616 
617 inline
619 {
620  return true;
621 }
622 
623 inline
625 {
626  return m_More_assemblies;
627 }
628 
629 inline
631 {
632  m_set_State[0] |= 0x400;
633  return m_More_assemblies;
634 }
635 
636 inline
638 {
639  return m_Stats.NotEmpty();
640 }
641 
642 inline
644 {
645  return IsSetStats();
646 }
647 
648 inline
650 {
651  if (!CanGetStats()) {
652  ThrowUnassigned(6);
653  }
654  return (*m_Stats);
655 }
656 
657 ///////////////////////////////////////////////////////////
658 ////////////////// end of inline methods //////////////////
659 ///////////////////////////////////////////////////////////
660 
661 
662 
663 
664 
665 END_objects_SCOPE // namespace ncbi::objects::
666 
668 
669 
670 #endif // OBJECTS_GENOMECOLL_GC_ASSEMBLYSET_BASE_HPP
Definition: Dbtag.hpp:53
CGC_AssemblyDesc –.
CGC_AssemblySet_Base –.
CGC_SequenceStats –.
CRef –.
Definition: ncbiobj.hpp:618
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
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
list< CRef< CGC_Assembly > > m_More_assemblies
void ResetDesc(void)
Reset Desc data member.
const TId & GetId(void) const
Get the Id member data.
bool CanGetPrimary_assembly(void) const
Check if it is safe to call GetPrimary_assembly method.
TPrimary_assembly & SetPrimary_assembly(void)
Assign a value to Primary_assembly data member.
bool IsSetSet_type(void) const
Check if a value has been assigned to Set_type data member.
bool IsSetClass(void) const
Check if a value has been assigned to Class data member.
TClass GetClass(void) const
Get the Class member data.
TSet_type & SetSet_type(void)
Assign a value to Set_type data member.
CGC_AssemblySet_Base(const CGC_AssemblySet_Base &)
bool IsSetId(void) const
The identifier of this assembly examples: GC internal id, Assembly-accession.version Types of DbTags ...
CRef< TPrimary_assembly > m_Primary_assembly
bool CanGetId(void) const
Check if it is safe to call GetId method.
bool IsSetDesc(void) const
descriptors live in a shared data block Check if a value has been assigned to Desc data member.
TId & SetId(void)
Assign a value to Id data member.
bool IsSetPrimary_assembly(void) const
we contain hierarchically a set of assemblies Check if a value has been assigned to Primary_assembly ...
Tparent::CMemberIndex< E_memberIndex, 8 > TmemberIndex
CGC_AssemblySet_Base & operator=(const CGC_AssemblySet_Base &)
bool IsSetStats(void) const
statistics "stats" field holds stats for all chromosomes combined: Check if a value has been assigned...
bool IsSetMore_assemblies(void) const
Check if a value has been assigned to More_assemblies data member.
bool CanGetSet_type(void) const
Check if it is safe to call GetSet_type method.
void ResetClass(void)
Reset Class data member.
const TDesc & GetDesc(void) const
Get the Desc member data.
bool CanGetStats(void) const
Check if it is safe to call GetStats method.
const TPrimary_assembly & GetPrimary_assembly(void) const
Get the Primary_assembly member data.
CGC_SequenceStats TStats
TClass & SetClass(void)
Assign a value to Class data member.
void ResetPrimary_assembly(void)
Reset Primary_assembly data member.
CGC_Assembly TPrimary_assembly
TDesc & SetDesc(void)
Assign a value to Desc data member.
TSet_type GetSet_type(void) const
Get the Set_type member data.
list< CRef< CDbtag > > TId
ESet_type
set type: Assembly-Sets can be of 2 categories
EClass
'class' defines the semantics of how to interpret this item
bool CanGetClass(void) const
Check if it is safe to call GetClass method.
list< CRef< CGC_Assembly > > TMore_assemblies
const TStats & GetStats(void) const
Get the Stats member data.
CGC_AssemblyDesc TDesc
TMore_assemblies & SetMore_assemblies(void)
Assign a value to More_assemblies data member.
void ResetSet_type(void)
Reset Set_type data member.
bool CanGetMore_assemblies(void) const
Check if it is safe to call GetMore_assemblies method.
const TMore_assemblies & GetMore_assemblies(void) const
Get the More_assemblies member data.
bool CanGetDesc(void) const
Check if it is safe to call GetDesc method.
list< CRef< CDbtag > > m_Id
Modified on Thu Mar 28 17:08:01 2024 by modify_doxy.py rev. 669887