NCBI C++ ToolKit
Seq_interval_.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_interval_.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_INTERVAL_BASE_HPP
42 #define OBJECTS_SEQLOC_SEQ_INTERVAL_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_interval_Base --
75 ///
76 
78 {
80 public:
81  // constructor
82  CSeq_interval_Base(void);
83  // destructor
84  virtual ~CSeq_interval_Base(void);
85 
86  // type info
88 
89  // types
90  typedef TSeqPos TFrom;
91  typedef TSeqPos TTo;
93  typedef CSeq_id TId;
96 
97  // member index
98  enum class E_memberIndex {
99  e__allMandatory = 0,
100  e_from,
101  e_to,
102  e_strand,
103  e_id,
104  e_fuzz_from,
105  e_fuzz_to
106  };
108 
109  // getters
110  // setters
111 
112  /// Check if a value has been assigned to From data member.
113  ///
114  /// Data member From is mandatory;
115  /// its type is defined as 'typedef TSeqPos TFrom'
116  /// @return
117  /// - true, if a value has been assigned.
118  /// - false, otherwise.
119  bool IsSetFrom(void) const;
120 
121  /// Check if it is safe to call GetFrom method.
122  ///
123  /// @return
124  /// - true, if the data member is getatable.
125  /// - false, otherwise.
126  bool CanGetFrom(void) const;
127 
128  /// Reset From data member.
129  void ResetFrom(void);
130 
131  /// Get the From member data.
132  ///
133  /// @return
134  /// Copy of the member data.
135  TFrom GetFrom(void) const;
136 
137  /// Assign a value to From data member.
138  ///
139  /// @param value
140  /// Value to assign
141  void SetFrom(TFrom value);
142 
143  /// Assign a value to From data member.
144  ///
145  /// @return
146  /// Reference to the data value.
147  TFrom& SetFrom(void);
148 
149  /// Check if a value has been assigned to To data member.
150  ///
151  /// Data member To is mandatory;
152  /// its type is defined as 'typedef TSeqPos TTo'
153  /// @return
154  /// - true, if a value has been assigned.
155  /// - false, otherwise.
156  bool IsSetTo(void) const;
157 
158  /// Check if it is safe to call GetTo method.
159  ///
160  /// @return
161  /// - true, if the data member is getatable.
162  /// - false, otherwise.
163  bool CanGetTo(void) const;
164 
165  /// Reset To data member.
166  void ResetTo(void);
167 
168  /// Get the To member data.
169  ///
170  /// @return
171  /// Copy of the member data.
172  TTo GetTo(void) const;
173 
174  /// Assign a value to To data member.
175  ///
176  /// @param value
177  /// Value to assign
178  void SetTo(TTo value);
179 
180  /// Assign a value to To data member.
181  ///
182  /// @return
183  /// Reference to the data value.
184  TTo& SetTo(void);
185 
186  /// Check if a value has been assigned to Strand data member.
187  ///
188  /// Data member Strand is optional;
189  /// its type is defined as 'typedef ENa_strand TStrand'
190  /// @return
191  /// - true, if a value has been assigned.
192  /// - false, otherwise.
193  bool IsSetStrand(void) const;
194 
195  /// Check if it is safe to call GetStrand method.
196  ///
197  /// @return
198  /// - true, if the data member is getatable.
199  /// - false, otherwise.
200  bool CanGetStrand(void) const;
201 
202  /// Reset Strand data member.
203  void ResetStrand(void);
204 
205  /// Get the Strand member data.
206  ///
207  /// @return
208  /// Copy of the member data.
209  TStrand GetStrand(void) const;
210 
211  /// Assign a value to Strand data member.
212  ///
213  /// @param value
214  /// Value to assign
215  void SetStrand(TStrand value);
216 
217  /// Assign a value to Strand data member.
218  ///
219  /// @return
220  /// Reference to the data value.
221  TStrand& SetStrand(void);
222 
223  /// WARNING: this used to be optional
224  /// Check if a value has been assigned to Id data member.
225  ///
226  /// Data member Id is mandatory;
227  /// its type is defined as 'typedef CSeq_id TId'
228  /// @return
229  /// - true, if a value has been assigned.
230  /// - false, otherwise.
231  bool IsSetId(void) const;
232 
233  /// Check if it is safe to call GetId method.
234  ///
235  /// @return
236  /// - true, if the data member is getatable.
237  /// - false, otherwise.
238  bool CanGetId(void) const;
239 
240  /// Reset Id data member.
241  void ResetId(void);
242 
243  /// Get the Id member data.
244  ///
245  /// @return
246  /// Reference to the member data.
247  const TId& GetId(void) const;
248 
249  /// Assign a value to Id data member.
250  ///
251  /// @param value
252  /// Reference to value.
253  void SetId(TId& value);
254 
255  /// Assign a value to Id data member.
256  ///
257  /// @return
258  /// Reference to the data value.
259  TId& SetId(void);
260 
261  /// Check if a value has been assigned to Fuzz_from data member.
262  ///
263  /// Data member Fuzz_from is optional;
264  /// its type is defined as 'typedef CInt_fuzz TFuzz_from'
265  /// @return
266  /// - true, if a value has been assigned.
267  /// - false, otherwise.
268  bool IsSetFuzz_from(void) const;
269 
270  /// Check if it is safe to call GetFuzz_from method.
271  ///
272  /// @return
273  /// - true, if the data member is getatable.
274  /// - false, otherwise.
275  bool CanGetFuzz_from(void) const;
276 
277  /// Reset Fuzz_from data member.
278  void ResetFuzz_from(void);
279 
280  /// Get the Fuzz_from member data.
281  ///
282  /// @return
283  /// Reference to the member data.
284  const TFuzz_from& GetFuzz_from(void) const;
285 
286  /// Assign a value to Fuzz_from data member.
287  ///
288  /// @param value
289  /// Reference to value.
290  void SetFuzz_from(TFuzz_from& value);
291 
292  /// Assign a value to Fuzz_from data member.
293  ///
294  /// @return
295  /// Reference to the data value.
296  TFuzz_from& SetFuzz_from(void);
297 
298  /// Check if a value has been assigned to Fuzz_to data member.
299  ///
300  /// Data member Fuzz_to is optional;
301  /// its type is defined as 'typedef CInt_fuzz TFuzz_to'
302  /// @return
303  /// - true, if a value has been assigned.
304  /// - false, otherwise.
305  bool IsSetFuzz_to(void) const;
306 
307  /// Check if it is safe to call GetFuzz_to method.
308  ///
309  /// @return
310  /// - true, if the data member is getatable.
311  /// - false, otherwise.
312  bool CanGetFuzz_to(void) const;
313 
314  /// Reset Fuzz_to data member.
315  void ResetFuzz_to(void);
316 
317  /// Get the Fuzz_to member data.
318  ///
319  /// @return
320  /// Reference to the member data.
321  const TFuzz_to& GetFuzz_to(void) const;
322 
323  /// Assign a value to Fuzz_to data member.
324  ///
325  /// @param value
326  /// Reference to value.
327  void SetFuzz_to(TFuzz_to& value);
328 
329  /// Assign a value to Fuzz_to data member.
330  ///
331  /// @return
332  /// Reference to the data value.
333  TFuzz_to& SetFuzz_to(void);
334 
335  /// Reset the whole object
336  virtual void Reset(void);
337 
338 
339 private:
340  // Prohibit copy constructor and assignment operator
343 
344  // data
345  Uint4 m_set_State[1];
352 };
353 
354 /* @} */
355 
356 
357 
358 
359 
360 ///////////////////////////////////////////////////////////
361 ///////////////////// inline methods //////////////////////
362 ///////////////////////////////////////////////////////////
363 inline
365 {
366  return ((m_set_State[0] & 0x3) != 0);
367 }
368 
369 inline
371 {
372  return IsSetFrom();
373 }
374 
375 inline
377 {
378  m_From = 0;
379  m_set_State[0] &= ~0x3;
380 }
381 
382 inline
384 {
385  if (!CanGetFrom()) {
386  ThrowUnassigned(0);
387  }
388  return m_From;
389 }
390 
391 inline
393 {
394  m_From = value;
395  m_set_State[0] |= 0x3;
396 }
397 
398 inline
400 {
401 #ifdef _DEBUG
402  if (!IsSetFrom()) {
403  memset(&m_From,UnassignedByte(),sizeof(m_From));
404  }
405 #endif
406  m_set_State[0] |= 0x1;
407  return m_From;
408 }
409 
410 inline
412 {
413  return ((m_set_State[0] & 0xc) != 0);
414 }
415 
416 inline
418 {
419  return IsSetTo();
420 }
421 
422 inline
424 {
425  m_To = 0;
426  m_set_State[0] &= ~0xc;
427 }
428 
429 inline
431 {
432  if (!CanGetTo()) {
433  ThrowUnassigned(1);
434  }
435  return m_To;
436 }
437 
438 inline
440 {
441  m_To = value;
442  m_set_State[0] |= 0xc;
443 }
444 
445 inline
447 {
448 #ifdef _DEBUG
449  if (!IsSetTo()) {
450  memset(&m_To,UnassignedByte(),sizeof(m_To));
451  }
452 #endif
453  m_set_State[0] |= 0x4;
454  return m_To;
455 }
456 
457 inline
459 {
460  return ((m_set_State[0] & 0x30) != 0);
461 }
462 
463 inline
465 {
466  return IsSetStrand();
467 }
468 
469 inline
471 {
473  m_set_State[0] &= ~0x30;
474 }
475 
476 inline
478 {
479  if (!CanGetStrand()) {
480  ThrowUnassigned(2);
481  }
482  return m_Strand;
483 }
484 
485 inline
487 {
488  m_Strand = value;
489  m_set_State[0] |= 0x30;
490 }
491 
492 inline
494 {
495 #ifdef _DEBUG
496  if (!IsSetStrand()) {
497  memset(&m_Strand,UnassignedByte(),sizeof(m_Strand));
498  }
499 #endif
500  m_set_State[0] |= 0x10;
501  return m_Strand;
502 }
503 
504 inline
506 {
507  return m_Id.NotEmpty();
508 }
509 
510 inline
512 {
513  return true;
514 }
515 
516 inline
518 {
519  if ( !m_Id ) {
520  const_cast<CSeq_interval_Base*>(this)->ResetId();
521  }
522  return (*m_Id);
523 }
524 
525 inline
527 {
528  if ( !m_Id ) {
529  ResetId();
530  }
531  return (*m_Id);
532 }
533 
534 inline
536 {
537  return m_Fuzz_from.NotEmpty();
538 }
539 
540 inline
542 {
543  return IsSetFuzz_from();
544 }
545 
546 inline
548 {
549  if (!CanGetFuzz_from()) {
550  ThrowUnassigned(4);
551  }
552  return (*m_Fuzz_from);
553 }
554 
555 inline
557 {
558  return m_Fuzz_to.NotEmpty();
559 }
560 
561 inline
563 {
564  return IsSetFuzz_to();
565 }
566 
567 inline
569 {
570  if (!CanGetFuzz_to()) {
571  ThrowUnassigned(5);
572  }
573  return (*m_Fuzz_to);
574 }
575 
576 ///////////////////////////////////////////////////////////
577 ////////////////// end of inline methods //////////////////
578 ///////////////////////////////////////////////////////////
579 
580 
581 
582 
583 
584 END_objects_SCOPE // namespace ncbi::objects::
585 
587 
588 
589 #endif // OBJECTS_SEQLOC_SEQ_INTERVAL_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
CSeq_interval_Base –.
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
const TFuzz_from & GetFuzz_from(void) const
Get the Fuzz_from member data.
bool CanGetFuzz_to(void) const
Check if it is safe to call GetFuzz_to method.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
bool CanGetStrand(void) const
Check if it is safe to call GetStrand method.
CSerialObject Tparent
const TId & GetId(void) const
Get the Id member data.
void ResetId(void)
Reset Id data member.
const TFuzz_to & GetFuzz_to(void) const
Get the Fuzz_to member data.
TFrom GetFrom(void) const
Get the From member data.
bool CanGetTo(void) const
Check if it is safe to call GetTo method.
CRef< TFuzz_to > m_Fuzz_to
TStrand & SetStrand(void)
Assign a value to Strand data member.
TFrom & SetFrom(void)
Assign a value to From data member.
bool IsSetTo(void) const
Check if a value has been assigned to To data member.
bool CanGetId(void) const
Check if it is safe to call GetId method.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
bool IsSetFuzz_to(void) const
Check if a value has been assigned to Fuzz_to data member.
void ResetFrom(void)
Reset From data member.
TId & SetId(void)
Assign a value to Id data member.
TStrand GetStrand(void) const
Get the Strand member data.
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
TTo GetTo(void) const
Get the To member data.
TTo & SetTo(void)
Assign a value to To data member.
bool IsSetFrom(void) const
Check if a value has been assigned to From data member.
CSeq_interval_Base(const CSeq_interval_Base &)
bool IsSetFuzz_from(void) const
Check if a value has been assigned to Fuzz_from data member.
void ResetStrand(void)
Reset Strand data member.
CRef< TFuzz_from > m_Fuzz_from
void ResetTo(void)
Reset To data member.
CSeq_interval_Base & operator=(const CSeq_interval_Base &)
bool CanGetFrom(void) const
Check if it is safe to call GetFrom method.
bool CanGetFuzz_from(void) const
Check if it is safe to call GetFuzz_from method.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Wed May 15 15:09:39 2024 by modify_doxy.py rev. 669887