NCBI C++ ToolKit
Packed_seqpnt_.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 Packed_seqpnt_.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/seqloc/seqloc.asn">seqloc.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqloc/seqloc.def">seqloc.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_SEQLOC_PACKED_SEQPNT_BASE_HPP
42 #define OBJECTS_SEQLOC_PACKED_SEQPNT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <vector>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CInt_fuzz;
62 class CSeq_id;
63 
64 
65 // generated classes
66 
67 
68 /** @addtogroup dataspec_NCBI_Seqloc
69  *
70  * @{
71  */
72 
73 /////////////////////////////////////////////////////////////////////////////
74 ///
75 /// CPacked_seqpnt_Base --
76 ///
77 
79 {
81 public:
82  // constructor
83  CPacked_seqpnt_Base(void);
84  // destructor
85  virtual ~CPacked_seqpnt_Base(void);
86 
87  // type info
89 
90  // types
92  typedef CSeq_id TId;
93  typedef CInt_fuzz TFuzz;
94  typedef vector< TSeqPos > TPoints;
95 
96  // member index
97  enum class E_memberIndex {
98  e__allMandatory = 0,
99  e_strand,
100  e_id,
101  e_fuzz,
102  e_points
103  };
105 
106  // getters
107  // setters
108 
109  /// Check if a value has been assigned to Strand data member.
110  ///
111  /// Data member Strand is optional;
112  /// its type is defined as 'typedef ENa_strand TStrand'
113  /// @return
114  /// - true, if a value has been assigned.
115  /// - false, otherwise.
116  bool IsSetStrand(void) const;
117 
118  /// Check if it is safe to call GetStrand method.
119  ///
120  /// @return
121  /// - true, if the data member is getatable.
122  /// - false, otherwise.
123  bool CanGetStrand(void) const;
124 
125  /// Reset Strand data member.
126  void ResetStrand(void);
127 
128  /// Get the Strand member data.
129  ///
130  /// @return
131  /// Copy of the member data.
132  TStrand GetStrand(void) const;
133 
134  /// Assign a value to Strand data member.
135  ///
136  /// @param value
137  /// Value to assign
138  void SetStrand(TStrand value);
139 
140  /// Assign a value to Strand data member.
141  ///
142  /// @return
143  /// Reference to the data value.
144  TStrand& SetStrand(void);
145 
146  /// Check if a value has been assigned to Id data member.
147  ///
148  /// Data member Id is mandatory;
149  /// its type is defined as 'typedef CSeq_id TId'
150  /// @return
151  /// - true, if a value has been assigned.
152  /// - false, otherwise.
153  bool IsSetId(void) const;
154 
155  /// Check if it is safe to call GetId method.
156  ///
157  /// @return
158  /// - true, if the data member is getatable.
159  /// - false, otherwise.
160  bool CanGetId(void) const;
161 
162  /// Reset Id data member.
163  void ResetId(void);
164 
165  /// Get the Id member data.
166  ///
167  /// @return
168  /// Reference to the member data.
169  const TId& GetId(void) const;
170 
171  /// Assign a value to Id data member.
172  ///
173  /// @param value
174  /// Reference to value.
175  void SetId(TId& value);
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 Fuzz data member.
184  ///
185  /// Data member Fuzz is optional;
186  /// its type is defined as 'typedef CInt_fuzz TFuzz'
187  /// @return
188  /// - true, if a value has been assigned.
189  /// - false, otherwise.
190  bool IsSetFuzz(void) const;
191 
192  /// Check if it is safe to call GetFuzz method.
193  ///
194  /// @return
195  /// - true, if the data member is getatable.
196  /// - false, otherwise.
197  bool CanGetFuzz(void) const;
198 
199  /// Reset Fuzz data member.
200  void ResetFuzz(void);
201 
202  /// Get the Fuzz member data.
203  ///
204  /// @return
205  /// Reference to the member data.
206  const TFuzz& GetFuzz(void) const;
207 
208  /// Assign a value to Fuzz data member.
209  ///
210  /// @param value
211  /// Reference to value.
212  void SetFuzz(TFuzz& value);
213 
214  /// Assign a value to Fuzz data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TFuzz& SetFuzz(void);
219 
220  /// Check if a value has been assigned to Points data member.
221  ///
222  /// Data member Points is mandatory;
223  /// its type is defined as 'typedef vector< TSeqPos > TPoints'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetPoints(void) const;
228 
229  /// Check if it is safe to call GetPoints method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetPoints(void) const;
235 
236  /// Reset Points data member.
237  void ResetPoints(void);
238 
239  /// Get the Points member data.
240  ///
241  /// @return
242  /// Reference to the member data.
243  const TPoints& GetPoints(void) const;
244 
245  /// Assign a value to Points data member.
246  ///
247  /// @return
248  /// Reference to the data value.
249  TPoints& SetPoints(void);
250 
251  /// Reset the whole object
252  virtual void Reset(void);
253 
254 
255 private:
256  // Prohibit copy constructor and assignment operator
259 
260  // data
261  Uint4 m_set_State[1];
265  vector< TSeqPos > m_Points;
266 };
267 
268 /* @} */
269 
270 
271 
272 
273 
274 ///////////////////////////////////////////////////////////
275 ///////////////////// inline methods //////////////////////
276 ///////////////////////////////////////////////////////////
277 inline
279 {
280  return ((m_set_State[0] & 0x3) != 0);
281 }
282 
283 inline
285 {
286  return IsSetStrand();
287 }
288 
289 inline
291 {
293  m_set_State[0] &= ~0x3;
294 }
295 
296 inline
298 {
299  if (!CanGetStrand()) {
300  ThrowUnassigned(0);
301  }
302  return m_Strand;
303 }
304 
305 inline
307 {
308  m_Strand = value;
309  m_set_State[0] |= 0x3;
310 }
311 
312 inline
314 {
315 #ifdef _DEBUG
316  if (!IsSetStrand()) {
317  memset(&m_Strand,UnassignedByte(),sizeof(m_Strand));
318  }
319 #endif
320  m_set_State[0] |= 0x1;
321  return m_Strand;
322 }
323 
324 inline
326 {
327  return m_Id.NotEmpty();
328 }
329 
330 inline
332 {
333  return true;
334 }
335 
336 inline
338 {
339  if ( !m_Id ) {
340  const_cast<CPacked_seqpnt_Base*>(this)->ResetId();
341  }
342  return (*m_Id);
343 }
344 
345 inline
347 {
348  if ( !m_Id ) {
349  ResetId();
350  }
351  return (*m_Id);
352 }
353 
354 inline
356 {
357  return m_Fuzz.NotEmpty();
358 }
359 
360 inline
362 {
363  return IsSetFuzz();
364 }
365 
366 inline
368 {
369  if (!CanGetFuzz()) {
370  ThrowUnassigned(2);
371  }
372  return (*m_Fuzz);
373 }
374 
375 inline
377 {
378  return ((m_set_State[0] & 0xc0) != 0);
379 }
380 
381 inline
383 {
384  return true;
385 }
386 
387 inline
389 {
390  return m_Points;
391 }
392 
393 inline
395 {
396  m_set_State[0] |= 0x40;
397  return m_Points;
398 }
399 
400 ///////////////////////////////////////////////////////////
401 ////////////////// end of inline methods //////////////////
402 ///////////////////////////////////////////////////////////
403 
404 
405 
406 
407 
408 END_objects_SCOPE // namespace ncbi::objects::
409 
411 
412 
413 #endif // OBJECTS_SEQLOC_PACKED_SEQPNT_BASE_HPP
CPacked_seqpnt_Base –.
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
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,...
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
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_SEQLOC_EXPORT
Definition: ncbi_export.h:776
void ResetId(void)
Reset Id data member.
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
TStrand GetStrand(void) const
Get the Strand member data.
CPacked_seqpnt_Base & operator=(const CPacked_seqpnt_Base &)
bool IsSetPoints(void) const
Check if a value has been assigned to Points data member.
void ResetStrand(void)
Reset Strand data member.
CPacked_seqpnt_Base(const CPacked_seqpnt_Base &)
TId & SetId(void)
Assign a value to Id data member.
TStrand & SetStrand(void)
Assign a value to Strand data member.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
const TId & GetId(void) const
Get the Id member data.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
TPoints & SetPoints(void)
Assign a value to Points data member.
vector< TSeqPos > TPoints
bool CanGetId(void) const
Check if it is safe to call GetId method.
bool CanGetFuzz(void) const
Check if it is safe to call GetFuzz method.
bool CanGetPoints(void) const
Check if it is safe to call GetPoints method.
const TPoints & GetPoints(void) const
Get the Points member data.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
CSerialObject Tparent
vector< TSeqPos > m_Points
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static const CInt_fuzz * GetFuzz(const CDelta_item &delta)
Modified on Sun Jun 16 04:38:15 2024 by modify_doxy.py rev. 669887