NCBI C++ ToolKit
Seq_gap_.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 Seq_gap_.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_SEQ_GAP_BASE_HPP
42 #define OBJECTS_SEQ_SEQ_GAP_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 CLinkage_evidence;
61 
62 
63 // generated classes
64 
65 
66 /** @addtogroup dataspec_NCBI_Sequence
67  *
68  * @{
69  */
70 
71 /////////////////////////////////////////////////////////////////////////////
72 ///
73 /// CSeq_gap_Base --
74 ///
75 
77 {
79 public:
80  // constructor
81  CSeq_gap_Base(void);
82  // destructor
83  virtual ~CSeq_gap_Base(void);
84 
85  // type info
87 
88  enum EType {
89  eType_unknown = 0,
90  eType_fragment = 1, ///< Deprecated. Used only for AGP 1.1
91  eType_clone = 2, ///< Deprecated. Used only for AGP 1.1
92  eType_short_arm = 3,
93  eType_heterochromatin = 4,
94  eType_centromere = 5,
95  eType_telomere = 6,
96  eType_repeat = 7,
97  eType_contig = 8,
98  eType_scaffold = 9,
99  eType_contamination = 10,
100  eType_other = 255
101  };
102 
103  /// Access to EType's attributes (values, names) as defined in spec
104  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
105 
106  enum ELinkage {
107  eLinkage_unlinked = 0,
108  eLinkage_linked = 1,
109  eLinkage_other = 255
110  };
111 
112  /// Access to ELinkage's attributes (values, names) as defined in spec
113  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(ELinkage)(void);
114 
115  // types
116  typedef int TType;
117  typedef int TLinkage;
118  typedef list< CRef< CLinkage_evidence > > TLinkage_evidence;
119 
120  // member index
121  enum class E_memberIndex {
122  e__allMandatory = 0,
123  e_type,
124  e_linkage,
125  e_linkage_evidence
126  };
128 
129  // getters
130  // setters
131 
132  /// Check if a value has been assigned to Type data member.
133  ///
134  /// Data member Type is mandatory;
135  /// its type is defined as 'typedef int TType'
136  /// @return
137  /// - true, if a value has been assigned.
138  /// - false, otherwise.
139  bool IsSetType(void) const;
140 
141  /// Check if it is safe to call GetType method.
142  ///
143  /// @return
144  /// - true, if the data member is getatable.
145  /// - false, otherwise.
146  bool CanGetType(void) const;
147 
148  /// Reset Type data member.
149  void ResetType(void);
150 
151  /// Get the Type member data.
152  ///
153  /// @return
154  /// Copy of the member data.
155  TType GetType(void) const;
156 
157  /// Assign a value to Type data member.
158  ///
159  /// @param value
160  /// Value to assign
161  void SetType(TType value);
162 
163  /// Assign a value to Type data member.
164  ///
165  /// @return
166  /// Reference to the data value.
167  TType& SetType(void);
168 
169  /// Check if a value has been assigned to Linkage data member.
170  ///
171  /// Data member Linkage is optional;
172  /// its type is defined as 'typedef int TLinkage'
173  /// @return
174  /// - true, if a value has been assigned.
175  /// - false, otherwise.
176  bool IsSetLinkage(void) const;
177 
178  /// Check if it is safe to call GetLinkage method.
179  ///
180  /// @return
181  /// - true, if the data member is getatable.
182  /// - false, otherwise.
183  bool CanGetLinkage(void) const;
184 
185  /// Reset Linkage data member.
186  void ResetLinkage(void);
187 
188  /// Get the Linkage member data.
189  ///
190  /// @return
191  /// Copy of the member data.
192  TLinkage GetLinkage(void) const;
193 
194  /// Assign a value to Linkage data member.
195  ///
196  /// @param value
197  /// Value to assign
198  void SetLinkage(TLinkage value);
199 
200  /// Assign a value to Linkage data member.
201  ///
202  /// @return
203  /// Reference to the data value.
204  TLinkage& SetLinkage(void);
205 
206  /// Check if a value has been assigned to Linkage_evidence data member.
207  ///
208  /// Data member Linkage_evidence is optional;
209  /// its type is defined as 'typedef list< CRef< CLinkage_evidence > > TLinkage_evidence'
210  /// @return
211  /// - true, if a value has been assigned.
212  /// - false, otherwise.
213  bool IsSetLinkage_evidence(void) const;
214 
215  /// Check if it is safe to call GetLinkage_evidence method.
216  ///
217  /// @return
218  /// - true, if the data member is getatable.
219  /// - false, otherwise.
220  bool CanGetLinkage_evidence(void) const;
221 
222  /// Reset Linkage_evidence data member.
223  void ResetLinkage_evidence(void);
224 
225  /// Get the Linkage_evidence member data.
226  ///
227  /// @return
228  /// Reference to the member data.
229  const TLinkage_evidence& GetLinkage_evidence(void) const;
230 
231  /// Assign a value to Linkage_evidence data member.
232  ///
233  /// @return
234  /// Reference to the data value.
235  TLinkage_evidence& SetLinkage_evidence(void);
236 
237  /// Reset the whole object
238  virtual void Reset(void);
239 
240 
241 private:
242  // Prohibit copy constructor and assignment operator
245 
246  // data
247  Uint4 m_set_State[1];
248  int m_Type;
250  list< CRef< CLinkage_evidence > > m_Linkage_evidence;
251 };
252 
253 /* @} */
254 
255 
256 
257 
258 
259 ///////////////////////////////////////////////////////////
260 ///////////////////// inline methods //////////////////////
261 ///////////////////////////////////////////////////////////
262 inline
263 bool CSeq_gap_Base::IsSetType(void) const
264 {
265  return ((m_set_State[0] & 0x3) != 0);
266 }
267 
268 inline
270 {
271  return IsSetType();
272 }
273 
274 inline
276 {
277  m_Type = (EType)(0);
278  m_set_State[0] &= ~0x3;
279 }
280 
281 inline
283 {
284  if (!CanGetType()) {
285  ThrowUnassigned(0);
286  }
287  return m_Type;
288 }
289 
290 inline
292 {
293  m_Type = value;
294  m_set_State[0] |= 0x3;
295 }
296 
297 inline
299 {
300 #ifdef _DEBUG
301  if (!IsSetType()) {
302  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
303  }
304 #endif
305  m_set_State[0] |= 0x1;
306  return m_Type;
307 }
308 
309 inline
311 {
312  return ((m_set_State[0] & 0xc) != 0);
313 }
314 
315 inline
317 {
318  return IsSetLinkage();
319 }
320 
321 inline
323 {
324  m_Linkage = (ELinkage)(0);
325  m_set_State[0] &= ~0xc;
326 }
327 
328 inline
330 {
331  if (!CanGetLinkage()) {
332  ThrowUnassigned(1);
333  }
334  return m_Linkage;
335 }
336 
337 inline
339 {
340  m_Linkage = value;
341  m_set_State[0] |= 0xc;
342 }
343 
344 inline
346 {
347 #ifdef _DEBUG
348  if (!IsSetLinkage()) {
349  memset(&m_Linkage,UnassignedByte(),sizeof(m_Linkage));
350  }
351 #endif
352  m_set_State[0] |= 0x4;
353  return m_Linkage;
354 }
355 
356 inline
358 {
359  return ((m_set_State[0] & 0x30) != 0);
360 }
361 
362 inline
364 {
365  return true;
366 }
367 
368 inline
370 {
371  return m_Linkage_evidence;
372 }
373 
374 inline
376 {
377  m_set_State[0] |= 0x10;
378  return m_Linkage_evidence;
379 }
380 
381 ///////////////////////////////////////////////////////////
382 ////////////////// end of inline methods //////////////////
383 ///////////////////////////////////////////////////////////
384 
385 
386 
387 
388 
389 END_objects_SCOPE // namespace ncbi::objects::
390 
392 
393 
394 #endif // OBJECTS_SEQ_SEQ_GAP_BASE_HPP
static bool GetLinkage(const CSeqMap_CI &iter, const bool *default_linkage)
Definition: agp_write.cpp:102
CSeq_gap_Base –.
Definition: Seq_gap_.hpp:77
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_SEQ_EXPORT
Definition: ncbi_export.h:825
DECLARE_INTERNAL_TYPE_INFO()
bool IsSetLinkage(void) const
Check if a value has been assigned to Linkage data member.
Definition: Seq_gap_.hpp:310
CSeq_gap_Base(const CSeq_gap_Base &)
bool CanGetType(void) const
Check if it is safe to call GetType method.
Definition: Seq_gap_.hpp:269
TLinkage GetLinkage(void) const
Get the Linkage member data.
Definition: Seq_gap_.hpp:329
TType GetType(void) const
Get the Type member data.
Definition: Seq_gap_.hpp:282
bool CanGetLinkage_evidence(void) const
Check if it is safe to call GetLinkage_evidence method.
Definition: Seq_gap_.hpp:363
CSeq_gap_Base & operator=(const CSeq_gap_Base &)
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
Definition: Seq_gap_.hpp:127
Uint4 m_set_State[1]
Definition: Seq_gap_.hpp:247
list< CRef< CLinkage_evidence > > m_Linkage_evidence
Definition: Seq_gap_.hpp:250
const TLinkage_evidence & GetLinkage_evidence(void) const
Get the Linkage_evidence member data.
Definition: Seq_gap_.hpp:369
void ResetLinkage(void)
Reset Linkage data member.
Definition: Seq_gap_.hpp:322
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
Definition: Seq_gap_.hpp:263
bool CanGetLinkage(void) const
Check if it is safe to call GetLinkage method.
Definition: Seq_gap_.hpp:316
CSerialObject Tparent
Definition: Seq_gap_.hpp:78
TLinkage_evidence & SetLinkage_evidence(void)
Assign a value to Linkage_evidence data member.
Definition: Seq_gap_.hpp:375
void ResetType(void)
Reset Type data member.
Definition: Seq_gap_.hpp:275
TLinkage & SetLinkage(void)
Assign a value to Linkage data member.
Definition: Seq_gap_.hpp:345
list< CRef< CLinkage_evidence > > TLinkage_evidence
Definition: Seq_gap_.hpp:118
TType & SetType(void)
Assign a value to Type data member.
Definition: Seq_gap_.hpp:298
bool IsSetLinkage_evidence(void) const
Check if a value has been assigned to Linkage_evidence data member.
Definition: Seq_gap_.hpp:357
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun May 19 04:42:52 2024 by modify_doxy.py rev. 669887