NCBI C++ ToolKit
Seq_graph_.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_graph_.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/seqres/seqres.asn">seqres.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqres/seqres.def">seqres.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_SEQRES_SEQ_GRAPH_BASE_HPP
42 #define OBJECTS_SEQRES_SEQ_GRAPH_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 // forward declarations
60 class CByte_graph;
61 class CInt_graph;
62 class CReal_graph;
63 class CSeq_loc;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_Seqres
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///*** Sequence Graph ********************************
76 ///*
77 ///* for values mapped by residue or range to sequence
78 ///*
79 ///
80 /// CSeq_graph_Base --
81 ///
82 
84 {
86 public:
87  // constructor
88  CSeq_graph_Base(void);
89  // destructor
90  virtual ~CSeq_graph_Base(void);
91 
92  // type info
94 
95  /////////////////////////////////////////////////////////////////////////////
96  ///
97  /// C_Graph --
98  ///
99 
101  {
103  public:
104  // constructor
105  C_Graph(void);
106  // destructor
107  ~C_Graph(void);
108 
109  // type info
111 
112 
113  /// Choice variants.
114  enum E_Choice {
115  e_not_set = 0, ///< No variant selected
118  e_Byte
119  };
120  /// Maximum+1 value of the choice variant enumerator.
122  e_MaxChoice = 4 ///< == e_Byte+1
123  };
124 
125  /// Reset the whole object
126  void Reset(void);
127 
128  /// Reset the selection (set it to e_not_set).
129  void ResetSelection(void);
130 
131  /// Which variant is currently selected.
132  ///
133  /// @return
134  /// Choice state enumerator.
135  E_Choice Which(void) const;
136 
137  /// Verify selection, throw exception if it differs from the expected.
138  ///
139  /// @param index
140  /// Expected selection.
141  void CheckSelected(E_Choice index) const;
142 
143  /// Throw 'InvalidSelection' exception.
144  ///
145  /// @param index
146  /// Expected selection.
147  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
148 
149  /// Retrieve selection name (for diagnostic purposes).
150  ///
151  /// @param index
152  /// One of possible selection states.
153  /// @return
154  /// Name string.
155  static string SelectionName(E_Choice index);
156 
157  /// Select the requested variant if needed.
158  ///
159  /// @param index
160  /// New selection state.
161  /// @param reset
162  /// Flag that defines the resetting of the variant data. The data will
163  /// be reset if either the current selection differs from the new one,
164  /// or the flag is set to eDoResetVariant.
166  /// Select the requested variant if needed,
167  /// allocating CObject variants from memory pool.
168  void Select(E_Choice index,
169  EResetVariant reset,
170  CObjectMemoryPool* pool);
171 
172  // types
174  typedef CInt_graph TInt;
176 
177  // getters
178  // setters
179 
180 
181  /// Check if variant Real is selected.
182  ///
183  /// Real type is defined as 'typedef CReal_graph TReal'.
184  /// @return
185  /// - true, if the variant is selected.
186  /// - false, otherwise.
187  bool IsReal(void) const;
188 
189  /// Get the variant data.
190  ///
191  /// @return
192  /// Reference to the data.
193  const TReal& GetReal(void) const;
194 
195  /// Select the variant.
196  ///
197  /// @return
198  /// Reference to the variant data.
199  TReal& SetReal(void);
200  /// Select the variant and set its data.
201  ///
202  /// @param value
203  /// Reference to the data.
204  void SetReal(TReal& value);
205 
206 
207  /// Check if variant Int is selected.
208  ///
209  /// Int type is defined as 'typedef CInt_graph TInt'.
210  /// @return
211  /// - true, if the variant is selected.
212  /// - false, otherwise.
213  bool IsInt(void) const;
214 
215  /// Get the variant data.
216  ///
217  /// @return
218  /// Reference to the data.
219  const TInt& GetInt(void) const;
220 
221  /// Select the variant.
222  ///
223  /// @return
224  /// Reference to the variant data.
225  TInt& SetInt(void);
226  /// Select the variant and set its data.
227  ///
228  /// @param value
229  /// Reference to the data.
230  void SetInt(TInt& value);
231 
232 
233  /// Check if variant Byte is selected.
234  ///
235  /// Byte type is defined as 'typedef CByte_graph TByte'.
236  /// @return
237  /// - true, if the variant is selected.
238  /// - false, otherwise.
239  bool IsByte(void) const;
240 
241  /// Get the variant data.
242  ///
243  /// @return
244  /// Reference to the data.
245  const TByte& GetByte(void) const;
246 
247  /// Select the variant.
248  ///
249  /// @return
250  /// Reference to the variant data.
251  TByte& SetByte(void);
252  /// Select the variant and set its data.
253  ///
254  /// @param value
255  /// Reference to the data.
256  void SetByte(TByte& value);
257 
258 
259  private:
260  // copy constructor and assignment operator
261  C_Graph(const C_Graph& );
263  // choice state
265  // helper methods
266  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
267 
268  static const char* const sm_SelectionNames[];
269  // data
270  NCBI_NS_NCBI::CSerialObject *m_object;
271  };
272  // types
273  typedef string TTitle;
274  typedef string TComment;
275  typedef CSeq_loc TLoc;
276  typedef string TTitle_x;
277  typedef string TTitle_y;
278  typedef TSeqPos TComp;
279  typedef double TA;
280  typedef double TB;
281  typedef TSeqPos TNumval;
282  typedef C_Graph TGraph;
283 
284  // member index
285  enum class E_memberIndex {
286  e__allMandatory = 0,
287  e_title,
288  e_comment,
289  e_loc,
290  e_title_x,
291  e_title_y,
292  e_comp,
293  e_a,
294  e_b,
295  e_numval,
296  e_graph
297  };
299 
300  // getters
301  // setters
302 
303  /// Check if a value has been assigned to Title data member.
304  ///
305  /// Data member Title is optional;
306  /// its type is defined as 'typedef string TTitle'
307  /// @return
308  /// - true, if a value has been assigned.
309  /// - false, otherwise.
310  bool IsSetTitle(void) const;
311 
312  /// Check if it is safe to call GetTitle method.
313  ///
314  /// @return
315  /// - true, if the data member is getatable.
316  /// - false, otherwise.
317  bool CanGetTitle(void) const;
318 
319  /// Reset Title data member.
320  void ResetTitle(void);
321 
322  /// Get the Title member data.
323  ///
324  /// @return
325  /// Reference to the member data.
326  const TTitle& GetTitle(void) const;
327 
328  /// Assign a value to Title data member.
329  ///
330  /// @param value
331  /// Value to assign
332  void SetTitle(const TTitle& value);
333  void SetTitle(TTitle&& value);
334 
335  /// Assign a value to Title data member.
336  ///
337  /// @return
338  /// Reference to the data value.
339  TTitle& SetTitle(void);
340 
341  /// Check if a value has been assigned to Comment data member.
342  ///
343  /// Data member Comment is optional;
344  /// its type is defined as 'typedef string TComment'
345  /// @return
346  /// - true, if a value has been assigned.
347  /// - false, otherwise.
348  bool IsSetComment(void) const;
349 
350  /// Check if it is safe to call GetComment method.
351  ///
352  /// @return
353  /// - true, if the data member is getatable.
354  /// - false, otherwise.
355  bool CanGetComment(void) const;
356 
357  /// Reset Comment data member.
358  void ResetComment(void);
359 
360  /// Get the Comment member data.
361  ///
362  /// @return
363  /// Reference to the member data.
364  const TComment& GetComment(void) const;
365 
366  /// Assign a value to Comment data member.
367  ///
368  /// @param value
369  /// Value to assign
370  void SetComment(const TComment& value);
371  void SetComment(TComment&& value);
372 
373  /// Assign a value to Comment data member.
374  ///
375  /// @return
376  /// Reference to the data value.
377  TComment& SetComment(void);
378 
379  /// region this applies to
380  /// Check if a value has been assigned to Loc data member.
381  ///
382  /// Data member Loc is mandatory;
383  /// its type is defined as 'typedef CSeq_loc TLoc'
384  /// @return
385  /// - true, if a value has been assigned.
386  /// - false, otherwise.
387  bool IsSetLoc(void) const;
388 
389  /// Check if it is safe to call GetLoc method.
390  ///
391  /// @return
392  /// - true, if the data member is getatable.
393  /// - false, otherwise.
394  bool CanGetLoc(void) const;
395 
396  /// Reset Loc data member.
397  void ResetLoc(void);
398 
399  /// Get the Loc member data.
400  ///
401  /// @return
402  /// Reference to the member data.
403  const TLoc& GetLoc(void) const;
404 
405  /// Assign a value to Loc data member.
406  ///
407  /// @param value
408  /// Reference to value.
409  void SetLoc(TLoc& value);
410 
411  /// Assign a value to Loc data member.
412  ///
413  /// @return
414  /// Reference to the data value.
415  TLoc& SetLoc(void);
416 
417  /// title for x-axis
418  /// Check if a value has been assigned to Title_x data member.
419  ///
420  /// Data member Title_x is optional;
421  /// its type is defined as 'typedef string TTitle_x'
422  /// @return
423  /// - true, if a value has been assigned.
424  /// - false, otherwise.
425  bool IsSetTitle_x(void) const;
426 
427  /// Check if it is safe to call GetTitle_x method.
428  ///
429  /// @return
430  /// - true, if the data member is getatable.
431  /// - false, otherwise.
432  bool CanGetTitle_x(void) const;
433 
434  /// Reset Title_x data member.
435  void ResetTitle_x(void);
436 
437  /// Get the Title_x member data.
438  ///
439  /// @return
440  /// Reference to the member data.
441  const TTitle_x& GetTitle_x(void) const;
442 
443  /// Assign a value to Title_x data member.
444  ///
445  /// @param value
446  /// Value to assign
447  void SetTitle_x(const TTitle_x& value);
448  void SetTitle_x(TTitle_x&& value);
449 
450  /// Assign a value to Title_x data member.
451  ///
452  /// @return
453  /// Reference to the data value.
454  TTitle_x& SetTitle_x(void);
455 
456  /// Check if a value has been assigned to Title_y data member.
457  ///
458  /// Data member Title_y is optional;
459  /// its type is defined as 'typedef string TTitle_y'
460  /// @return
461  /// - true, if a value has been assigned.
462  /// - false, otherwise.
463  bool IsSetTitle_y(void) const;
464 
465  /// Check if it is safe to call GetTitle_y method.
466  ///
467  /// @return
468  /// - true, if the data member is getatable.
469  /// - false, otherwise.
470  bool CanGetTitle_y(void) const;
471 
472  /// Reset Title_y data member.
473  void ResetTitle_y(void);
474 
475  /// Get the Title_y member data.
476  ///
477  /// @return
478  /// Reference to the member data.
479  const TTitle_y& GetTitle_y(void) const;
480 
481  /// Assign a value to Title_y data member.
482  ///
483  /// @param value
484  /// Value to assign
485  void SetTitle_y(const TTitle_y& value);
486  void SetTitle_y(TTitle_y&& value);
487 
488  /// Assign a value to Title_y data member.
489  ///
490  /// @return
491  /// Reference to the data value.
492  TTitle_y& SetTitle_y(void);
493 
494  /// compression (residues/value)
495  /// Check if a value has been assigned to Comp data member.
496  ///
497  /// Data member Comp is optional;
498  /// its type is defined as 'typedef TSeqPos TComp'
499  /// @return
500  /// - true, if a value has been assigned.
501  /// - false, otherwise.
502  bool IsSetComp(void) const;
503 
504  /// Check if it is safe to call GetComp method.
505  ///
506  /// @return
507  /// - true, if the data member is getatable.
508  /// - false, otherwise.
509  bool CanGetComp(void) const;
510 
511  /// Reset Comp data member.
512  void ResetComp(void);
513 
514  /// Get the Comp member data.
515  ///
516  /// @return
517  /// Copy of the member data.
518  TComp GetComp(void) const;
519 
520  /// Assign a value to Comp data member.
521  ///
522  /// @param value
523  /// Value to assign
524  void SetComp(TComp value);
525 
526  /// Assign a value to Comp data member.
527  ///
528  /// @return
529  /// Reference to the data value.
530  TComp& SetComp(void);
531 
532  /// for scaling values
533  /// Check if a value has been assigned to A data member.
534  ///
535  /// Data member A is optional;
536  /// its type is defined as 'typedef double TA'
537  /// @return
538  /// - true, if a value has been assigned.
539  /// - false, otherwise.
540  bool IsSetA(void) const;
541 
542  /// Check if it is safe to call GetA method.
543  ///
544  /// @return
545  /// - true, if the data member is getatable.
546  /// - false, otherwise.
547  bool CanGetA(void) const;
548 
549  /// Reset A data member.
550  void ResetA(void);
551 
552  /// Get the A member data.
553  ///
554  /// @return
555  /// Copy of the member data.
556  TA GetA(void) const;
557 
558  /// Assign a value to A data member.
559  ///
560  /// @param value
561  /// Value to assign
562  void SetA(TA value);
563 
564  /// Assign a value to A data member.
565  ///
566  /// @return
567  /// Reference to the data value.
568  TA& SetA(void);
569 
570  /// display = (a x value) + b
571  /// Check if a value has been assigned to B data member.
572  ///
573  /// Data member B is optional;
574  /// its type is defined as 'typedef double TB'
575  /// @return
576  /// - true, if a value has been assigned.
577  /// - false, otherwise.
578  bool IsSetB(void) const;
579 
580  /// Check if it is safe to call GetB method.
581  ///
582  /// @return
583  /// - true, if the data member is getatable.
584  /// - false, otherwise.
585  bool CanGetB(void) const;
586 
587  /// Reset B data member.
588  void ResetB(void);
589 
590  /// Get the B member data.
591  ///
592  /// @return
593  /// Copy of the member data.
594  TB GetB(void) const;
595 
596  /// Assign a value to B data member.
597  ///
598  /// @param value
599  /// Value to assign
600  void SetB(TB value);
601 
602  /// Assign a value to B data member.
603  ///
604  /// @return
605  /// Reference to the data value.
606  TB& SetB(void);
607 
608  /// number of values in graph
609  /// Check if a value has been assigned to Numval data member.
610  ///
611  /// Data member Numval is mandatory;
612  /// its type is defined as 'typedef TSeqPos TNumval'
613  /// @return
614  /// - true, if a value has been assigned.
615  /// - false, otherwise.
616  bool IsSetNumval(void) const;
617 
618  /// Check if it is safe to call GetNumval method.
619  ///
620  /// @return
621  /// - true, if the data member is getatable.
622  /// - false, otherwise.
623  bool CanGetNumval(void) const;
624 
625  /// Reset Numval data member.
626  void ResetNumval(void);
627 
628  /// Get the Numval member data.
629  ///
630  /// @return
631  /// Copy of the member data.
632  TNumval GetNumval(void) const;
633 
634  /// Assign a value to Numval data member.
635  ///
636  /// @param value
637  /// Value to assign
638  void SetNumval(TNumval value);
639 
640  /// Assign a value to Numval data member.
641  ///
642  /// @return
643  /// Reference to the data value.
644  TNumval& SetNumval(void);
645 
646  /// Check if a value has been assigned to Graph data member.
647  ///
648  /// Data member Graph is mandatory;
649  /// its type is defined as 'typedef C_Graph TGraph'
650  /// @return
651  /// - true, if a value has been assigned.
652  /// - false, otherwise.
653  bool IsSetGraph(void) const;
654 
655  /// Check if it is safe to call GetGraph method.
656  ///
657  /// @return
658  /// - true, if the data member is getatable.
659  /// - false, otherwise.
660  bool CanGetGraph(void) const;
661 
662  /// Reset Graph data member.
663  void ResetGraph(void);
664 
665  /// Get the Graph member data.
666  ///
667  /// @return
668  /// Reference to the member data.
669  const TGraph& GetGraph(void) const;
670 
671  /// Assign a value to Graph data member.
672  ///
673  /// @param value
674  /// Reference to value.
675  void SetGraph(TGraph& value);
676 
677  /// Assign a value to Graph data member.
678  ///
679  /// @return
680  /// Reference to the data value.
681  TGraph& SetGraph(void);
682 
683  /// Reset the whole object
684  virtual void Reset(void);
685 
686 
687 private:
688  // Prohibit copy constructor and assignment operator
691 
692  // data
693  Uint4 m_set_State[1];
694  string m_Title;
695  string m_Comment;
697  string m_Title_x;
698  string m_Title_y;
700  double m_A;
701  double m_B;
704 };
705 
706 /* @} */
707 
708 
709 
710 
711 
712 ///////////////////////////////////////////////////////////
713 ///////////////////// inline methods //////////////////////
714 ///////////////////////////////////////////////////////////
715 inline
717 {
718  return m_choice;
719 }
720 
721 inline
723 {
724  if ( m_choice != index )
725  ThrowInvalidSelection(index);
726 }
727 
728 inline
729 void CSeq_graph_Base::C_Graph::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
730 {
731  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
732  if ( m_choice != e_not_set )
733  ResetSelection();
734  DoSelect(index, pool);
735  }
736 }
737 
738 inline
740 {
741  Select(index, reset, 0);
742 }
743 
744 inline
746 {
747  return m_choice == e_Real;
748 }
749 
750 inline
752 {
753  return m_choice == e_Int;
754 }
755 
756 inline
758 {
759  return m_choice == e_Byte;
760 }
761 
762 inline
764 {
765  return ((m_set_State[0] & 0x3) != 0);
766 }
767 
768 inline
770 {
771  return IsSetTitle();
772 }
773 
774 inline
776 {
777  if (!CanGetTitle()) {
778  ThrowUnassigned(0);
779  }
780  return m_Title;
781 }
782 
783 inline
785 {
786  m_Title = value;
787  m_set_State[0] |= 0x3;
788 }
789 
790 inline
792 {
793  m_Title = std::forward<CSeq_graph_Base::TTitle>(value);
794  m_set_State[0] |= 0x3;
795 }
796 
797 inline
799 {
800 #ifdef _DEBUG
801  if (!IsSetTitle()) {
803  }
804 #endif
805  m_set_State[0] |= 0x1;
806  return m_Title;
807 }
808 
809 inline
811 {
812  return ((m_set_State[0] & 0xc) != 0);
813 }
814 
815 inline
817 {
818  return IsSetComment();
819 }
820 
821 inline
823 {
824  if (!CanGetComment()) {
825  ThrowUnassigned(1);
826  }
827  return m_Comment;
828 }
829 
830 inline
832 {
833  m_Comment = value;
834  m_set_State[0] |= 0xc;
835 }
836 
837 inline
839 {
840  m_Comment = std::forward<CSeq_graph_Base::TComment>(value);
841  m_set_State[0] |= 0xc;
842 }
843 
844 inline
846 {
847 #ifdef _DEBUG
848  if (!IsSetComment()) {
850  }
851 #endif
852  m_set_State[0] |= 0x4;
853  return m_Comment;
854 }
855 
856 inline
858 {
859  return m_Loc.NotEmpty();
860 }
861 
862 inline
864 {
865  return true;
866 }
867 
868 inline
870 {
871  if ( !m_Loc ) {
872  const_cast<CSeq_graph_Base*>(this)->ResetLoc();
873  }
874  return (*m_Loc);
875 }
876 
877 inline
879 {
880  if ( !m_Loc ) {
881  ResetLoc();
882  }
883  return (*m_Loc);
884 }
885 
886 inline
888 {
889  return ((m_set_State[0] & 0xc0) != 0);
890 }
891 
892 inline
894 {
895  return IsSetTitle_x();
896 }
897 
898 inline
900 {
901  if (!CanGetTitle_x()) {
902  ThrowUnassigned(3);
903  }
904  return m_Title_x;
905 }
906 
907 inline
909 {
910  m_Title_x = value;
911  m_set_State[0] |= 0xc0;
912 }
913 
914 inline
916 {
917  m_Title_x = std::forward<CSeq_graph_Base::TTitle_x>(value);
918  m_set_State[0] |= 0xc0;
919 }
920 
921 inline
923 {
924 #ifdef _DEBUG
925  if (!IsSetTitle_x()) {
927  }
928 #endif
929  m_set_State[0] |= 0x40;
930  return m_Title_x;
931 }
932 
933 inline
935 {
936  return ((m_set_State[0] & 0x300) != 0);
937 }
938 
939 inline
941 {
942  return IsSetTitle_y();
943 }
944 
945 inline
947 {
948  if (!CanGetTitle_y()) {
949  ThrowUnassigned(4);
950  }
951  return m_Title_y;
952 }
953 
954 inline
956 {
957  m_Title_y = value;
958  m_set_State[0] |= 0x300;
959 }
960 
961 inline
963 {
964  m_Title_y = std::forward<CSeq_graph_Base::TTitle_y>(value);
965  m_set_State[0] |= 0x300;
966 }
967 
968 inline
970 {
971 #ifdef _DEBUG
972  if (!IsSetTitle_y()) {
974  }
975 #endif
976  m_set_State[0] |= 0x100;
977  return m_Title_y;
978 }
979 
980 inline
982 {
983  return ((m_set_State[0] & 0xc00) != 0);
984 }
985 
986 inline
988 {
989  return IsSetComp();
990 }
991 
992 inline
994 {
995  m_Comp = 0;
996  m_set_State[0] &= ~0xc00;
997 }
998 
999 inline
1001 {
1002  if (!CanGetComp()) {
1003  ThrowUnassigned(5);
1004  }
1005  return m_Comp;
1006 }
1007 
1008 inline
1010 {
1011  m_Comp = value;
1012  m_set_State[0] |= 0xc00;
1013 }
1014 
1015 inline
1017 {
1018 #ifdef _DEBUG
1019  if (!IsSetComp()) {
1020  memset(&m_Comp,UnassignedByte(),sizeof(m_Comp));
1021  }
1022 #endif
1023  m_set_State[0] |= 0x400;
1024  return m_Comp;
1025 }
1026 
1027 inline
1028 bool CSeq_graph_Base::IsSetA(void) const
1029 {
1030  return ((m_set_State[0] & 0x3000) != 0);
1031 }
1032 
1033 inline
1035 {
1036  return IsSetA();
1037 }
1038 
1039 inline
1041 {
1042  m_A = 0;
1043  m_set_State[0] &= ~0x3000;
1044 }
1045 
1046 inline
1048 {
1049  if (!CanGetA()) {
1050  ThrowUnassigned(6);
1051  }
1052  return m_A;
1053 }
1054 
1055 inline
1057 {
1058  m_A = value;
1059  m_set_State[0] |= 0x3000;
1060 }
1061 
1062 inline
1064 {
1065 #ifdef _DEBUG
1066  if (!IsSetA()) {
1067  memset(&m_A,UnassignedByte(),sizeof(m_A));
1068  }
1069 #endif
1070  m_set_State[0] |= 0x1000;
1071  return m_A;
1072 }
1073 
1074 inline
1075 bool CSeq_graph_Base::IsSetB(void) const
1076 {
1077  return ((m_set_State[0] & 0xc000) != 0);
1078 }
1079 
1080 inline
1082 {
1083  return IsSetB();
1084 }
1085 
1086 inline
1088 {
1089  m_B = 0;
1090  m_set_State[0] &= ~0xc000;
1091 }
1092 
1093 inline
1095 {
1096  if (!CanGetB()) {
1097  ThrowUnassigned(7);
1098  }
1099  return m_B;
1100 }
1101 
1102 inline
1104 {
1105  m_B = value;
1106  m_set_State[0] |= 0xc000;
1107 }
1108 
1109 inline
1111 {
1112 #ifdef _DEBUG
1113  if (!IsSetB()) {
1114  memset(&m_B,UnassignedByte(),sizeof(m_B));
1115  }
1116 #endif
1117  m_set_State[0] |= 0x4000;
1118  return m_B;
1119 }
1120 
1121 inline
1123 {
1124  return ((m_set_State[0] & 0x30000) != 0);
1125 }
1126 
1127 inline
1129 {
1130  return IsSetNumval();
1131 }
1132 
1133 inline
1135 {
1136  m_Numval = 0;
1137  m_set_State[0] &= ~0x30000;
1138 }
1139 
1140 inline
1142 {
1143  if (!CanGetNumval()) {
1144  ThrowUnassigned(8);
1145  }
1146  return m_Numval;
1147 }
1148 
1149 inline
1151 {
1152  m_Numval = value;
1153  m_set_State[0] |= 0x30000;
1154 }
1155 
1156 inline
1158 {
1159 #ifdef _DEBUG
1160  if (!IsSetNumval()) {
1161  memset(&m_Numval,UnassignedByte(),sizeof(m_Numval));
1162  }
1163 #endif
1164  m_set_State[0] |= 0x10000;
1165  return m_Numval;
1166 }
1167 
1168 inline
1170 {
1171  return m_Graph.NotEmpty();
1172 }
1173 
1174 inline
1176 {
1177  return true;
1178 }
1179 
1180 inline
1182 {
1183  if ( !m_Graph ) {
1184  const_cast<CSeq_graph_Base*>(this)->ResetGraph();
1185  }
1186  return (*m_Graph);
1187 }
1188 
1189 inline
1191 {
1192  if ( !m_Graph ) {
1193  ResetGraph();
1194  }
1195  return (*m_Graph);
1196 }
1197 
1198 ///////////////////////////////////////////////////////////
1199 ////////////////// end of inline methods //////////////////
1200 ///////////////////////////////////////////////////////////
1201 
1202 
1203 
1204 
1205 
1206 END_objects_SCOPE // namespace ncbi::objects::
1207 
1209 
1210 
1211 #endif // OBJECTS_SEQRES_SEQ_GRAPH_BASE_HPP
CByte_graph –.
Definition: Byte_graph.hpp:66
CInt_graph –.
Definition: Int_graph.hpp:66
CReal_graph –.
Definition: Real_graph.hpp:66
CRef –.
Definition: ncbiobj.hpp:618
*** Sequence Graph ******************************** * * for values mapped by residue or range to sequ...
Definition: Seq_graph_.hpp:84
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
EResetVariant
Definition: serialbase.hpp:76
static string UnassignedString(void)
Definition: serialbase.hpp:175
@ eDoResetVariant
Definition: serialbase.hpp:77
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_SEQRES_EXPORT
Definition: ncbi_export.h:785
bool CanGetComp(void) const
Check if it is safe to call GetComp method.
Definition: Seq_graph_.hpp:987
bool IsSetNumval(void) const
number of values in graph Check if a value has been assigned to Numval data member.
bool IsSetComp(void) const
compression (residues/value) Check if a value has been assigned to Comp data member.
Definition: Seq_graph_.hpp:981
bool CanGetTitle_y(void) const
Check if it is safe to call GetTitle_y method.
Definition: Seq_graph_.hpp:940
bool IsSetB(void) const
display = (a x value) + b Check if a value has been assigned to B data member.
bool IsSetLoc(void) const
region this applies to Check if a value has been assigned to Loc data member.
Definition: Seq_graph_.hpp:857
TTitle_y & SetTitle_y(void)
Assign a value to Title_y data member.
Definition: Seq_graph_.hpp:969
bool CanGetNumval(void) const
Check if it is safe to call GetNumval method.
bool CanGetComment(void) const
Check if it is safe to call GetComment method.
Definition: Seq_graph_.hpp:816
TLoc & SetLoc(void)
Assign a value to Loc data member.
Definition: Seq_graph_.hpp:878
E_Choice
Choice variants.
Definition: Seq_graph_.hpp:114
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
Definition: Seq_graph_.hpp:810
void ResetA(void)
Reset A data member.
bool CanGetA(void) const
Check if it is safe to call GetA method.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
Definition: Seq_graph_.hpp:121
CRef< TGraph > m_Graph
Definition: Seq_graph_.hpp:703
bool IsSetA(void) const
for scaling values Check if a value has been assigned to A data member.
const TGraph & GetGraph(void) const
Get the Graph member data.
const TTitle & GetTitle(void) const
Get the Title member data.
Definition: Seq_graph_.hpp:775
bool CanGetTitle(void) const
Check if it is safe to call GetTitle method.
Definition: Seq_graph_.hpp:769
bool IsInt(void) const
Check if variant Int is selected.
Definition: Seq_graph_.hpp:751
bool CanGetTitle_x(void) const
Check if it is safe to call GetTitle_x method.
Definition: Seq_graph_.hpp:893
TB GetB(void) const
Get the B member data.
TTitle & SetTitle(void)
Assign a value to Title data member.
Definition: Seq_graph_.hpp:798
const TTitle_x & GetTitle_x(void) const
Get the Title_x member data.
Definition: Seq_graph_.hpp:899
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
C_Graph(const C_Graph &)
CRef< TLoc > m_Loc
Definition: Seq_graph_.hpp:696
bool CanGetLoc(void) const
Check if it is safe to call GetLoc method.
Definition: Seq_graph_.hpp:863
const TTitle_y & GetTitle_y(void) const
Get the Title_y member data.
Definition: Seq_graph_.hpp:946
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
Definition: Seq_graph_.hpp:722
bool IsReal(void) const
Check if variant Real is selected.
Definition: Seq_graph_.hpp:745
TA & SetA(void)
Assign a value to A data member.
TTitle_x & SetTitle_x(void)
Assign a value to Title_x data member.
Definition: Seq_graph_.hpp:922
void ResetLoc(void)
Reset Loc data member.
Definition: Seq_graph_.cpp:215
Uint4 m_set_State[1]
Definition: Seq_graph_.hpp:693
C_Graph & operator=(const C_Graph &)
TComp & SetComp(void)
Assign a value to Comp data member.
TComment & SetComment(void)
Assign a value to Comment data member.
Definition: Seq_graph_.hpp:845
bool CanGetGraph(void) const
Check if it is safe to call GetGraph method.
bool IsByte(void) const
Check if variant Byte is selected.
Definition: Seq_graph_.hpp:757
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_graph_.hpp:716
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
void ResetNumval(void)
Reset Numval data member.
TB & SetB(void)
Assign a value to B data member.
bool CanGetB(void) const
Check if it is safe to call GetB method.
void ResetComp(void)
Reset Comp data member.
Definition: Seq_graph_.hpp:993
TGraph & SetGraph(void)
Assign a value to Graph data member.
const TLoc & GetLoc(void) const
Get the Loc member data.
Definition: Seq_graph_.hpp:869
TNumval GetNumval(void) const
Get the Numval member data.
Tparent::CMemberIndex< E_memberIndex, 11 > TmemberIndex
Definition: Seq_graph_.hpp:298
TA GetA(void) const
Get the A member data.
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
Definition: Seq_graph_.hpp:763
bool IsSetTitle_x(void) const
title for x-axis Check if a value has been assigned to Title_x data member.
Definition: Seq_graph_.hpp:887
bool IsSetGraph(void) const
Check if a value has been assigned to Graph data member.
const TComment & GetComment(void) const
Get the Comment member data.
Definition: Seq_graph_.hpp:822
CSerialObject Tparent
Definition: Seq_graph_.hpp:85
CSeq_graph_Base(const CSeq_graph_Base &)
TNumval & SetNumval(void)
Assign a value to Numval data member.
void ResetGraph(void)
Reset Graph data member.
Definition: Seq_graph_.cpp:241
void ResetB(void)
Reset B data member.
bool IsSetTitle_y(void) const
Check if a value has been assigned to Title_y data member.
Definition: Seq_graph_.hpp:934
TComp GetComp(void) const
Get the Comp member data.
CSeq_graph_Base & operator=(const CSeq_graph_Base &)
NCBI_NS_NCBI::CSerialObject * m_object
Definition: Seq_graph_.hpp:270
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
int GetLoc(const string &acc, const string &pat, CSeq_loc &loc, CScope &scope)
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Tue May 14 16:22:24 2024 by modify_doxy.py rev. 669887