NCBI C++ ToolKit
SeqEdit_Cmd_ReplaceAnnot_.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 SeqEdit_Cmd_ReplaceAnnot_.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/seqedit/seqedit.asn">seqedit.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqedit/seqedit.def">seqedit.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_SEQEDIT_SEQEDIT_CMD_REPLACEANNOT_BASE_HPP
42 #define OBJECTS_SEQEDIT_SEQEDIT_CMD_REPLACEANNOT_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 CSeqEdit_Id;
61 class CSeq_align;
62 class CSeq_feat;
63 class CSeq_graph;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_SeqEdit
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 /// Replace an annotation object of a bioseq or a bioseq-set
76 ///
77 /// CSeqEdit_Cmd_ReplaceAnnot_Base --
78 ///
79 
81 {
83 public:
84  // constructor
86  // destructor
87  virtual ~CSeqEdit_Cmd_ReplaceAnnot_Base(void);
88 
89  // type info
91 
92  /////////////////////////////////////////////////////////////////////////////
93  ///
94  /// C_Data --
95  ///
96 
98  {
100  public:
101  // constructor
102  C_Data(void);
103  // destructor
104  ~C_Data(void);
105 
106  // type info
108 
109  /////////////////////////////////////////////////////////////////////////////
110  ///
111  /// C_Feat --
112  ///
113 
115  {
117  public:
118  // constructor
119  C_Feat(void);
120  // destructor
121  ~C_Feat(void);
122 
123  // type info
125 
126  // types
129 
130  // member index
131  enum class E_memberIndex {
132  e__allMandatory = 0,
133  e_ovalue,
134  e_nvalue
135  };
137 
138  // getters
139  // setters
140 
141  /// old value
142  /// Check if a value has been assigned to Ovalue data member.
143  ///
144  /// Data member Ovalue is mandatory;
145  /// its type is defined as 'typedef CSeq_feat TOvalue'
146  /// @return
147  /// - true, if a value has been assigned.
148  /// - false, otherwise.
149  bool IsSetOvalue(void) const;
150 
151  /// Check if it is safe to call GetOvalue method.
152  ///
153  /// @return
154  /// - true, if the data member is getatable.
155  /// - false, otherwise.
156  bool CanGetOvalue(void) const;
157 
158  /// Reset Ovalue data member.
159  void ResetOvalue(void);
160 
161  /// Get the Ovalue member data.
162  ///
163  /// @return
164  /// Reference to the member data.
165  const TOvalue& GetOvalue(void) const;
166 
167  /// Assign a value to Ovalue data member.
168  ///
169  /// @param value
170  /// Reference to value.
171  void SetOvalue(TOvalue& value);
172 
173  /// Assign a value to Ovalue data member.
174  ///
175  /// @return
176  /// Reference to the data value.
177  TOvalue& SetOvalue(void);
178 
179  /// new value
180  /// Check if a value has been assigned to Nvalue data member.
181  ///
182  /// Data member Nvalue is mandatory;
183  /// its type is defined as 'typedef CSeq_feat TNvalue'
184  /// @return
185  /// - true, if a value has been assigned.
186  /// - false, otherwise.
187  bool IsSetNvalue(void) const;
188 
189  /// Check if it is safe to call GetNvalue method.
190  ///
191  /// @return
192  /// - true, if the data member is getatable.
193  /// - false, otherwise.
194  bool CanGetNvalue(void) const;
195 
196  /// Reset Nvalue data member.
197  void ResetNvalue(void);
198 
199  /// Get the Nvalue member data.
200  ///
201  /// @return
202  /// Reference to the member data.
203  const TNvalue& GetNvalue(void) const;
204 
205  /// Assign a value to Nvalue data member.
206  ///
207  /// @param value
208  /// Reference to value.
209  void SetNvalue(TNvalue& value);
210 
211  /// Assign a value to Nvalue data member.
212  ///
213  /// @return
214  /// Reference to the data value.
215  TNvalue& SetNvalue(void);
216 
217  /// Reset the whole object
218  void Reset(void);
219 
220 
221  private:
222  // Prohibit copy constructor and assignment operator
223  C_Feat(const C_Feat&);
225 
226  // data
227  Uint4 m_set_State[1];
230  };
231  /////////////////////////////////////////////////////////////////////////////
232  ///
233  /// C_Align --
234  ///
235 
237  {
239  public:
240  // constructor
241  C_Align(void);
242  // destructor
243  ~C_Align(void);
244 
245  // type info
247 
248  // types
251 
252  // member index
253  enum class E_memberIndex {
254  e__allMandatory = 0,
255  e_ovalue,
256  e_nvalue
257  };
259 
260  // getters
261  // setters
262 
263  /// old value
264  /// Check if a value has been assigned to Ovalue data member.
265  ///
266  /// Data member Ovalue is mandatory;
267  /// its type is defined as 'typedef CSeq_align TOvalue'
268  /// @return
269  /// - true, if a value has been assigned.
270  /// - false, otherwise.
271  bool IsSetOvalue(void) const;
272 
273  /// Check if it is safe to call GetOvalue method.
274  ///
275  /// @return
276  /// - true, if the data member is getatable.
277  /// - false, otherwise.
278  bool CanGetOvalue(void) const;
279 
280  /// Reset Ovalue data member.
281  void ResetOvalue(void);
282 
283  /// Get the Ovalue member data.
284  ///
285  /// @return
286  /// Reference to the member data.
287  const TOvalue& GetOvalue(void) const;
288 
289  /// Assign a value to Ovalue data member.
290  ///
291  /// @param value
292  /// Reference to value.
293  void SetOvalue(TOvalue& value);
294 
295  /// Assign a value to Ovalue data member.
296  ///
297  /// @return
298  /// Reference to the data value.
299  TOvalue& SetOvalue(void);
300 
301  /// new value
302  /// Check if a value has been assigned to Nvalue data member.
303  ///
304  /// Data member Nvalue is mandatory;
305  /// its type is defined as 'typedef CSeq_align TNvalue'
306  /// @return
307  /// - true, if a value has been assigned.
308  /// - false, otherwise.
309  bool IsSetNvalue(void) const;
310 
311  /// Check if it is safe to call GetNvalue method.
312  ///
313  /// @return
314  /// - true, if the data member is getatable.
315  /// - false, otherwise.
316  bool CanGetNvalue(void) const;
317 
318  /// Reset Nvalue data member.
319  void ResetNvalue(void);
320 
321  /// Get the Nvalue member data.
322  ///
323  /// @return
324  /// Reference to the member data.
325  const TNvalue& GetNvalue(void) const;
326 
327  /// Assign a value to Nvalue data member.
328  ///
329  /// @param value
330  /// Reference to value.
331  void SetNvalue(TNvalue& value);
332 
333  /// Assign a value to Nvalue data member.
334  ///
335  /// @return
336  /// Reference to the data value.
337  TNvalue& SetNvalue(void);
338 
339  /// Reset the whole object
340  void Reset(void);
341 
342 
343  private:
344  // Prohibit copy constructor and assignment operator
345  C_Align(const C_Align&);
347 
348  // data
349  Uint4 m_set_State[1];
352  };
353  /////////////////////////////////////////////////////////////////////////////
354  ///
355  /// C_Graph --
356  ///
357 
359  {
361  public:
362  // constructor
363  C_Graph(void);
364  // destructor
365  ~C_Graph(void);
366 
367  // type info
369 
370  // types
373 
374  // member index
375  enum class E_memberIndex {
376  e__allMandatory = 0,
377  e_ovalue,
378  e_nvalue
379  };
381 
382  // getters
383  // setters
384 
385  /// old value
386  /// Check if a value has been assigned to Ovalue data member.
387  ///
388  /// Data member Ovalue is mandatory;
389  /// its type is defined as 'typedef CSeq_graph TOvalue'
390  /// @return
391  /// - true, if a value has been assigned.
392  /// - false, otherwise.
393  bool IsSetOvalue(void) const;
394 
395  /// Check if it is safe to call GetOvalue method.
396  ///
397  /// @return
398  /// - true, if the data member is getatable.
399  /// - false, otherwise.
400  bool CanGetOvalue(void) const;
401 
402  /// Reset Ovalue data member.
403  void ResetOvalue(void);
404 
405  /// Get the Ovalue member data.
406  ///
407  /// @return
408  /// Reference to the member data.
409  const TOvalue& GetOvalue(void) const;
410 
411  /// Assign a value to Ovalue data member.
412  ///
413  /// @param value
414  /// Reference to value.
415  void SetOvalue(TOvalue& value);
416 
417  /// Assign a value to Ovalue data member.
418  ///
419  /// @return
420  /// Reference to the data value.
421  TOvalue& SetOvalue(void);
422 
423  /// new value
424  /// Check if a value has been assigned to Nvalue data member.
425  ///
426  /// Data member Nvalue is mandatory;
427  /// its type is defined as 'typedef CSeq_graph TNvalue'
428  /// @return
429  /// - true, if a value has been assigned.
430  /// - false, otherwise.
431  bool IsSetNvalue(void) const;
432 
433  /// Check if it is safe to call GetNvalue method.
434  ///
435  /// @return
436  /// - true, if the data member is getatable.
437  /// - false, otherwise.
438  bool CanGetNvalue(void) const;
439 
440  /// Reset Nvalue data member.
441  void ResetNvalue(void);
442 
443  /// Get the Nvalue member data.
444  ///
445  /// @return
446  /// Reference to the member data.
447  const TNvalue& GetNvalue(void) const;
448 
449  /// Assign a value to Nvalue data member.
450  ///
451  /// @param value
452  /// Reference to value.
453  void SetNvalue(TNvalue& value);
454 
455  /// Assign a value to Nvalue data member.
456  ///
457  /// @return
458  /// Reference to the data value.
459  TNvalue& SetNvalue(void);
460 
461  /// Reset the whole object
462  void Reset(void);
463 
464 
465  private:
466  // Prohibit copy constructor and assignment operator
467  C_Graph(const C_Graph&);
469 
470  // data
471  Uint4 m_set_State[1];
474  };
475 
476  /// Choice variants.
477  enum E_Choice {
478  e_not_set = 0, ///< No variant selected
481  e_Graph
482  };
483  /// Maximum+1 value of the choice variant enumerator.
485  e_MaxChoice = 4 ///< == e_Graph+1
486  };
487 
488  /// Reset the whole object
489  void Reset(void);
490 
491  /// Reset the selection (set it to e_not_set).
492  void ResetSelection(void);
493 
494  /// Which variant is currently selected.
495  ///
496  /// @return
497  /// Choice state enumerator.
498  E_Choice Which(void) const;
499 
500  /// Verify selection, throw exception if it differs from the expected.
501  ///
502  /// @param index
503  /// Expected selection.
504  void CheckSelected(E_Choice index) const;
505 
506  /// Throw 'InvalidSelection' exception.
507  ///
508  /// @param index
509  /// Expected selection.
510  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
511 
512  /// Retrieve selection name (for diagnostic purposes).
513  ///
514  /// @param index
515  /// One of possible selection states.
516  /// @return
517  /// Name string.
518  static string SelectionName(E_Choice index);
519 
520  /// Select the requested variant if needed.
521  ///
522  /// @param index
523  /// New selection state.
524  /// @param reset
525  /// Flag that defines the resetting of the variant data. The data will
526  /// be reset if either the current selection differs from the new one,
527  /// or the flag is set to eDoResetVariant.
529  /// Select the requested variant if needed,
530  /// allocating CObject variants from memory pool.
531  void Select(E_Choice index,
532  EResetVariant reset,
533  CObjectMemoryPool* pool);
534 
535  // types
536  typedef C_Feat TFeat;
537  typedef C_Align TAlign;
538  typedef C_Graph TGraph;
539 
540  // getters
541  // setters
542 
543 
544  /// Check if variant Feat is selected.
545  ///
546  /// Feat type is defined as 'typedef C_Feat TFeat'.
547  /// @return
548  /// - true, if the variant is selected.
549  /// - false, otherwise.
550  bool IsFeat(void) const;
551 
552  /// Get the variant data.
553  ///
554  /// @return
555  /// Reference to the data.
556  const TFeat& GetFeat(void) const;
557 
558  /// Select the variant.
559  ///
560  /// @return
561  /// Reference to the variant data.
562  TFeat& SetFeat(void);
563  /// Select the variant and set its data.
564  ///
565  /// @param value
566  /// Reference to the data.
567  void SetFeat(TFeat& value);
568 
569 
570  /// Check if variant Align is selected.
571  ///
572  /// Align type is defined as 'typedef C_Align TAlign'.
573  /// @return
574  /// - true, if the variant is selected.
575  /// - false, otherwise.
576  bool IsAlign(void) const;
577 
578  /// Get the variant data.
579  ///
580  /// @return
581  /// Reference to the data.
582  const TAlign& GetAlign(void) const;
583 
584  /// Select the variant.
585  ///
586  /// @return
587  /// Reference to the variant data.
588  TAlign& SetAlign(void);
589  /// Select the variant and set its data.
590  ///
591  /// @param value
592  /// Reference to the data.
593  void SetAlign(TAlign& value);
594 
595 
596  /// Check if variant Graph is selected.
597  ///
598  /// Graph type is defined as 'typedef C_Graph TGraph'.
599  /// @return
600  /// - true, if the variant is selected.
601  /// - false, otherwise.
602  bool IsGraph(void) const;
603 
604  /// Get the variant data.
605  ///
606  /// @return
607  /// Reference to the data.
608  const TGraph& GetGraph(void) const;
609 
610  /// Select the variant.
611  ///
612  /// @return
613  /// Reference to the variant data.
614  TGraph& SetGraph(void);
615  /// Select the variant and set its data.
616  ///
617  /// @param value
618  /// Reference to the data.
619  void SetGraph(TGraph& value);
620 
621 
622  private:
623  // copy constructor and assignment operator
624  C_Data(const C_Data& );
626  // choice state
628  // helper methods
629  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
630 
631  static const char* const sm_SelectionNames[];
632  // data
633  NCBI_NS_NCBI::CSerialObject *m_object;
634  };
635  // types
636  typedef CSeqEdit_Id TId;
637  typedef string TName;
638  typedef bool TNamed;
639  typedef C_Data TData;
640 
641  // member index
642  enum class E_memberIndex {
643  e__allMandatory = 0,
644  e_id,
645  e_name,
646  e_named,
647  e_data
648  };
650 
651  // getters
652  // setters
653 
654  /// Bioseq or Bioseq_set id
655  /// Check if a value has been assigned to Id data member.
656  ///
657  /// Data member Id is mandatory;
658  /// its type is defined as 'typedef CSeqEdit_Id TId'
659  /// @return
660  /// - true, if a value has been assigned.
661  /// - false, otherwise.
662  bool IsSetId(void) const;
663 
664  /// Check if it is safe to call GetId method.
665  ///
666  /// @return
667  /// - true, if the data member is getatable.
668  /// - false, otherwise.
669  bool CanGetId(void) const;
670 
671  /// Reset Id data member.
672  void ResetId(void);
673 
674  /// Get the Id member data.
675  ///
676  /// @return
677  /// Reference to the member data.
678  const TId& GetId(void) const;
679 
680  /// Assign a value to Id data member.
681  ///
682  /// @param value
683  /// Reference to value.
684  void SetId(TId& value);
685 
686  /// Assign a value to Id data member.
687  ///
688  /// @return
689  /// Reference to the data value.
690  TId& SetId(void);
691 
692  /// Annotation's name
693  /// Check if a value has been assigned to Name data member.
694  ///
695  /// Data member Name is optional;
696  /// its type is defined as 'typedef string TName'
697  /// @return
698  /// - true, if a value has been assigned.
699  /// - false, otherwise.
700  bool IsSetName(void) const;
701 
702  /// Check if it is safe to call GetName method.
703  ///
704  /// @return
705  /// - true, if the data member is getatable.
706  /// - false, otherwise.
707  bool CanGetName(void) const;
708 
709  /// Reset Name data member.
710  void ResetName(void);
711 
712  /// Get the Name member data.
713  ///
714  /// @return
715  /// Reference to the member data.
716  const TName& GetName(void) const;
717 
718  /// Assign a value to Name data member.
719  ///
720  /// @param value
721  /// Value to assign
722  void SetName(const TName& value);
723  void SetName(TName&& value);
724 
725  /// Assign a value to Name data member.
726  ///
727  /// @return
728  /// Reference to the data value.
729  TName& SetName(void);
730 
731  /// TRUE if an annotation is named
732  /// Check if a value has been assigned to Named data member.
733  ///
734  /// Data member Named is mandatory;
735  /// its type is defined as 'typedef bool TNamed'
736  /// @return
737  /// - true, if a value has been assigned.
738  /// - false, otherwise.
739  bool IsSetNamed(void) const;
740 
741  /// Check if it is safe to call GetNamed method.
742  ///
743  /// @return
744  /// - true, if the data member is getatable.
745  /// - false, otherwise.
746  bool CanGetNamed(void) const;
747 
748  /// Reset Named data member.
749  void ResetNamed(void);
750 
751  /// Get the Named member data.
752  ///
753  /// @return
754  /// Copy of the member data.
755  TNamed GetNamed(void) const;
756 
757  /// Assign a value to Named data member.
758  ///
759  /// @param value
760  /// Value to assign
761  void SetNamed(TNamed value);
762 
763  /// Assign a value to Named data member.
764  ///
765  /// @return
766  /// Reference to the data value.
767  TNamed& SetNamed(void);
768 
769  /// Check if a value has been assigned to Data data member.
770  ///
771  /// Data member Data is mandatory;
772  /// its type is defined as 'typedef C_Data TData'
773  /// @return
774  /// - true, if a value has been assigned.
775  /// - false, otherwise.
776  bool IsSetData(void) const;
777 
778  /// Check if it is safe to call GetData method.
779  ///
780  /// @return
781  /// - true, if the data member is getatable.
782  /// - false, otherwise.
783  bool CanGetData(void) const;
784 
785  /// Reset Data data member.
786  void ResetData(void);
787 
788  /// Get the Data member data.
789  ///
790  /// @return
791  /// Reference to the member data.
792  const TData& GetData(void) const;
793 
794  /// Assign a value to Data data member.
795  ///
796  /// @param value
797  /// Reference to value.
798  void SetData(TData& value);
799 
800  /// Assign a value to Data data member.
801  ///
802  /// @return
803  /// Reference to the data value.
804  TData& SetData(void);
805 
806  /// Reset the whole object
807  virtual void Reset(void);
808 
809 
810 private:
811  // Prohibit copy constructor and assignment operator
814 
815  // data
816  Uint4 m_set_State[1];
818  string m_Name;
819  bool m_Named;
821 };
822 
823 /* @} */
824 
825 
826 
827 
828 
829 ///////////////////////////////////////////////////////////
830 ///////////////////// inline methods //////////////////////
831 ///////////////////////////////////////////////////////////
832 inline
834 {
835  return m_Ovalue.NotEmpty();
836 }
837 
838 inline
840 {
841  return true;
842 }
843 
844 inline
846 {
847  if ( !m_Ovalue ) {
848  const_cast<C_Feat*>(this)->ResetOvalue();
849  }
850  return (*m_Ovalue);
851 }
852 
853 inline
855 {
856  if ( !m_Ovalue ) {
857  ResetOvalue();
858  }
859  return (*m_Ovalue);
860 }
861 
862 inline
864 {
865  return m_Nvalue.NotEmpty();
866 }
867 
868 inline
870 {
871  return true;
872 }
873 
874 inline
876 {
877  if ( !m_Nvalue ) {
878  const_cast<C_Feat*>(this)->ResetNvalue();
879  }
880  return (*m_Nvalue);
881 }
882 
883 inline
885 {
886  if ( !m_Nvalue ) {
887  ResetNvalue();
888  }
889  return (*m_Nvalue);
890 }
891 
892 inline
894 {
895  return m_Ovalue.NotEmpty();
896 }
897 
898 inline
900 {
901  return true;
902 }
903 
904 inline
906 {
907  if ( !m_Ovalue ) {
908  const_cast<C_Align*>(this)->ResetOvalue();
909  }
910  return (*m_Ovalue);
911 }
912 
913 inline
915 {
916  if ( !m_Ovalue ) {
917  ResetOvalue();
918  }
919  return (*m_Ovalue);
920 }
921 
922 inline
924 {
925  return m_Nvalue.NotEmpty();
926 }
927 
928 inline
930 {
931  return true;
932 }
933 
934 inline
936 {
937  if ( !m_Nvalue ) {
938  const_cast<C_Align*>(this)->ResetNvalue();
939  }
940  return (*m_Nvalue);
941 }
942 
943 inline
945 {
946  if ( !m_Nvalue ) {
947  ResetNvalue();
948  }
949  return (*m_Nvalue);
950 }
951 
952 inline
954 {
955  return m_Ovalue.NotEmpty();
956 }
957 
958 inline
960 {
961  return true;
962 }
963 
964 inline
966 {
967  if ( !m_Ovalue ) {
968  const_cast<C_Graph*>(this)->ResetOvalue();
969  }
970  return (*m_Ovalue);
971 }
972 
973 inline
975 {
976  if ( !m_Ovalue ) {
977  ResetOvalue();
978  }
979  return (*m_Ovalue);
980 }
981 
982 inline
984 {
985  return m_Nvalue.NotEmpty();
986 }
987 
988 inline
990 {
991  return true;
992 }
993 
994 inline
996 {
997  if ( !m_Nvalue ) {
998  const_cast<C_Graph*>(this)->ResetNvalue();
999  }
1000  return (*m_Nvalue);
1001 }
1002 
1003 inline
1005 {
1006  if ( !m_Nvalue ) {
1007  ResetNvalue();
1008  }
1009  return (*m_Nvalue);
1010 }
1011 
1012 inline
1014 {
1015  return m_choice;
1016 }
1017 
1018 inline
1020 {
1021  if ( m_choice != index )
1022  ThrowInvalidSelection(index);
1023 }
1024 
1025 inline
1026 void CSeqEdit_Cmd_ReplaceAnnot_Base::C_Data::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
1027 {
1028  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
1029  if ( m_choice != e_not_set )
1030  ResetSelection();
1031  DoSelect(index, pool);
1032  }
1033 }
1034 
1035 inline
1037 {
1038  Select(index, reset, 0);
1039 }
1040 
1041 inline
1043 {
1044  return m_choice == e_Feat;
1045 }
1046 
1047 inline
1049 {
1050  return m_choice == e_Align;
1051 }
1052 
1053 inline
1055 {
1056  return m_choice == e_Graph;
1057 }
1058 
1059 inline
1061 {
1062  return m_Id.NotEmpty();
1063 }
1064 
1065 inline
1067 {
1068  return true;
1069 }
1070 
1071 inline
1073 {
1074  if ( !m_Id ) {
1075  const_cast<CSeqEdit_Cmd_ReplaceAnnot_Base*>(this)->ResetId();
1076  }
1077  return (*m_Id);
1078 }
1079 
1080 inline
1082 {
1083  if ( !m_Id ) {
1084  ResetId();
1085  }
1086  return (*m_Id);
1087 }
1088 
1089 inline
1091 {
1092  return ((m_set_State[0] & 0xc) != 0);
1093 }
1094 
1095 inline
1097 {
1098  return IsSetName();
1099 }
1100 
1101 inline
1103 {
1104  if (!CanGetName()) {
1105  ThrowUnassigned(1);
1106  }
1107  return m_Name;
1108 }
1109 
1110 inline
1112 {
1113  m_Name = value;
1114  m_set_State[0] |= 0xc;
1115 }
1116 
1117 inline
1119 {
1120  m_Name = std::forward<CSeqEdit_Cmd_ReplaceAnnot_Base::TName>(value);
1121  m_set_State[0] |= 0xc;
1122 }
1123 
1124 inline
1126 {
1127 #ifdef _DEBUG
1128  if (!IsSetName()) {
1130  }
1131 #endif
1132  m_set_State[0] |= 0x4;
1133  return m_Name;
1134 }
1135 
1136 inline
1138 {
1139  return ((m_set_State[0] & 0x30) != 0);
1140 }
1141 
1142 inline
1144 {
1145  return IsSetNamed();
1146 }
1147 
1148 inline
1150 {
1151  m_Named = 0;
1152  m_set_State[0] &= ~0x30;
1153 }
1154 
1155 inline
1157 {
1158  if (!CanGetNamed()) {
1159  ThrowUnassigned(2);
1160  }
1161  return m_Named;
1162 }
1163 
1164 inline
1166 {
1167  m_Named = value;
1168  m_set_State[0] |= 0x30;
1169 }
1170 
1171 inline
1173 {
1174 #ifdef _DEBUG
1175  if (!IsSetNamed()) {
1176  memset(&m_Named,UnassignedByte(),sizeof(m_Named));
1177  }
1178 #endif
1179  m_set_State[0] |= 0x10;
1180  return m_Named;
1181 }
1182 
1183 inline
1185 {
1186  return m_Data.NotEmpty();
1187 }
1188 
1189 inline
1191 {
1192  return true;
1193 }
1194 
1195 inline
1197 {
1198  if ( !m_Data ) {
1199  const_cast<CSeqEdit_Cmd_ReplaceAnnot_Base*>(this)->ResetData();
1200  }
1201  return (*m_Data);
1202 }
1203 
1204 inline
1206 {
1207  if ( !m_Data ) {
1208  ResetData();
1209  }
1210  return (*m_Data);
1211 }
1212 
1213 ///////////////////////////////////////////////////////////
1214 ////////////////// end of inline methods //////////////////
1215 ///////////////////////////////////////////////////////////
1216 
1217 
1218 
1219 
1220 
1221 END_objects_SCOPE // namespace ncbi::objects::
1222 
1224 
1225 
1226 #endif // OBJECTS_SEQEDIT_SEQEDIT_CMD_REPLACEANNOT_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Replace an annotation object of a bioseq or a bioseq-set.
CSeqEdit_Id –.
Definition: SeqEdit_Id.hpp:66
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Base class for all serializable objects.
Definition: serialbase.hpp:150
char value[7]
Definition: config.c:431
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
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,...
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
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_SEQEDIT_EXPORT
Definition: ncbi_export.h:801
bool CanGetNvalue(void) const
Check if it is safe to call GetNvalue method.
bool CanGetOvalue(void) const
Check if it is safe to call GetOvalue method.
const TNvalue & GetNvalue(void) const
Get the Nvalue member data.
void ResetNamed(void)
Reset Named data member.
bool CanGetNvalue(void) const
Check if it is safe to call GetNvalue method.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
CSeqEdit_Cmd_ReplaceAnnot_Base & operator=(const CSeqEdit_Cmd_ReplaceAnnot_Base &)
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
const TOvalue & GetOvalue(void) const
Get the Ovalue member data.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
void ResetId(void)
Reset Id data member.
TOvalue & SetOvalue(void)
Assign a value to Ovalue data member.
bool IsAlign(void) const
Check if variant Align is selected.
void ResetData(void)
Reset Data data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
const TId & GetId(void) const
Get the Id member data.
E_Choice Which(void) const
Which variant is currently selected.
TNvalue & SetNvalue(void)
Assign a value to Nvalue data member.
bool CanGetId(void) const
Check if it is safe to call GetId method.
bool CanGetNvalue(void) const
Check if it is safe to call GetNvalue method.
const TOvalue & GetOvalue(void) const
Get the Ovalue member data.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
TNamed GetNamed(void) const
Get the Named member data.
bool IsSetName(void) const
Annotation's name Check if a value has been assigned to Name data member.
bool IsSetNvalue(void) const
new value Check if a value has been assigned to Nvalue data member.
TNamed & SetNamed(void)
Assign a value to Named data member.
const TNvalue & GetNvalue(void) const
Get the Nvalue member data.
bool IsGraph(void) const
Check if variant Graph is selected.
CSeqEdit_Cmd_ReplaceAnnot_Base(const CSeqEdit_Cmd_ReplaceAnnot_Base &)
bool IsSetId(void) const
Bioseq or Bioseq_set id Check if a value has been assigned to Id data member.
C_Data & operator=(const C_Data &)
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsSetOvalue(void) const
old value Check if a value has been assigned to Ovalue data member.
TNvalue & SetNvalue(void)
Assign a value to Nvalue data member.
bool CanGetData(void) const
Check if it is safe to call GetData method.
bool CanGetName(void) const
Check if it is safe to call GetName method.
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
bool IsFeat(void) const
Check if variant Feat is selected.
bool CanGetOvalue(void) const
Check if it is safe to call GetOvalue method.
TName & SetName(void)
Assign a value to Name data member.
const TNvalue & GetNvalue(void) const
Get the Nvalue member data.
bool IsSetOvalue(void) const
old value Check if a value has been assigned to Ovalue data member.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
TOvalue & SetOvalue(void)
Assign a value to Ovalue data member.
Tparent::CMemberIndex< E_memberIndex, 5 > TmemberIndex
const TOvalue & GetOvalue(void) const
Get the Ovalue member data.
bool IsSetOvalue(void) const
old value Check if a value has been assigned to Ovalue data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
TId & SetId(void)
Assign a value to Id data member.
bool IsSetNamed(void) const
TRUE if an annotation is named Check if a value has been assigned to Named data member.
const TData & GetData(void) const
Get the Data member data.
TData & SetData(void)
Assign a value to Data data member.
bool CanGetNamed(void) const
Check if it is safe to call GetNamed method.
const TName & GetName(void) const
Get the Name member data.
TOvalue & SetOvalue(void)
Assign a value to Ovalue data member.
void ResetSelection(void)
Reset the selection (set it to e_not_set).
bool CanGetOvalue(void) const
Check if it is safe to call GetOvalue method.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
bool IsSetNvalue(void) const
new value Check if a value has been assigned to Nvalue data member.
TNvalue & SetNvalue(void)
Assign a value to Nvalue data member.
bool IsSetNvalue(void) const
new value Check if a value has been assigned to Nvalue data member.
@ e_not_set
Modified on Sat Dec 02 09:20:55 2023 by modify_doxy.py rev. 669887