NCBI C++ ToolKit
HGVS_Coordinate_.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 HGVS_Coordinate_.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/coords/objcoords.asn">objcoords.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/coords/objcoords.def">objcoords.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_COORDS_HGVS_COORDINATE_BASE_HPP
42 #define OBJECTS_COORDS_HGVS_COORDINATE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
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 // generated classes
60 
61 
62 /** @addtogroup dataspec_NCBI_HGVSCoordinate
63  *
64  * @{
65  */
66 
67 /////////////////////////////////////////////////////////////////////////////
68 ///
69 /// CHGVS_Coordinate_Base --
70 ///
71 
73 {
75 public:
76  // constructor
78  // destructor
79  virtual ~CHGVS_Coordinate_Base(void);
80 
81  // type info
83 
84  // types
85  typedef int TMarker_pos;
86  typedef string TTitle;
87  typedef string TObject_id;
88  typedef int TPos_mapped;
89  typedef string THgvs_position;
90  typedef string TSequence;
91 
92  // member index
93  enum class E_memberIndex {
94  e__allMandatory = 0,
95  e_marker_pos,
96  e_title,
97  e_object_id,
98  e_pos_mapped,
99  e_hgvs_position,
100  e_sequence
101  };
103 
104  // getters
105  // setters
106 
107  /// actual marker position
108  /// this is supplied because this is the position of the marker in the main
109  /// sequence's coordinate space; this is different than the mapped
110  /// coordinate space.
111  /// Check if a value has been assigned to Marker_pos data member.
112  ///
113  /// Data member Marker_pos is mandatory;
114  /// its type is defined as 'typedef int TMarker_pos'
115  /// @return
116  /// - true, if a value has been assigned.
117  /// - false, otherwise.
118  bool IsSetMarker_pos(void) const;
119 
120  /// Check if it is safe to call GetMarker_pos method.
121  ///
122  /// @return
123  /// - true, if the data member is getatable.
124  /// - false, otherwise.
125  bool CanGetMarker_pos(void) const;
126 
127  /// Reset Marker_pos data member.
128  void ResetMarker_pos(void);
129 
130  /// Get the Marker_pos member data.
131  ///
132  /// @return
133  /// Copy of the member data.
134  TMarker_pos GetMarker_pos(void) const;
135 
136  /// Assign a value to Marker_pos data member.
137  ///
138  /// @param value
139  /// Value to assign
140  void SetMarker_pos(TMarker_pos value);
141 
142  /// Assign a value to Marker_pos data member.
143  ///
144  /// @return
145  /// Reference to the data value.
146  TMarker_pos& SetMarker_pos(void);
147 
148  /// pretty-printed name for the object
149  /// in general, this should be the "best" seq-id for the product
150  /// of a feature represented at a position
151  /// Check if a value has been assigned to Title data member.
152  ///
153  /// Data member Title is mandatory;
154  /// its type is defined as 'typedef string TTitle'
155  /// @return
156  /// - true, if a value has been assigned.
157  /// - false, otherwise.
158  bool IsSetTitle(void) const;
159 
160  /// Check if it is safe to call GetTitle method.
161  ///
162  /// @return
163  /// - true, if the data member is getatable.
164  /// - false, otherwise.
165  bool CanGetTitle(void) const;
166 
167  /// Reset Title data member.
168  void ResetTitle(void);
169 
170  /// Get the Title member data.
171  ///
172  /// @return
173  /// Reference to the member data.
174  const TTitle& GetTitle(void) const;
175 
176  /// Assign a value to Title data member.
177  ///
178  /// @param value
179  /// Value to assign
180  void SetTitle(const TTitle& value);
181  void SetTitle(TTitle&& value);
182 
183  /// Assign a value to Title data member.
184  ///
185  /// @return
186  /// Reference to the data value.
187  TTitle& SetTitle(void);
188 
189  /// the fingerprint of the object in question
190  /// this is a complex reversible hash
191  /// Check if a value has been assigned to Object_id data member.
192  ///
193  /// Data member Object_id is optional;
194  /// its type is defined as 'typedef string TObject_id'
195  /// @return
196  /// - true, if a value has been assigned.
197  /// - false, otherwise.
198  bool IsSetObject_id(void) const;
199 
200  /// Check if it is safe to call GetObject_id method.
201  ///
202  /// @return
203  /// - true, if the data member is getatable.
204  /// - false, otherwise.
205  bool CanGetObject_id(void) const;
206 
207  /// Reset Object_id data member.
208  void ResetObject_id(void);
209 
210  /// Get the Object_id member data.
211  ///
212  /// @return
213  /// Reference to the member data.
214  const TObject_id& GetObject_id(void) const;
215 
216  /// Assign a value to Object_id data member.
217  ///
218  /// @param value
219  /// Value to assign
220  void SetObject_id(const TObject_id& value);
221  void SetObject_id(TObject_id&& value);
222 
223  /// Assign a value to Object_id data member.
224  ///
225  /// @return
226  /// Reference to the data value.
227  TObject_id& SetObject_id(void);
228 
229  /// the mapped position in the object's coordinate space
230  /// it's not valid for DNA coordinate in UTR and intergenic region,
231  /// while hgvs-position can be meaningful, that is why OPTIONAL.
232  /// Check if a value has been assigned to Pos_mapped data member.
233  ///
234  /// Data member Pos_mapped is optional;
235  /// its type is defined as 'typedef int TPos_mapped'
236  /// @return
237  /// - true, if a value has been assigned.
238  /// - false, otherwise.
239  bool IsSetPos_mapped(void) const;
240 
241  /// Check if it is safe to call GetPos_mapped method.
242  ///
243  /// @return
244  /// - true, if the data member is getatable.
245  /// - false, otherwise.
246  bool CanGetPos_mapped(void) const;
247 
248  /// Reset Pos_mapped data member.
249  void ResetPos_mapped(void);
250 
251  /// Get the Pos_mapped member data.
252  ///
253  /// @return
254  /// Copy of the member data.
255  TPos_mapped GetPos_mapped(void) const;
256 
257  /// Assign a value to Pos_mapped data member.
258  ///
259  /// @param value
260  /// Value to assign
261  void SetPos_mapped(TPos_mapped value);
262 
263  /// Assign a value to Pos_mapped data member.
264  ///
265  /// @return
266  /// Reference to the data value.
267  TPos_mapped& SetPos_mapped(void);
268 
269  /// a label for this position
270  /// this shall always be in HGVS nomenclature
271  /// Check if a value has been assigned to Hgvs_position data member.
272  ///
273  /// Data member Hgvs_position is mandatory;
274  /// its type is defined as 'typedef string THgvs_position'
275  /// @return
276  /// - true, if a value has been assigned.
277  /// - false, otherwise.
278  bool IsSetHgvs_position(void) const;
279 
280  /// Check if it is safe to call GetHgvs_position method.
281  ///
282  /// @return
283  /// - true, if the data member is getatable.
284  /// - false, otherwise.
285  bool CanGetHgvs_position(void) const;
286 
287  /// Reset Hgvs_position data member.
288  void ResetHgvs_position(void);
289 
290  /// Get the Hgvs_position member data.
291  ///
292  /// @return
293  /// Reference to the member data.
294  const THgvs_position& GetHgvs_position(void) const;
295 
296  /// Assign a value to Hgvs_position data member.
297  ///
298  /// @param value
299  /// Value to assign
300  void SetHgvs_position(const THgvs_position& value);
301  void SetHgvs_position(THgvs_position&& value);
302 
303  /// Assign a value to Hgvs_position data member.
304  ///
305  /// @return
306  /// Reference to the data value.
307  THgvs_position& SetHgvs_position(void);
308 
309  /// a sequence for this position
310  /// Check if a value has been assigned to Sequence data member.
311  ///
312  /// Data member Sequence is mandatory;
313  /// its type is defined as 'typedef string TSequence'
314  /// @return
315  /// - true, if a value has been assigned.
316  /// - false, otherwise.
317  bool IsSetSequence(void) const;
318 
319  /// Check if it is safe to call GetSequence method.
320  ///
321  /// @return
322  /// - true, if the data member is getatable.
323  /// - false, otherwise.
324  bool CanGetSequence(void) const;
325 
326  /// Reset Sequence data member.
327  void ResetSequence(void);
328 
329  /// Get the Sequence member data.
330  ///
331  /// @return
332  /// Reference to the member data.
333  const TSequence& GetSequence(void) const;
334 
335  /// Assign a value to Sequence data member.
336  ///
337  /// @param value
338  /// Value to assign
339  void SetSequence(const TSequence& value);
340  void SetSequence(TSequence&& value);
341 
342  /// Assign a value to Sequence data member.
343  ///
344  /// @return
345  /// Reference to the data value.
346  TSequence& SetSequence(void);
347 
348  /// Reset the whole object
349  virtual void Reset(void);
350 
351 
352 private:
353  // Prohibit copy constructor and assignment operator
356 
357  // data
358  Uint4 m_set_State[1];
360  string m_Title;
361  string m_Object_id;
364  string m_Sequence;
365 };
366 
367 /* @} */
368 
369 
370 
371 
372 
373 ///////////////////////////////////////////////////////////
374 ///////////////////// inline methods //////////////////////
375 ///////////////////////////////////////////////////////////
376 inline
378 {
379  return ((m_set_State[0] & 0x3) != 0);
380 }
381 
382 inline
384 {
385  return IsSetMarker_pos();
386 }
387 
388 inline
390 {
391  m_Marker_pos = 0;
392  m_set_State[0] &= ~0x3;
393 }
394 
395 inline
397 {
398  if (!CanGetMarker_pos()) {
399  ThrowUnassigned(0);
400  }
401  return m_Marker_pos;
402 }
403 
404 inline
406 {
408  m_set_State[0] |= 0x3;
409 }
410 
411 inline
413 {
414 #ifdef _DEBUG
415  if (!IsSetMarker_pos()) {
416  memset(&m_Marker_pos,UnassignedByte(),sizeof(m_Marker_pos));
417  }
418 #endif
419  m_set_State[0] |= 0x1;
420  return m_Marker_pos;
421 }
422 
423 inline
425 {
426  return ((m_set_State[0] & 0xc) != 0);
427 }
428 
429 inline
431 {
432  return IsSetTitle();
433 }
434 
435 inline
437 {
438  if (!CanGetTitle()) {
439  ThrowUnassigned(1);
440  }
441  return m_Title;
442 }
443 
444 inline
446 {
447  m_Title = value;
448  m_set_State[0] |= 0xc;
449 }
450 
451 inline
453 {
454  m_Title = std::forward<CHGVS_Coordinate_Base::TTitle>(value);
455  m_set_State[0] |= 0xc;
456 }
457 
458 inline
460 {
461 #ifdef _DEBUG
462  if (!IsSetTitle()) {
464  }
465 #endif
466  m_set_State[0] |= 0x4;
467  return m_Title;
468 }
469 
470 inline
472 {
473  return ((m_set_State[0] & 0x30) != 0);
474 }
475 
476 inline
478 {
479  return IsSetObject_id();
480 }
481 
482 inline
484 {
485  if (!CanGetObject_id()) {
486  ThrowUnassigned(2);
487  }
488  return m_Object_id;
489 }
490 
491 inline
493 {
494  m_Object_id = value;
495  m_set_State[0] |= 0x30;
496 }
497 
498 inline
500 {
501  m_Object_id = std::forward<CHGVS_Coordinate_Base::TObject_id>(value);
502  m_set_State[0] |= 0x30;
503 }
504 
505 inline
507 {
508 #ifdef _DEBUG
509  if (!IsSetObject_id()) {
511  }
512 #endif
513  m_set_State[0] |= 0x10;
514  return m_Object_id;
515 }
516 
517 inline
519 {
520  return ((m_set_State[0] & 0xc0) != 0);
521 }
522 
523 inline
525 {
526  return IsSetPos_mapped();
527 }
528 
529 inline
531 {
532  m_Pos_mapped = 0;
533  m_set_State[0] &= ~0xc0;
534 }
535 
536 inline
538 {
539  if (!CanGetPos_mapped()) {
540  ThrowUnassigned(3);
541  }
542  return m_Pos_mapped;
543 }
544 
545 inline
547 {
549  m_set_State[0] |= 0xc0;
550 }
551 
552 inline
554 {
555 #ifdef _DEBUG
556  if (!IsSetPos_mapped()) {
557  memset(&m_Pos_mapped,UnassignedByte(),sizeof(m_Pos_mapped));
558  }
559 #endif
560  m_set_State[0] |= 0x40;
561  return m_Pos_mapped;
562 }
563 
564 inline
566 {
567  return ((m_set_State[0] & 0x300) != 0);
568 }
569 
570 inline
572 {
573  return IsSetHgvs_position();
574 }
575 
576 inline
578 {
579  if (!CanGetHgvs_position()) {
580  ThrowUnassigned(4);
581  }
582  return m_Hgvs_position;
583 }
584 
585 inline
587 {
589  m_set_State[0] |= 0x300;
590 }
591 
592 inline
594 {
595  m_Hgvs_position = std::forward<CHGVS_Coordinate_Base::THgvs_position>(value);
596  m_set_State[0] |= 0x300;
597 }
598 
599 inline
601 {
602 #ifdef _DEBUG
603  if (!IsSetHgvs_position()) {
605  }
606 #endif
607  m_set_State[0] |= 0x100;
608  return m_Hgvs_position;
609 }
610 
611 inline
613 {
614  return ((m_set_State[0] & 0xc00) != 0);
615 }
616 
617 inline
619 {
620  return IsSetSequence();
621 }
622 
623 inline
625 {
626  if (!CanGetSequence()) {
627  ThrowUnassigned(5);
628  }
629  return m_Sequence;
630 }
631 
632 inline
634 {
635  m_Sequence = value;
636  m_set_State[0] |= 0xc00;
637 }
638 
639 inline
641 {
642  m_Sequence = std::forward<CHGVS_Coordinate_Base::TSequence>(value);
643  m_set_State[0] |= 0xc00;
644 }
645 
646 inline
648 {
649 #ifdef _DEBUG
650  if (!IsSetSequence()) {
652  }
653 #endif
654  m_set_State[0] |= 0x400;
655  return m_Sequence;
656 }
657 
658 ///////////////////////////////////////////////////////////
659 ////////////////// end of inline methods //////////////////
660 ///////////////////////////////////////////////////////////
661 
662 
663 
664 
665 
666 END_objects_SCOPE // namespace ncbi::objects::
667 
669 
670 
671 #endif // OBJECTS_COORDS_HGVS_COORDINATE_BASE_HPP
CHGVS_Coordinate_Base –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
SBlastSequence GetSequence(const objects::CSeq_loc &sl, EBlastEncoding encoding, objects::CScope *scope, objects::ENa_strand strand=objects::eNa_strand_plus, ESentinelType sentinel=eSentinels, std::string *warnings=NULL)
Retrieves a sequence using the object manager.
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
Definition: serialbase.hpp:175
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
Definition: seqtitle.cpp:106
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_OBJCOORDS_EXPORT
Definition: ncbi_export.h:656
bool CanGetTitle(void) const
Check if it is safe to call GetTitle method.
const THgvs_position & GetHgvs_position(void) const
Get the Hgvs_position member data.
bool IsSetMarker_pos(void) const
actual marker position this is supplied because this is the position of the marker in the main sequen...
bool IsSetHgvs_position(void) const
a label for this position this shall always be in HGVS nomenclature Check if a value has been assigne...
bool IsSetTitle(void) const
pretty-printed name for the object in general, this should be the "best" seq-id for the product of a ...
TPos_mapped & SetPos_mapped(void)
Assign a value to Pos_mapped data member.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
TObject_id & SetObject_id(void)
Assign a value to Object_id data member.
CHGVS_Coordinate_Base & operator=(const CHGVS_Coordinate_Base &)
void ResetMarker_pos(void)
Reset Marker_pos data member.
const TObject_id & GetObject_id(void) const
Get the Object_id member data.
bool IsSetSequence(void) const
a sequence for this position Check if a value has been assigned to Sequence data member.
THgvs_position & SetHgvs_position(void)
Assign a value to Hgvs_position data member.
TPos_mapped GetPos_mapped(void) const
Get the Pos_mapped member data.
void ResetPos_mapped(void)
Reset Pos_mapped data member.
TMarker_pos GetMarker_pos(void) const
Get the Marker_pos member data.
const TSequence & GetSequence(void) const
Get the Sequence member data.
bool CanGetSequence(void) const
Check if it is safe to call GetSequence method.
TTitle & SetTitle(void)
Assign a value to Title data member.
bool IsSetPos_mapped(void) const
the mapped position in the object's coordinate space it's not valid for DNA coordinate in UTR and int...
bool IsSetObject_id(void) const
the fingerprint of the object in question this is a complex reversible hash Check if a value has been...
bool CanGetObject_id(void) const
Check if it is safe to call GetObject_id method.
bool CanGetHgvs_position(void) const
Check if it is safe to call GetHgvs_position method.
TSequence & SetSequence(void)
Assign a value to Sequence data member.
TMarker_pos & SetMarker_pos(void)
Assign a value to Marker_pos data member.
bool CanGetMarker_pos(void) const
Check if it is safe to call GetMarker_pos method.
const TTitle & GetTitle(void) const
Get the Title member data.
bool CanGetPos_mapped(void) const
Check if it is safe to call GetPos_mapped method.
CHGVS_Coordinate_Base(const CHGVS_Coordinate_Base &)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Tue May 28 05:49:37 2024 by modify_doxy.py rev. 669887