NCBI C++ ToolKit
GC_TaggedSequences_.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_TaggedSequences_.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_TAGGEDSEQUENCES_BASE_HPP
42 #define OBJECTS_GENOMECOLL_GC_TAGGEDSEQUENCES_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 CGC_Sequence;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_GenomeCollection
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 /// GC-TaggedSequences: set of sequences in a specific role
73 ///
74 /// CGC_TaggedSequences_Base --
75 ///
76 
78 {
80 public:
81  // constructor
83  // destructor
84  virtual ~CGC_TaggedSequences_Base(void);
85 
86  // type info
88 
89  enum EState {
90  eState_not_set = 0, ///< error
91  eState_placed = 1, ///< exist only within a replicon. placed sequences on higher sequence
92  eState_unlocalized = 2, ///< exist only within a replicon. "random" on a given chromosome
93  eState_unplaced = 3, ///< exist only on primary/diploid assembly-unit. unknown chromosome
94  eState_aligned = 4, ///< exist only on alt-loci/patch units. List all aligned (eg cross-placed) sequences. (unaligned are listed as unlocalized).
95  eState_bits = 6 ///< exist only on primary/diploid unit. if need to report low-level contigs
96  };
97 
98  /// Access to EState's attributes (values, names) as defined in spec
99  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EState)(void);
100 
101  // types
102  typedef int TState;
103  typedef list< CRef< CGC_Sequence > > TSeqs;
104 
105  // member index
106  enum class E_memberIndex {
107  e__allMandatory = 0,
108  e_state,
109  e_seqs
110  };
112 
113  // getters
114  // setters
115 
116  /// Check if a value has been assigned to State data member.
117  ///
118  /// Data member State is mandatory;
119  /// its type is defined as 'typedef int TState'
120  /// @return
121  /// - true, if a value has been assigned.
122  /// - false, otherwise.
123  bool IsSetState(void) const;
124 
125  /// Check if it is safe to call GetState method.
126  ///
127  /// @return
128  /// - true, if the data member is getatable.
129  /// - false, otherwise.
130  bool CanGetState(void) const;
131 
132  /// Reset State data member.
133  void ResetState(void);
134 
135  /// Get the State member data.
136  ///
137  /// @return
138  /// Copy of the member data.
139  TState GetState(void) const;
140 
141  /// Assign a value to State data member.
142  ///
143  /// @param value
144  /// Value to assign
145  void SetState(TState value);
146 
147  /// Assign a value to State data member.
148  ///
149  /// @return
150  /// Reference to the data value.
151  TState& SetState(void);
152 
153  /// Check if a value has been assigned to Seqs data member.
154  ///
155  /// Data member Seqs is mandatory;
156  /// its type is defined as 'typedef list< CRef< CGC_Sequence > > TSeqs'
157  /// @return
158  /// - true, if a value has been assigned.
159  /// - false, otherwise.
160  bool IsSetSeqs(void) const;
161 
162  /// Check if it is safe to call GetSeqs method.
163  ///
164  /// @return
165  /// - true, if the data member is getatable.
166  /// - false, otherwise.
167  bool CanGetSeqs(void) const;
168 
169  /// Reset Seqs data member.
170  void ResetSeqs(void);
171 
172  /// Get the Seqs member data.
173  ///
174  /// @return
175  /// Reference to the member data.
176  const TSeqs& GetSeqs(void) const;
177 
178  /// Assign a value to Seqs data member.
179  ///
180  /// @return
181  /// Reference to the data value.
182  TSeqs& SetSeqs(void);
183 
184  /// Reset the whole object
185  virtual void Reset(void);
186 
187 
188 private:
189  // Prohibit copy constructor and assignment operator
192 
193  // data
194  Uint4 m_set_State[1];
195  int m_State;
196  list< CRef< CGC_Sequence > > m_Seqs;
197 };
198 
199 /* @} */
200 
201 
202 
203 
204 
205 ///////////////////////////////////////////////////////////
206 ///////////////////// inline methods //////////////////////
207 ///////////////////////////////////////////////////////////
208 inline
210 {
211  return ((m_set_State[0] & 0x3) != 0);
212 }
213 
214 inline
216 {
217  return IsSetState();
218 }
219 
220 inline
222 {
223  m_State = (EState)(0);
224  m_set_State[0] &= ~0x3;
225 }
226 
227 inline
229 {
230  if (!CanGetState()) {
231  ThrowUnassigned(0);
232  }
233  return m_State;
234 }
235 
236 inline
238 {
239  m_State = value;
240  m_set_State[0] |= 0x3;
241 }
242 
243 inline
245 {
246 #ifdef _DEBUG
247  if (!IsSetState()) {
248  memset(&m_State,UnassignedByte(),sizeof(m_State));
249  }
250 #endif
251  m_set_State[0] |= 0x1;
252  return m_State;
253 }
254 
255 inline
257 {
258  return ((m_set_State[0] & 0xc) != 0);
259 }
260 
261 inline
263 {
264  return true;
265 }
266 
267 inline
269 {
270  return m_Seqs;
271 }
272 
273 inline
275 {
276  m_set_State[0] |= 0x4;
277  return m_Seqs;
278 }
279 
280 ///////////////////////////////////////////////////////////
281 ////////////////// end of inline methods //////////////////
282 ///////////////////////////////////////////////////////////
283 
284 
285 
286 
287 
288 END_objects_SCOPE // namespace ncbi::objects::
289 
291 
292 
293 #endif // OBJECTS_GENOMECOLL_GC_TAGGEDSEQUENCES_BASE_HPP
GC-TaggedSequences: set of sequences in a specific role.
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
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
CGC_TaggedSequences_Base & operator=(const CGC_TaggedSequences_Base &)
bool CanGetSeqs(void) const
Check if it is safe to call GetSeqs method.
list< CRef< CGC_Sequence > > TSeqs
TState & SetState(void)
Assign a value to State data member.
bool CanGetState(void) const
Check if it is safe to call GetState method.
TState GetState(void) const
Get the State member data.
list< CRef< CGC_Sequence > > m_Seqs
const TSeqs & GetSeqs(void) const
Get the Seqs member data.
TSeqs & SetSeqs(void)
Assign a value to Seqs data member.
bool IsSetSeqs(void) const
Check if a value has been assigned to Seqs data member.
void ResetState(void)
Reset State data member.
CGC_TaggedSequences_Base(const CGC_TaggedSequences_Base &)
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
bool IsSetState(void) const
Check if a value has been assigned to State data member.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed Apr 17 13:09:13 2024 by modify_doxy.py rev. 669887