NCBI C++ ToolKit
OrgName_.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 OrgName_.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/seqfeat/seqfeat.asn">seqfeat.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/seqfeat/seqfeat.def">seqfeat.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_SEQFEAT_ORGNAME_BASE_HPP
42 #define OBJECTS_SEQFEAT_ORGNAME_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <list>
49 #include <string>
50 
52 
53 #ifndef BEGIN_objects_SCOPE
54 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
55 # define END_objects_SCOPE END_SCOPE(objects)
56 #endif
57 BEGIN_objects_SCOPE // namespace ncbi::objects::
58 
59 
60 // forward declarations
61 class CBinomialOrgName;
62 class CMultiOrgName;
63 class COrgMod;
64 class CPartialOrgName;
65 
66 
67 // generated classes
68 
69 
70 /** @addtogroup dataspec_NCBI_Organism
71  *
72  * @{
73  */
74 
75 /////////////////////////////////////////////////////////////////////////////
76 ///
77 /// COrgName_Base --
78 ///
79 
81 {
83 public:
84  // constructor
85  COrgName_Base(void);
86  // destructor
87  virtual ~COrgName_Base(void);
88 
89  // type info
91 
92  /////////////////////////////////////////////////////////////////////////////
93  ///
94  /// C_Name --
95  ///
96 
98  {
100  public:
101  // constructor
102  C_Name(void);
103  // destructor
104  ~C_Name(void);
105 
106  // type info
108 
109 
110  /// Choice variants.
111  enum E_Choice {
112  e_not_set = 0, ///< No variant selected
113  e_Binomial, ///< genus/species type name
114  e_Virus, ///< virus names are different
115  e_Hybrid, ///< hybrid between organisms
116  e_Namedhybrid, ///< some hybrids have genus x species name
117  e_Partial ///< when genus not known
118  };
119  /// Maximum+1 value of the choice variant enumerator.
121  e_MaxChoice = 6 ///< == e_Partial+1
122  };
123 
124  /// Reset the whole object
125  void Reset(void);
126 
127  /// Reset the selection (set it to e_not_set).
128  void ResetSelection(void);
129 
130  /// Which variant is currently selected.
131  ///
132  /// @return
133  /// Choice state enumerator.
134  E_Choice Which(void) const;
135 
136  /// Verify selection, throw exception if it differs from the expected.
137  ///
138  /// @param index
139  /// Expected selection.
140  void CheckSelected(E_Choice index) const;
141 
142  /// Throw 'InvalidSelection' exception.
143  ///
144  /// @param index
145  /// Expected selection.
146  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
147 
148  /// Retrieve selection name (for diagnostic purposes).
149  ///
150  /// @param index
151  /// One of possible selection states.
152  /// @return
153  /// Name string.
154  static string SelectionName(E_Choice index);
155 
156  /// Select the requested variant if needed.
157  ///
158  /// @param index
159  /// New selection state.
160  /// @param reset
161  /// Flag that defines the resetting of the variant data. The data will
162  /// be reset if either the current selection differs from the new one,
163  /// or the flag is set to eDoResetVariant.
165  /// Select the requested variant if needed,
166  /// allocating CObject variants from memory pool.
167  void Select(E_Choice index,
168  EResetVariant reset,
169  CObjectMemoryPool* pool);
170 
171  // types
173  typedef string TVirus;
177 
178  // getters
179  // setters
180 
181 
182  /// Check if variant Binomial is selected.
183  ///
184  /// Binomial type is defined as 'typedef CBinomialOrgName TBinomial'.
185  /// @return
186  /// - true, if the variant is selected.
187  /// - false, otherwise.
188  bool IsBinomial(void) const;
189 
190  /// Get the variant data.
191  ///
192  /// @return
193  /// Reference to the data.
194  const TBinomial& GetBinomial(void) const;
195 
196  /// Select the variant.
197  ///
198  /// @return
199  /// Reference to the variant data.
200  TBinomial& SetBinomial(void);
201  /// Select the variant and set its data.
202  ///
203  /// @param value
204  /// Reference to the data.
205  void SetBinomial(TBinomial& value);
206 
207 
208  /// Check if variant Virus is selected.
209  ///
210  /// Virus type is defined as 'typedef string TVirus'.
211  /// @return
212  /// - true, if the variant is selected.
213  /// - false, otherwise.
214  bool IsVirus(void) const;
215 
216  /// Get the variant data.
217  ///
218  /// @return
219  /// Reference to the data.
220  const TVirus& GetVirus(void) const;
221 
222  /// Select the variant.
223  ///
224  /// @return
225  /// Reference to the variant data.
226  TVirus& SetVirus(void);
227 
228  /// Select the variant and set its data.
229  ///
230  /// @param value
231  /// Variant data.
232  void SetVirus(const TVirus& value);
233 
234 
235  /// Check if variant Hybrid is selected.
236  ///
237  /// Hybrid type is defined as 'typedef CMultiOrgName THybrid'.
238  /// @return
239  /// - true, if the variant is selected.
240  /// - false, otherwise.
241  bool IsHybrid(void) const;
242 
243  /// Get the variant data.
244  ///
245  /// @return
246  /// Reference to the data.
247  const THybrid& GetHybrid(void) const;
248 
249  /// Select the variant.
250  ///
251  /// @return
252  /// Reference to the variant data.
253  THybrid& SetHybrid(void);
254  /// Select the variant and set its data.
255  ///
256  /// @param value
257  /// Reference to the data.
258  void SetHybrid(THybrid& value);
259 
260 
261  /// Check if variant Namedhybrid is selected.
262  ///
263  /// Namedhybrid type is defined as 'typedef CBinomialOrgName TNamedhybrid'.
264  /// @return
265  /// - true, if the variant is selected.
266  /// - false, otherwise.
267  bool IsNamedhybrid(void) const;
268 
269  /// Get the variant data.
270  ///
271  /// @return
272  /// Reference to the data.
273  const TNamedhybrid& GetNamedhybrid(void) const;
274 
275  /// Select the variant.
276  ///
277  /// @return
278  /// Reference to the variant data.
279  TNamedhybrid& SetNamedhybrid(void);
280  /// Select the variant and set its data.
281  ///
282  /// @param value
283  /// Reference to the data.
284  void SetNamedhybrid(TNamedhybrid& value);
285 
286 
287  /// Check if variant Partial is selected.
288  ///
289  /// Partial type is defined as 'typedef CPartialOrgName TPartial'.
290  /// @return
291  /// - true, if the variant is selected.
292  /// - false, otherwise.
293  bool IsPartial(void) const;
294 
295  /// Get the variant data.
296  ///
297  /// @return
298  /// Reference to the data.
299  const TPartial& GetPartial(void) const;
300 
301  /// Select the variant.
302  ///
303  /// @return
304  /// Reference to the variant data.
305  TPartial& SetPartial(void);
306  /// Select the variant and set its data.
307  ///
308  /// @param value
309  /// Reference to the data.
310  void SetPartial(TPartial& value);
311 
312 
313  private:
314  // copy constructor and assignment operator
315  C_Name(const C_Name& );
317  // choice state
319  // helper methods
320  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
321 
322  static const char* const sm_SelectionNames[];
323  // data
324  union {
325  NCBI_NS_NCBI::CUnionBuffer<NCBI_NS_STD::string> m_string;
326  NCBI_NS_NCBI::CSerialObject *m_object;
327  };
328  };
329  // types
330  typedef C_Name TName;
331  typedef string TAttrib;
332  typedef list< CRef< COrgMod > > TMod;
333  typedef string TLineage;
334  typedef int TGcode;
335  typedef int TMgcode;
336  typedef string TDiv;
337  typedef int TPgcode;
338 
339  // member index
340  enum class E_memberIndex {
341  e__allMandatory = 0,
342  e_name,
343  e_attrib,
344  e_mod,
345  e_lineage,
346  e_gcode,
347  e_mgcode,
348  e_div,
349  e_pgcode
350  };
352 
353  // getters
354  // setters
355 
356  /// Check if a value has been assigned to Name data member.
357  ///
358  /// Data member Name is optional;
359  /// its type is defined as 'typedef C_Name TName'
360  /// @return
361  /// - true, if a value has been assigned.
362  /// - false, otherwise.
363  bool IsSetName(void) const;
364 
365  /// Check if it is safe to call GetName method.
366  ///
367  /// @return
368  /// - true, if the data member is getatable.
369  /// - false, otherwise.
370  bool CanGetName(void) const;
371 
372  /// Reset Name data member.
373  void ResetName(void);
374 
375  /// Get the Name member data.
376  ///
377  /// @return
378  /// Reference to the member data.
379  const TName& GetName(void) const;
380 
381  /// Assign a value to Name data member.
382  ///
383  /// @param value
384  /// Reference to value.
385  void SetName(TName& value);
386 
387  /// Assign a value to Name data member.
388  ///
389  /// @return
390  /// Reference to the data value.
391  TName& SetName(void);
392 
393  /// attribution of name
394  /// Check if a value has been assigned to Attrib data member.
395  ///
396  /// Data member Attrib is optional;
397  /// its type is defined as 'typedef string TAttrib'
398  /// @return
399  /// - true, if a value has been assigned.
400  /// - false, otherwise.
401  bool IsSetAttrib(void) const;
402 
403  /// Check if it is safe to call GetAttrib method.
404  ///
405  /// @return
406  /// - true, if the data member is getatable.
407  /// - false, otherwise.
408  bool CanGetAttrib(void) const;
409 
410  /// Reset Attrib data member.
411  void ResetAttrib(void);
412 
413  /// Get the Attrib member data.
414  ///
415  /// @return
416  /// Reference to the member data.
417  const TAttrib& GetAttrib(void) const;
418 
419  /// Assign a value to Attrib data member.
420  ///
421  /// @param value
422  /// Value to assign
423  void SetAttrib(const TAttrib& value);
424  void SetAttrib(TAttrib&& value);
425 
426  /// Assign a value to Attrib data member.
427  ///
428  /// @return
429  /// Reference to the data value.
430  TAttrib& SetAttrib(void);
431 
432  /// Check if a value has been assigned to Mod data member.
433  ///
434  /// Data member Mod is optional;
435  /// its type is defined as 'typedef list< CRef< COrgMod > > TMod'
436  /// @return
437  /// - true, if a value has been assigned.
438  /// - false, otherwise.
439  bool IsSetMod(void) const;
440 
441  /// Check if it is safe to call GetMod method.
442  ///
443  /// @return
444  /// - true, if the data member is getatable.
445  /// - false, otherwise.
446  bool CanGetMod(void) const;
447 
448  /// Reset Mod data member.
449  void ResetMod(void);
450 
451  /// Get the Mod member data.
452  ///
453  /// @return
454  /// Reference to the member data.
455  const TMod& GetMod(void) const;
456 
457  /// Assign a value to Mod data member.
458  ///
459  /// @return
460  /// Reference to the data value.
461  TMod& SetMod(void);
462 
463  /// lineage with semicolon separators
464  /// Check if a value has been assigned to Lineage data member.
465  ///
466  /// Data member Lineage is optional;
467  /// its type is defined as 'typedef string TLineage'
468  /// @return
469  /// - true, if a value has been assigned.
470  /// - false, otherwise.
471  bool IsSetLineage(void) const;
472 
473  /// Check if it is safe to call GetLineage method.
474  ///
475  /// @return
476  /// - true, if the data member is getatable.
477  /// - false, otherwise.
478  bool CanGetLineage(void) const;
479 
480  /// Reset Lineage data member.
481  void ResetLineage(void);
482 
483  /// Get the Lineage member data.
484  ///
485  /// @return
486  /// Reference to the member data.
487  const TLineage& GetLineage(void) const;
488 
489  /// Assign a value to Lineage data member.
490  ///
491  /// @param value
492  /// Value to assign
493  void SetLineage(const TLineage& value);
494  void SetLineage(TLineage&& value);
495 
496  /// Assign a value to Lineage data member.
497  ///
498  /// @return
499  /// Reference to the data value.
500  TLineage& SetLineage(void);
501 
502  /// genetic code (see CdRegion)
503  /// Check if a value has been assigned to Gcode data member.
504  ///
505  /// Data member Gcode is optional;
506  /// its type is defined as 'typedef int TGcode'
507  /// @return
508  /// - true, if a value has been assigned.
509  /// - false, otherwise.
510  bool IsSetGcode(void) const;
511 
512  /// Check if it is safe to call GetGcode method.
513  ///
514  /// @return
515  /// - true, if the data member is getatable.
516  /// - false, otherwise.
517  bool CanGetGcode(void) const;
518 
519  /// Reset Gcode data member.
520  void ResetGcode(void);
521 
522  /// Get the Gcode member data.
523  ///
524  /// @return
525  /// Copy of the member data.
526  TGcode GetGcode(void) const;
527 
528  /// Assign a value to Gcode data member.
529  ///
530  /// @param value
531  /// Value to assign
532  void SetGcode(TGcode value);
533 
534  /// Assign a value to Gcode data member.
535  ///
536  /// @return
537  /// Reference to the data value.
538  TGcode& SetGcode(void);
539 
540  /// mitochondrial genetic code
541  /// Check if a value has been assigned to Mgcode data member.
542  ///
543  /// Data member Mgcode is optional;
544  /// its type is defined as 'typedef int TMgcode'
545  /// @return
546  /// - true, if a value has been assigned.
547  /// - false, otherwise.
548  bool IsSetMgcode(void) const;
549 
550  /// Check if it is safe to call GetMgcode method.
551  ///
552  /// @return
553  /// - true, if the data member is getatable.
554  /// - false, otherwise.
555  bool CanGetMgcode(void) const;
556 
557  /// Reset Mgcode data member.
558  void ResetMgcode(void);
559 
560  /// Get the Mgcode member data.
561  ///
562  /// @return
563  /// Copy of the member data.
564  TMgcode GetMgcode(void) const;
565 
566  /// Assign a value to Mgcode data member.
567  ///
568  /// @param value
569  /// Value to assign
570  void SetMgcode(TMgcode value);
571 
572  /// Assign a value to Mgcode data member.
573  ///
574  /// @return
575  /// Reference to the data value.
576  TMgcode& SetMgcode(void);
577 
578  /// GenBank division code
579  /// Check if a value has been assigned to Div data member.
580  ///
581  /// Data member Div is optional;
582  /// its type is defined as 'typedef string TDiv'
583  /// @return
584  /// - true, if a value has been assigned.
585  /// - false, otherwise.
586  bool IsSetDiv(void) const;
587 
588  /// Check if it is safe to call GetDiv method.
589  ///
590  /// @return
591  /// - true, if the data member is getatable.
592  /// - false, otherwise.
593  bool CanGetDiv(void) const;
594 
595  /// Reset Div data member.
596  void ResetDiv(void);
597 
598  /// Get the Div member data.
599  ///
600  /// @return
601  /// Reference to the member data.
602  const TDiv& GetDiv(void) const;
603 
604  /// Assign a value to Div data member.
605  ///
606  /// @param value
607  /// Value to assign
608  void SetDiv(const TDiv& value);
609  void SetDiv(TDiv&& value);
610 
611  /// Assign a value to Div data member.
612  ///
613  /// @return
614  /// Reference to the data value.
615  TDiv& SetDiv(void);
616 
617  /// plastid genetic code
618  /// Check if a value has been assigned to Pgcode data member.
619  ///
620  /// Data member Pgcode is optional;
621  /// its type is defined as 'typedef int TPgcode'
622  /// @return
623  /// - true, if a value has been assigned.
624  /// - false, otherwise.
625  bool IsSetPgcode(void) const;
626 
627  /// Check if it is safe to call GetPgcode method.
628  ///
629  /// @return
630  /// - true, if the data member is getatable.
631  /// - false, otherwise.
632  bool CanGetPgcode(void) const;
633 
634  /// Reset Pgcode data member.
635  void ResetPgcode(void);
636 
637  /// Get the Pgcode member data.
638  ///
639  /// @return
640  /// Copy of the member data.
641  TPgcode GetPgcode(void) const;
642 
643  /// Assign a value to Pgcode data member.
644  ///
645  /// @param value
646  /// Value to assign
647  void SetPgcode(TPgcode value);
648 
649  /// Assign a value to Pgcode data member.
650  ///
651  /// @return
652  /// Reference to the data value.
653  TPgcode& SetPgcode(void);
654 
655  /// Reset the whole object
656  virtual void Reset(void);
657 
658 
659 private:
660  // Prohibit copy constructor and assignment operator
663 
664  // data
665  Uint4 m_set_State[1];
667  string m_Attrib;
668  list< CRef< COrgMod > > m_Mod;
669  string m_Lineage;
670  int m_Gcode;
671  int m_Mgcode;
672  string m_Div;
673  int m_Pgcode;
674 };
675 
676 /* @} */
677 
678 
679 
680 
681 
682 ///////////////////////////////////////////////////////////
683 ///////////////////// inline methods //////////////////////
684 ///////////////////////////////////////////////////////////
685 inline
687 {
688  return m_choice;
689 }
690 
691 inline
693 {
694  if ( m_choice != index )
695  ThrowInvalidSelection(index);
696 }
697 
698 inline
699 void COrgName_Base::C_Name::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
700 {
701  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
702  if ( m_choice != e_not_set )
703  ResetSelection();
704  DoSelect(index, pool);
705  }
706 }
707 
708 inline
710 {
711  Select(index, reset, 0);
712 }
713 
714 inline
716 {
717  return m_choice == e_Binomial;
718 }
719 
720 inline
722 {
723  return m_choice == e_Virus;
724 }
725 
726 inline
728 {
729  CheckSelected(e_Virus);
730  return *m_string;
731 }
732 
733 inline
735 {
736  Select(e_Virus, NCBI_NS_NCBI::eDoNotResetVariant);
737  return *m_string;
738 }
739 
740 inline
742 {
743  return m_choice == e_Hybrid;
744 }
745 
746 inline
748 {
749  return m_choice == e_Namedhybrid;
750 }
751 
752 inline
754 {
755  return m_choice == e_Partial;
756 }
757 
758 inline
759 bool COrgName_Base::IsSetName(void) const
760 {
761  return m_Name.NotEmpty();
762 }
763 
764 inline
766 {
767  return IsSetName();
768 }
769 
770 inline
772 {
773  if (!CanGetName()) {
774  ThrowUnassigned(0);
775  }
776  return (*m_Name);
777 }
778 
779 inline
781 {
782  return ((m_set_State[0] & 0xc) != 0);
783 }
784 
785 inline
787 {
788  return IsSetAttrib();
789 }
790 
791 inline
793 {
794  if (!CanGetAttrib()) {
795  ThrowUnassigned(1);
796  }
797  return m_Attrib;
798 }
799 
800 inline
802 {
803  m_Attrib = value;
804  m_set_State[0] |= 0xc;
805 }
806 
807 inline
809 {
810  m_Attrib = std::forward<COrgName_Base::TAttrib>(value);
811  m_set_State[0] |= 0xc;
812 }
813 
814 inline
816 {
817 #ifdef _DEBUG
818  if (!IsSetAttrib()) {
820  }
821 #endif
822  m_set_State[0] |= 0x4;
823  return m_Attrib;
824 }
825 
826 inline
827 bool COrgName_Base::IsSetMod(void) const
828 {
829  return ((m_set_State[0] & 0x30) != 0);
830 }
831 
832 inline
833 bool COrgName_Base::CanGetMod(void) const
834 {
835  return true;
836 }
837 
838 inline
840 {
841  return m_Mod;
842 }
843 
844 inline
846 {
847  m_set_State[0] |= 0x10;
848  return m_Mod;
849 }
850 
851 inline
853 {
854  return ((m_set_State[0] & 0xc0) != 0);
855 }
856 
857 inline
859 {
860  return IsSetLineage();
861 }
862 
863 inline
865 {
866  if (!CanGetLineage()) {
867  ThrowUnassigned(3);
868  }
869  return m_Lineage;
870 }
871 
872 inline
874 {
875  m_Lineage = value;
876  m_set_State[0] |= 0xc0;
877 }
878 
879 inline
881 {
882  m_Lineage = std::forward<COrgName_Base::TLineage>(value);
883  m_set_State[0] |= 0xc0;
884 }
885 
886 inline
888 {
889 #ifdef _DEBUG
890  if (!IsSetLineage()) {
892  }
893 #endif
894  m_set_State[0] |= 0x40;
895  return m_Lineage;
896 }
897 
898 inline
900 {
901  return ((m_set_State[0] & 0x300) != 0);
902 }
903 
904 inline
906 {
907  return IsSetGcode();
908 }
909 
910 inline
912 {
913  m_Gcode = 0;
914  m_set_State[0] &= ~0x300;
915 }
916 
917 inline
919 {
920  if (!CanGetGcode()) {
921  ThrowUnassigned(4);
922  }
923  return m_Gcode;
924 }
925 
926 inline
928 {
929  m_Gcode = value;
930  m_set_State[0] |= 0x300;
931 }
932 
933 inline
935 {
936 #ifdef _DEBUG
937  if (!IsSetGcode()) {
938  memset(&m_Gcode,UnassignedByte(),sizeof(m_Gcode));
939  }
940 #endif
941  m_set_State[0] |= 0x100;
942  return m_Gcode;
943 }
944 
945 inline
947 {
948  return ((m_set_State[0] & 0xc00) != 0);
949 }
950 
951 inline
953 {
954  return IsSetMgcode();
955 }
956 
957 inline
959 {
960  m_Mgcode = 0;
961  m_set_State[0] &= ~0xc00;
962 }
963 
964 inline
966 {
967  if (!CanGetMgcode()) {
968  ThrowUnassigned(5);
969  }
970  return m_Mgcode;
971 }
972 
973 inline
975 {
976  m_Mgcode = value;
977  m_set_State[0] |= 0xc00;
978 }
979 
980 inline
982 {
983 #ifdef _DEBUG
984  if (!IsSetMgcode()) {
985  memset(&m_Mgcode,UnassignedByte(),sizeof(m_Mgcode));
986  }
987 #endif
988  m_set_State[0] |= 0x400;
989  return m_Mgcode;
990 }
991 
992 inline
993 bool COrgName_Base::IsSetDiv(void) const
994 {
995  return ((m_set_State[0] & 0x3000) != 0);
996 }
997 
998 inline
999 bool COrgName_Base::CanGetDiv(void) const
1000 {
1001  return IsSetDiv();
1002 }
1003 
1004 inline
1006 {
1007  if (!CanGetDiv()) {
1008  ThrowUnassigned(6);
1009  }
1010  return m_Div;
1011 }
1012 
1013 inline
1015 {
1016  m_Div = value;
1017  m_set_State[0] |= 0x3000;
1018 }
1019 
1020 inline
1022 {
1023  m_Div = std::forward<COrgName_Base::TDiv>(value);
1024  m_set_State[0] |= 0x3000;
1025 }
1026 
1027 inline
1029 {
1030 #ifdef _DEBUG
1031  if (!IsSetDiv()) {
1032  m_Div = UnassignedString();
1033  }
1034 #endif
1035  m_set_State[0] |= 0x1000;
1036  return m_Div;
1037 }
1038 
1039 inline
1041 {
1042  return ((m_set_State[0] & 0xc000) != 0);
1043 }
1044 
1045 inline
1047 {
1048  return IsSetPgcode();
1049 }
1050 
1051 inline
1053 {
1054  m_Pgcode = 0;
1055  m_set_State[0] &= ~0xc000;
1056 }
1057 
1058 inline
1060 {
1061  if (!CanGetPgcode()) {
1062  ThrowUnassigned(7);
1063  }
1064  return m_Pgcode;
1065 }
1066 
1067 inline
1069 {
1070  m_Pgcode = value;
1071  m_set_State[0] |= 0xc000;
1072 }
1073 
1074 inline
1076 {
1077 #ifdef _DEBUG
1078  if (!IsSetPgcode()) {
1079  memset(&m_Pgcode,UnassignedByte(),sizeof(m_Pgcode));
1080  }
1081 #endif
1082  m_set_State[0] |= 0x4000;
1083  return m_Pgcode;
1084 }
1085 
1086 ///////////////////////////////////////////////////////////
1087 ////////////////// end of inline methods //////////////////
1088 ///////////////////////////////////////////////////////////
1089 
1090 
1091 
1092 
1093 
1094 END_objects_SCOPE // namespace ncbi::objects::
1095 
1097 
1098 
1099 #endif // OBJECTS_SEQFEAT_ORGNAME_BASE_HPP
CBinomialOrgName –.
CMultiOrgName –.
@OrgMod.hpp User-defined methods of the data storage class.
Definition: OrgMod.hpp:54
COrgName_Base –.
Definition: OrgName_.hpp:81
CPartialOrgName –.
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
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
@ eDoNotResetVariant
Definition: serialbase.hpp:78
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_SEQFEAT_EXPORT
Definition: ncbi_export.h:768
const TMod & GetMod(void) const
Get the Mod member data.
Definition: OrgName_.hpp:839
bool CanGetMod(void) const
Check if it is safe to call GetMod method.
Definition: OrgName_.hpp:833
TDiv & SetDiv(void)
Assign a value to Div data member.
Definition: OrgName_.hpp:1028
string TAttrib
Definition: OrgName_.hpp:331
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
bool CanGetName(void) const
Check if it is safe to call GetName method.
Definition: OrgName_.hpp:765
const TLineage & GetLineage(void) const
Get the Lineage member data.
Definition: OrgName_.hpp:864
string m_Lineage
Definition: OrgName_.hpp:669
bool IsSetPgcode(void) const
plastid genetic code Check if a value has been assigned to Pgcode data member.
Definition: OrgName_.hpp:1040
bool CanGetDiv(void) const
Check if it is safe to call GetDiv method.
Definition: OrgName_.hpp:999
const TDiv & GetDiv(void) const
Get the Div member data.
Definition: OrgName_.hpp:1005
void ResetMgcode(void)
Reset Mgcode data member.
Definition: OrgName_.hpp:958
const TVirus & GetVirus(void) const
Get the variant data.
Definition: OrgName_.hpp:727
TMgcode GetMgcode(void) const
Get the Mgcode member data.
Definition: OrgName_.hpp:965
list< CRef< COrgMod > > m_Mod
Definition: OrgName_.hpp:668
E_Choice Which(void) const
Which variant is currently selected.
Definition: OrgName_.hpp:686
TGcode GetGcode(void) const
Get the Gcode member data.
Definition: OrgName_.hpp:918
bool IsHybrid(void) const
Check if variant Hybrid is selected.
Definition: OrgName_.hpp:741
C_Name & operator=(const C_Name &)
string TLineage
Definition: OrgName_.hpp:333
bool IsNamedhybrid(void) const
Check if variant Namedhybrid is selected.
Definition: OrgName_.hpp:747
TVirus & SetVirus(void)
Select the variant.
Definition: OrgName_.hpp:734
Uint4 m_set_State[1]
Definition: OrgName_.hpp:665
TMgcode & SetMgcode(void)
Assign a value to Mgcode data member.
Definition: OrgName_.hpp:981
CSerialObject Tparent
Definition: OrgName_.hpp:82
bool IsSetLineage(void) const
lineage with semicolon separators Check if a value has been assigned to Lineage data member.
Definition: OrgName_.hpp:852
DECLARE_INTERNAL_TYPE_INFO()
bool IsPartial(void) const
Check if variant Partial is selected.
Definition: OrgName_.hpp:753
COrgName_Base & operator=(const COrgName_Base &)
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
Definition: OrgName_.hpp:692
TLineage & SetLineage(void)
Assign a value to Lineage data member.
Definition: OrgName_.hpp:887
const TName & GetName(void) const
Get the Name member data.
Definition: OrgName_.hpp:771
bool IsSetMgcode(void) const
mitochondrial genetic code Check if a value has been assigned to Mgcode data member.
Definition: OrgName_.hpp:946
CSerialObject Tparent
Definition: OrgName_.hpp:99
bool CanGetMgcode(void) const
Check if it is safe to call GetMgcode method.
Definition: OrgName_.hpp:952
TPgcode & SetPgcode(void)
Assign a value to Pgcode data member.
Definition: OrgName_.hpp:1075
CRef< TName > m_Name
Definition: OrgName_.hpp:666
void ResetGcode(void)
Reset Gcode data member.
Definition: OrgName_.hpp:911
COrgName_Base(const COrgName_Base &)
void ResetPgcode(void)
Reset Pgcode data member.
Definition: OrgName_.hpp:1052
bool CanGetLineage(void) const
Check if it is safe to call GetLineage method.
Definition: OrgName_.hpp:858
bool IsSetDiv(void) const
GenBank division code Check if a value has been assigned to Div data member.
Definition: OrgName_.hpp:993
E_Choice
Choice variants.
Definition: OrgName_.hpp:111
bool IsSetMod(void) const
Check if a value has been assigned to Mod data member.
Definition: OrgName_.hpp:827
C_Name TName
Definition: OrgName_.hpp:330
CPartialOrgName TPartial
Definition: OrgName_.hpp:176
list< CRef< COrgMod > > TMod
Definition: OrgName_.hpp:332
CBinomialOrgName TNamedhybrid
Definition: OrgName_.hpp:175
bool IsSetAttrib(void) const
attribution of name Check if a value has been assigned to Attrib data member.
Definition: OrgName_.hpp:780
C_Name(const C_Name &)
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
Definition: OrgName_.hpp:325
bool CanGetAttrib(void) const
Check if it is safe to call GetAttrib method.
Definition: OrgName_.hpp:786
CMultiOrgName THybrid
Definition: OrgName_.hpp:174
bool IsSetGcode(void) const
genetic code (see CdRegion) Check if a value has been assigned to Gcode data member.
Definition: OrgName_.hpp:899
TMod & SetMod(void)
Assign a value to Mod data member.
Definition: OrgName_.hpp:845
bool CanGetGcode(void) const
Check if it is safe to call GetGcode method.
Definition: OrgName_.hpp:905
string m_Attrib
Definition: OrgName_.hpp:667
TAttrib & SetAttrib(void)
Assign a value to Attrib data member.
Definition: OrgName_.hpp:815
bool CanGetPgcode(void) const
Check if it is safe to call GetPgcode method.
Definition: OrgName_.hpp:1046
Tparent::CMemberIndex< E_memberIndex, 9 > TmemberIndex
Definition: OrgName_.hpp:351
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
TPgcode GetPgcode(void) const
Get the Pgcode member data.
Definition: OrgName_.hpp:1059
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
Definition: OrgName_.hpp:759
NCBI_NS_NCBI::CSerialObject * m_object
Definition: OrgName_.hpp:326
const TAttrib & GetAttrib(void) const
Get the Attrib member data.
Definition: OrgName_.hpp:792
TGcode & SetGcode(void)
Assign a value to Gcode data member.
Definition: OrgName_.hpp:934
string m_Div
Definition: OrgName_.hpp:672
CBinomialOrgName TBinomial
Definition: OrgName_.hpp:172
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
Definition: OrgName_.hpp:120
bool IsVirus(void) const
Check if variant Virus is selected.
Definition: OrgName_.hpp:721
bool IsBinomial(void) const
Check if variant Binomial is selected.
Definition: OrgName_.hpp:715
@ e_Hybrid
hybrid between organisms
Definition: OrgName_.hpp:115
@ e_Namedhybrid
some hybrids have genus x species name
Definition: OrgName_.hpp:116
@ e_Binomial
genus/species type name
Definition: OrgName_.hpp:113
@ e_Virus
virus names are different
Definition: OrgName_.hpp:114
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void GetGcode(const TEntryList &seq_entries, ParserPtr pp)
Definition: nucprot.cpp:247
void SetPartial(CSeq_loc &loc, CRef< CSeq_feat > feat, CSeq_loc::TStrand strand, bool partial_start, bool partial_stop)
void SetDiv(CRef< objects::CSeq_entry > entry, string div)
void SetGcode(CRef< objects::CSeq_entry > entry, objects::COrgName::TGcode gcode)
void SetLineage(CRef< objects::CSeq_entry > entry, string lineage)
Modified on Wed Apr 17 13:09:59 2024 by modify_doxy.py rev. 669887