NCBI C++ ToolKit
Seq_point_.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_point_.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_SEQ_POINT_BASE_HPP
42 #define OBJECTS_SEQLOC_SEQ_POINT_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
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 CInt_fuzz;
61 class CSeq_id;
62 
63 
64 // generated classes
65 
66 
67 /** @addtogroup dataspec_NCBI_Seqloc
68  *
69  * @{
70  */
71 
72 /////////////////////////////////////////////////////////////////////////////
73 ///
74 /// CSeq_point_Base --
75 ///
76 
78 {
80 public:
81  // constructor
82  CSeq_point_Base(void);
83  // destructor
84  virtual ~CSeq_point_Base(void);
85 
86  // type info
88 
89  // types
90  typedef TSeqPos TPoint;
92  typedef CSeq_id TId;
93  typedef CInt_fuzz TFuzz;
94 
95  // member index
96  enum class E_memberIndex {
97  e__allMandatory = 0,
98  e_point,
99  e_strand,
100  e_id,
101  e_fuzz
102  };
104 
105  // getters
106  // setters
107 
108  /// Check if a value has been assigned to Point data member.
109  ///
110  /// Data member Point is mandatory;
111  /// its type is defined as 'typedef TSeqPos TPoint'
112  /// @return
113  /// - true, if a value has been assigned.
114  /// - false, otherwise.
115  bool IsSetPoint(void) const;
116 
117  /// Check if it is safe to call GetPoint method.
118  ///
119  /// @return
120  /// - true, if the data member is getatable.
121  /// - false, otherwise.
122  bool CanGetPoint(void) const;
123 
124  /// Reset Point data member.
125  void ResetPoint(void);
126 
127  /// Get the Point member data.
128  ///
129  /// @return
130  /// Copy of the member data.
131  TPoint GetPoint(void) const;
132 
133  /// Assign a value to Point data member.
134  ///
135  /// @param value
136  /// Value to assign
137  void SetPoint(TPoint value);
138 
139  /// Assign a value to Point data member.
140  ///
141  /// @return
142  /// Reference to the data value.
143  TPoint& SetPoint(void);
144 
145  /// Check if a value has been assigned to Strand data member.
146  ///
147  /// Data member Strand is optional;
148  /// its type is defined as 'typedef ENa_strand TStrand'
149  /// @return
150  /// - true, if a value has been assigned.
151  /// - false, otherwise.
152  bool IsSetStrand(void) const;
153 
154  /// Check if it is safe to call GetStrand method.
155  ///
156  /// @return
157  /// - true, if the data member is getatable.
158  /// - false, otherwise.
159  bool CanGetStrand(void) const;
160 
161  /// Reset Strand data member.
162  void ResetStrand(void);
163 
164  /// Get the Strand member data.
165  ///
166  /// @return
167  /// Copy of the member data.
168  TStrand GetStrand(void) const;
169 
170  /// Assign a value to Strand data member.
171  ///
172  /// @param value
173  /// Value to assign
174  void SetStrand(TStrand value);
175 
176  /// Assign a value to Strand data member.
177  ///
178  /// @return
179  /// Reference to the data value.
180  TStrand& SetStrand(void);
181 
182  /// WARNING: this used to be optional
183  /// Check if a value has been assigned to Id data member.
184  ///
185  /// Data member Id is mandatory;
186  /// its type is defined as 'typedef CSeq_id TId'
187  /// @return
188  /// - true, if a value has been assigned.
189  /// - false, otherwise.
190  bool IsSetId(void) const;
191 
192  /// Check if it is safe to call GetId method.
193  ///
194  /// @return
195  /// - true, if the data member is getatable.
196  /// - false, otherwise.
197  bool CanGetId(void) const;
198 
199  /// Reset Id data member.
200  void ResetId(void);
201 
202  /// Get the Id member data.
203  ///
204  /// @return
205  /// Reference to the member data.
206  const TId& GetId(void) const;
207 
208  /// Assign a value to Id data member.
209  ///
210  /// @param value
211  /// Reference to value.
212  void SetId(TId& value);
213 
214  /// Assign a value to Id data member.
215  ///
216  /// @return
217  /// Reference to the data value.
218  TId& SetId(void);
219 
220  /// Check if a value has been assigned to Fuzz data member.
221  ///
222  /// Data member Fuzz is optional;
223  /// its type is defined as 'typedef CInt_fuzz TFuzz'
224  /// @return
225  /// - true, if a value has been assigned.
226  /// - false, otherwise.
227  bool IsSetFuzz(void) const;
228 
229  /// Check if it is safe to call GetFuzz method.
230  ///
231  /// @return
232  /// - true, if the data member is getatable.
233  /// - false, otherwise.
234  bool CanGetFuzz(void) const;
235 
236  /// Reset Fuzz data member.
237  void ResetFuzz(void);
238 
239  /// Get the Fuzz member data.
240  ///
241  /// @return
242  /// Reference to the member data.
243  const TFuzz& GetFuzz(void) const;
244 
245  /// Assign a value to Fuzz data member.
246  ///
247  /// @param value
248  /// Reference to value.
249  void SetFuzz(TFuzz& value);
250 
251  /// Assign a value to Fuzz data member.
252  ///
253  /// @return
254  /// Reference to the data value.
255  TFuzz& SetFuzz(void);
256 
257  /// Reset the whole object
258  virtual void Reset(void);
259 
260 
261 private:
262  // Prohibit copy constructor and assignment operator
265 
266  // data
267  Uint4 m_set_State[1];
272 };
273 
274 /* @} */
275 
276 
277 
278 
279 
280 ///////////////////////////////////////////////////////////
281 ///////////////////// inline methods //////////////////////
282 ///////////////////////////////////////////////////////////
283 inline
285 {
286  return ((m_set_State[0] & 0x3) != 0);
287 }
288 
289 inline
291 {
292  return IsSetPoint();
293 }
294 
295 inline
297 {
298  m_Point = 0;
299  m_set_State[0] &= ~0x3;
300 }
301 
302 inline
304 {
305  if (!CanGetPoint()) {
306  ThrowUnassigned(0);
307  }
308  return m_Point;
309 }
310 
311 inline
313 {
314  m_Point = value;
315  m_set_State[0] |= 0x3;
316 }
317 
318 inline
320 {
321 #ifdef _DEBUG
322  if (!IsSetPoint()) {
323  memset(&m_Point,UnassignedByte(),sizeof(m_Point));
324  }
325 #endif
326  m_set_State[0] |= 0x1;
327  return m_Point;
328 }
329 
330 inline
332 {
333  return ((m_set_State[0] & 0xc) != 0);
334 }
335 
336 inline
338 {
339  return IsSetStrand();
340 }
341 
342 inline
344 {
346  m_set_State[0] &= ~0xc;
347 }
348 
349 inline
351 {
352  if (!CanGetStrand()) {
353  ThrowUnassigned(1);
354  }
355  return m_Strand;
356 }
357 
358 inline
360 {
361  m_Strand = value;
362  m_set_State[0] |= 0xc;
363 }
364 
365 inline
367 {
368 #ifdef _DEBUG
369  if (!IsSetStrand()) {
370  memset(&m_Strand,UnassignedByte(),sizeof(m_Strand));
371  }
372 #endif
373  m_set_State[0] |= 0x4;
374  return m_Strand;
375 }
376 
377 inline
378 bool CSeq_point_Base::IsSetId(void) const
379 {
380  return m_Id.NotEmpty();
381 }
382 
383 inline
385 {
386  return true;
387 }
388 
389 inline
391 {
392  if ( !m_Id ) {
393  const_cast<CSeq_point_Base*>(this)->ResetId();
394  }
395  return (*m_Id);
396 }
397 
398 inline
400 {
401  if ( !m_Id ) {
402  ResetId();
403  }
404  return (*m_Id);
405 }
406 
407 inline
409 {
410  return m_Fuzz.NotEmpty();
411 }
412 
413 inline
415 {
416  return IsSetFuzz();
417 }
418 
419 inline
421 {
422  if (!CanGetFuzz()) {
423  ThrowUnassigned(3);
424  }
425  return (*m_Fuzz);
426 }
427 
428 ///////////////////////////////////////////////////////////
429 ////////////////// end of inline methods //////////////////
430 ///////////////////////////////////////////////////////////
431 
432 
433 
434 
435 
436 END_objects_SCOPE // namespace ncbi::objects::
437 
439 
440 
441 #endif // OBJECTS_SEQLOC_SEQ_POINT_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
CSeq_point_Base –.
Definition: Seq_point_.hpp:78
Base class for all serializable objects.
Definition: serialbase.hpp:150
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
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
TStrand & SetStrand(void)
Assign a value to Strand data member.
Definition: Seq_point_.hpp:366
CRef< TId > m_Id
Definition: Seq_point_.hpp:270
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
Definition: Seq_point_.hpp:378
CInt_fuzz TFuzz
Definition: Seq_point_.hpp:93
void ResetPoint(void)
Reset Point data member.
Definition: Seq_point_.hpp:296
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
Definition: Seq_point_.hpp:103
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
bool IsSetPoint(void) const
Check if a value has been assigned to Point data member.
Definition: Seq_point_.hpp:284
void ResetId(void)
Reset Id data member.
Definition: Seq_point_.cpp:52
TPoint GetPoint(void) const
Get the Point member data.
Definition: Seq_point_.hpp:303
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
Definition: Seq_point_.hpp:408
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
Definition: Seq_point_.hpp:420
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_point_.hpp:390
ENa_strand m_Strand
Definition: Seq_point_.hpp:269
TStrand GetStrand(void) const
Get the Strand member data.
Definition: Seq_point_.hpp:350
TId & SetId(void)
Assign a value to Id data member.
Definition: Seq_point_.hpp:399
TPoint & SetPoint(void)
Assign a value to Point data member.
Definition: Seq_point_.hpp:319
bool CanGetFuzz(void) const
Check if it is safe to call GetFuzz method.
Definition: Seq_point_.hpp:414
CSerialObject Tparent
Definition: Seq_point_.hpp:79
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
Definition: Seq_point_.hpp:337
void ResetStrand(void)
Reset Strand data member.
Definition: Seq_point_.hpp:343
CRef< TFuzz > m_Fuzz
Definition: Seq_point_.hpp:271
bool CanGetPoint(void) const
Check if it is safe to call GetPoint method.
Definition: Seq_point_.hpp:290
CSeq_point_Base(const CSeq_point_Base &)
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
Definition: Seq_point_.hpp:331
ENa_strand TStrand
Definition: Seq_point_.hpp:91
CSeq_point_Base & operator=(const CSeq_point_Base &)
Uint4 m_set_State[1]
Definition: Seq_point_.hpp:267
bool CanGetId(void) const
Check if it is safe to call GetId method.
Definition: Seq_point_.hpp:384
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static const CInt_fuzz * GetFuzz(const CDelta_item &delta)
Modified on Wed Apr 17 13:08:47 2024 by modify_doxy.py rev. 669887