NCBI C++ ToolKit
User_field_.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 User_field_.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/general/general.asn">general.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/general/general.def">general.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_GENERAL_USER_FIELD_BASE_HPP
42 #define OBJECTS_GENERAL_USER_FIELD_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
49 #include <vector>
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 CObject_id;
62 class CUser_field;
63 class CUser_object;
64 
65 
66 // generated classes
67 
68 
69 /** @addtogroup dataspec_NCBI_General
70  *
71  * @{
72  */
73 
74 /////////////////////////////////////////////////////////////////////////////
75 ///
76 /// CUser_field_Base --
77 ///
78 
80 {
82 public:
83  // constructor
84  CUser_field_Base(void);
85  // destructor
86  virtual ~CUser_field_Base(void);
87 
88  // type info
90 
91  /////////////////////////////////////////////////////////////////////////////
92  /// field contents
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  /// Choice variants.
111  enum E_Choice {
112  e_not_set = 0, ///< No variant selected
118  e_Object, ///< for using other definitions
124  e_Objects
125  };
126  /// Maximum+1 value of the choice variant enumerator.
128  e_MaxChoice = 13 ///< == e_Objects+1
129  };
130 
131  /// Reset the whole object
132  void Reset(void);
133 
134  /// Reset the selection (set it to e_not_set).
135  void ResetSelection(void);
136 
137  /// Which variant is currently selected.
138  ///
139  /// @return
140  /// Choice state enumerator.
141  E_Choice Which(void) const;
142 
143  /// Verify selection, throw exception if it differs from the expected.
144  ///
145  /// @param index
146  /// Expected selection.
147  void CheckSelected(E_Choice index) const;
148 
149  /// Throw 'InvalidSelection' exception.
150  ///
151  /// @param index
152  /// Expected selection.
153  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
154 
155  /// Retrieve selection name (for diagnostic purposes).
156  ///
157  /// @param index
158  /// One of possible selection states.
159  /// @return
160  /// Name string.
161  static string SelectionName(E_Choice index);
162 
163  /// Select the requested variant if needed.
164  ///
165  /// @param index
166  /// New selection state.
167  /// @param reset
168  /// Flag that defines the resetting of the variant data. The data will
169  /// be reset if either the current selection differs from the new one,
170  /// or the flag is set to eDoResetVariant.
172  /// Select the requested variant if needed,
173  /// allocating CObject variants from memory pool.
174  void Select(E_Choice index,
175  EResetVariant reset,
176  CObjectMemoryPool* pool);
177 
178  // types
179  typedef CStringUTF8 TStr;
180  typedef int TInt;
181  typedef double TReal;
182  typedef bool TBool;
183  typedef vector< char > TOs;
185  typedef vector< CStringUTF8 > TStrs;
186  typedef vector< int > TInts;
187  typedef vector< double > TReals;
188  typedef vector< vector< char >* > TOss;
189  typedef vector< CRef< CUser_field > > TFields;
190  typedef vector< CRef< CUser_object > > TObjects;
191 
192  // getters
193  // setters
194 
195 
196  /// Check if variant Str is selected.
197  ///
198  /// Str type is defined as 'typedef CStringUTF8 TStr'.
199  /// @return
200  /// - true, if the variant is selected.
201  /// - false, otherwise.
202  bool IsStr(void) const;
203 
204  /// Get the variant data.
205  ///
206  /// @return
207  /// Reference to the data.
208  const TStr& GetStr(void) const;
209 
210  /// Select the variant.
211  ///
212  /// @return
213  /// Reference to the variant data.
214  TStr& SetStr(void);
215 
216  /// Select the variant and set its data.
217  ///
218  /// @param value
219  /// Variant data.
220  void SetStr(const TStr& value);
221 
222 
223  /// Check if variant Int is selected.
224  ///
225  /// Int type is defined as 'typedef int TInt'.
226  /// @return
227  /// - true, if the variant is selected.
228  /// - false, otherwise.
229  bool IsInt(void) const;
230 
231  /// Get the variant data.
232  ///
233  /// @return
234  /// Copy of the variant data.
235  TInt GetInt(void) const;
236 
237  /// Select the variant.
238  ///
239  /// @return
240  /// Reference to the variant data.
241  TInt& SetInt(void);
242 
243  /// Select the variant and set its data.
244  ///
245  /// @param value
246  /// Variant data.
247  void SetInt(TInt value);
248 
249 
250  /// Check if variant Real is selected.
251  ///
252  /// Real type is defined as 'typedef double TReal'.
253  /// @return
254  /// - true, if the variant is selected.
255  /// - false, otherwise.
256  bool IsReal(void) const;
257 
258  /// Get the variant data.
259  ///
260  /// @return
261  /// Copy of the variant data.
262  TReal GetReal(void) const;
263 
264  /// Select the variant.
265  ///
266  /// @return
267  /// Reference to the variant data.
268  TReal& SetReal(void);
269 
270  /// Select the variant and set its data.
271  ///
272  /// @param value
273  /// Variant data.
274  void SetReal(TReal value);
275 
276 
277  /// Check if variant Bool is selected.
278  ///
279  /// Bool type is defined as 'typedef bool TBool'.
280  /// @return
281  /// - true, if the variant is selected.
282  /// - false, otherwise.
283  bool IsBool(void) const;
284 
285  /// Get the variant data.
286  ///
287  /// @return
288  /// Copy of the variant data.
289  TBool GetBool(void) const;
290 
291  /// Select the variant.
292  ///
293  /// @return
294  /// Reference to the variant data.
295  TBool& SetBool(void);
296 
297  /// Select the variant and set its data.
298  ///
299  /// @param value
300  /// Variant data.
301  void SetBool(TBool value);
302 
303 
304  /// Check if variant Os is selected.
305  ///
306  /// Os type is defined as 'typedef vector< char > TOs'.
307  /// @return
308  /// - true, if the variant is selected.
309  /// - false, otherwise.
310  bool IsOs(void) const;
311 
312  /// Get the variant data.
313  ///
314  /// @return
315  /// Reference to the data.
316  const TOs& GetOs(void) const;
317 
318  /// Select the variant.
319  ///
320  /// @return
321  /// Reference to the variant data.
322  TOs& SetOs(void);
323 
324 
325  /// Check if variant Object is selected.
326  ///
327  /// Object type is defined as 'typedef CUser_object TObject'.
328  /// @return
329  /// - true, if the variant is selected.
330  /// - false, otherwise.
331  bool IsObject(void) const;
332 
333  /// Get the variant data.
334  ///
335  /// @return
336  /// Reference to the data.
337  const TObject& GetObject(void) const;
338 
339  /// Select the variant.
340  ///
341  /// @return
342  /// Reference to the variant data.
343  TObject& SetObject(void);
344  /// Select the variant and set its data.
345  ///
346  /// @param value
347  /// Reference to the data.
348  void SetObject(TObject& value);
349 
350 
351  /// Check if variant Strs is selected.
352  ///
353  /// Strs type is defined as 'typedef vector< CStringUTF8 > TStrs'.
354  /// @return
355  /// - true, if the variant is selected.
356  /// - false, otherwise.
357  bool IsStrs(void) const;
358 
359  /// Get the variant data.
360  ///
361  /// @return
362  /// Reference to the data.
363  const TStrs& GetStrs(void) const;
364 
365  /// Select the variant.
366  ///
367  /// @return
368  /// Reference to the variant data.
369  TStrs& SetStrs(void);
370 
371 
372  /// Check if variant Ints is selected.
373  ///
374  /// Ints type is defined as 'typedef vector< int > TInts'.
375  /// @return
376  /// - true, if the variant is selected.
377  /// - false, otherwise.
378  bool IsInts(void) const;
379 
380  /// Get the variant data.
381  ///
382  /// @return
383  /// Reference to the data.
384  const TInts& GetInts(void) const;
385 
386  /// Select the variant.
387  ///
388  /// @return
389  /// Reference to the variant data.
390  TInts& SetInts(void);
391 
392 
393  /// Check if variant Reals is selected.
394  ///
395  /// Reals type is defined as 'typedef vector< double > TReals'.
396  /// @return
397  /// - true, if the variant is selected.
398  /// - false, otherwise.
399  bool IsReals(void) const;
400 
401  /// Get the variant data.
402  ///
403  /// @return
404  /// Reference to the data.
405  const TReals& GetReals(void) const;
406 
407  /// Select the variant.
408  ///
409  /// @return
410  /// Reference to the variant data.
411  TReals& SetReals(void);
412 
413 
414  /// Check if variant Oss is selected.
415  ///
416  /// Oss type is defined as 'typedef vector< vector< char >* > TOss'.
417  /// @return
418  /// - true, if the variant is selected.
419  /// - false, otherwise.
420  bool IsOss(void) const;
421 
422  /// Get the variant data.
423  ///
424  /// @return
425  /// Reference to the data.
426  const TOss& GetOss(void) const;
427 
428  /// Select the variant.
429  ///
430  /// @return
431  /// Reference to the variant data.
432  TOss& SetOss(void);
433 
434 
435  /// Check if variant Fields is selected.
436  ///
437  /// Fields type is defined as 'typedef vector< CRef< CUser_field > > TFields'.
438  /// @return
439  /// - true, if the variant is selected.
440  /// - false, otherwise.
441  bool IsFields(void) const;
442 
443  /// Get the variant data.
444  ///
445  /// @return
446  /// Reference to the data.
447  const TFields& GetFields(void) const;
448 
449  /// Select the variant.
450  ///
451  /// @return
452  /// Reference to the variant data.
453  TFields& SetFields(void);
454 
455 
456  /// Check if variant Objects is selected.
457  ///
458  /// Objects type is defined as 'typedef vector< CRef< CUser_object > > TObjects'.
459  /// @return
460  /// - true, if the variant is selected.
461  /// - false, otherwise.
462  bool IsObjects(void) const;
463 
464  /// Get the variant data.
465  ///
466  /// @return
467  /// Reference to the data.
468  const TObjects& GetObjects(void) const;
469 
470  /// Select the variant.
471  ///
472  /// @return
473  /// Reference to the variant data.
474  TObjects& SetObjects(void);
475 
476 
477  private:
478  // copy constructor and assignment operator
479  C_Data(const C_Data& );
481  // choice state
483  // helper methods
484  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
485 
486  static const char* const sm_SelectionNames[];
487  // data
488  union {
492  NCBI_NS_NCBI::CUnionBuffer<TOs> m_Os;
493  NCBI_NS_NCBI::CUnionBuffer<TStrs> m_Strs;
494  NCBI_NS_NCBI::CUnionBuffer<TInts> m_Ints;
495  NCBI_NS_NCBI::CUnionBuffer<TReals> m_Reals;
496  NCBI_NS_NCBI::CUnionBuffer<TOss> m_Oss;
497  NCBI_NS_NCBI::CUnionBuffer<TFields> m_Fields;
498  NCBI_NS_NCBI::CUnionBuffer<TObjects> m_Objects;
499  NCBI_NS_NCBI::CUnionBuffer<CStringUTF8> m_string_utf8;
500  NCBI_NS_NCBI::CSerialObject *m_object;
501  };
502  };
503  // types
505  typedef int TNum;
506  typedef C_Data TData;
507 
508  // member index
509  enum class E_memberIndex {
510  e__allMandatory = 0,
511  e_label,
512  e_num,
513  e_data
514  };
516 
517  // getters
518  // setters
519 
520  /// field label
521  /// Check if a value has been assigned to Label data member.
522  ///
523  /// Data member Label is mandatory;
524  /// its type is defined as 'typedef CObject_id TLabel'
525  /// @return
526  /// - true, if a value has been assigned.
527  /// - false, otherwise.
528  bool IsSetLabel(void) const;
529 
530  /// Check if it is safe to call GetLabel method.
531  ///
532  /// @return
533  /// - true, if the data member is getatable.
534  /// - false, otherwise.
535  bool CanGetLabel(void) const;
536 
537  /// Reset Label data member.
538  void ResetLabel(void);
539 
540  /// Get the Label member data.
541  ///
542  /// @return
543  /// Reference to the member data.
544  const TLabel& GetLabel(void) const;
545 
546  /// Assign a value to Label data member.
547  ///
548  /// @param value
549  /// Reference to value.
550  void SetLabel(TLabel& value);
551 
552  /// Assign a value to Label data member.
553  ///
554  /// @return
555  /// Reference to the data value.
556  TLabel& SetLabel(void);
557 
558  /// required for strs, ints, reals, oss
559  /// Check if a value has been assigned to Num data member.
560  ///
561  /// Data member Num is optional;
562  /// its type is defined as 'typedef int TNum'
563  /// @return
564  /// - true, if a value has been assigned.
565  /// - false, otherwise.
566  bool IsSetNum(void) const;
567 
568  /// Check if it is safe to call GetNum method.
569  ///
570  /// @return
571  /// - true, if the data member is getatable.
572  /// - false, otherwise.
573  bool CanGetNum(void) const;
574 
575  /// Reset Num data member.
576  void ResetNum(void);
577 
578  /// Get the Num member data.
579  ///
580  /// @return
581  /// Copy of the member data.
582  TNum GetNum(void) const;
583 
584  /// Assign a value to Num data member.
585  ///
586  /// @param value
587  /// Value to assign
588  void SetNum(TNum value);
589 
590  /// Assign a value to Num data member.
591  ///
592  /// @return
593  /// Reference to the data value.
594  TNum& SetNum(void);
595 
596  /// Check if a value has been assigned to Data data member.
597  ///
598  /// Data member Data is mandatory;
599  /// its type is defined as 'typedef C_Data TData'
600  /// @return
601  /// - true, if a value has been assigned.
602  /// - false, otherwise.
603  bool IsSetData(void) const;
604 
605  /// Check if it is safe to call GetData method.
606  ///
607  /// @return
608  /// - true, if the data member is getatable.
609  /// - false, otherwise.
610  bool CanGetData(void) const;
611 
612  /// Reset Data data member.
613  void ResetData(void);
614 
615  /// Get the Data member data.
616  ///
617  /// @return
618  /// Reference to the member data.
619  const TData& GetData(void) const;
620 
621  /// Assign a value to Data data member.
622  ///
623  /// @param value
624  /// Reference to value.
625  void SetData(TData& value);
626 
627  /// Assign a value to Data data member.
628  ///
629  /// @return
630  /// Reference to the data value.
631  TData& SetData(void);
632 
633  /// Reset the whole object
634  virtual void Reset(void);
635 
636 
637 private:
638  // Prohibit copy constructor and assignment operator
641 
642  // data
643  Uint4 m_set_State[1];
645  int m_Num;
647 };
648 
649 /* @} */
650 
651 
652 
653 
654 
655 ///////////////////////////////////////////////////////////
656 ///////////////////// inline methods //////////////////////
657 ///////////////////////////////////////////////////////////
658 inline
660 {
661  return m_choice;
662 }
663 
664 inline
666 {
667  if ( m_choice != index )
668  ThrowInvalidSelection(index);
669 }
670 
671 inline
672 void CUser_field_Base::C_Data::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
673 {
674  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
675  if ( m_choice != e_not_set )
676  ResetSelection();
677  DoSelect(index, pool);
678  }
679 }
680 
681 inline
683 {
684  Select(index, reset, 0);
685 }
686 
687 inline
689 {
690  return m_choice == e_Str;
691 }
692 
693 inline
695 {
696  CheckSelected(e_Str);
697  return *m_string_utf8;
698 }
699 
700 inline
702 {
703  Select(e_Str, NCBI_NS_NCBI::eDoNotResetVariant);
704  return *m_string_utf8;
705 }
706 
707 inline
709 {
710  return m_choice == e_Int;
711 }
712 
713 inline
715 {
716  CheckSelected(e_Int);
717  return m_Int;
718 }
719 
720 inline
722 {
723  Select(e_Int, NCBI_NS_NCBI::eDoNotResetVariant);
724  return m_Int;
725 }
726 
727 inline
729 {
730  Select(e_Int, NCBI_NS_NCBI::eDoNotResetVariant);
731  m_Int = value;
732 }
733 
734 inline
736 {
737  return m_choice == e_Real;
738 }
739 
740 inline
742 {
743  CheckSelected(e_Real);
744  return m_Real;
745 }
746 
747 inline
749 {
750  Select(e_Real, NCBI_NS_NCBI::eDoNotResetVariant);
751  return m_Real;
752 }
753 
754 inline
756 {
757  Select(e_Real, NCBI_NS_NCBI::eDoNotResetVariant);
758  m_Real = value;
759 }
760 
761 inline
763 {
764  return m_choice == e_Bool;
765 }
766 
767 inline
769 {
770  CheckSelected(e_Bool);
771  return m_Bool;
772 }
773 
774 inline
776 {
777  Select(e_Bool, NCBI_NS_NCBI::eDoNotResetVariant);
778  return m_Bool;
779 }
780 
781 inline
783 {
784  Select(e_Bool, NCBI_NS_NCBI::eDoNotResetVariant);
785  m_Bool = value;
786 }
787 
788 inline
790 {
791  return m_choice == e_Os;
792 }
793 
794 inline
796 {
797  CheckSelected(e_Os);
798  return *m_Os;
799 }
800 
801 inline
803 {
804  Select(e_Os, NCBI_NS_NCBI::eDoNotResetVariant);
805  return *m_Os;
806 }
807 
808 inline
810 {
811  return m_choice == e_Object;
812 }
813 
814 inline
816 {
817  return m_choice == e_Strs;
818 }
819 
820 inline
822 {
823  CheckSelected(e_Strs);
824  return *m_Strs;
825 }
826 
827 inline
829 {
830  Select(e_Strs, NCBI_NS_NCBI::eDoNotResetVariant);
831  return *m_Strs;
832 }
833 
834 inline
836 {
837  return m_choice == e_Ints;
838 }
839 
840 inline
842 {
843  CheckSelected(e_Ints);
844  return *m_Ints;
845 }
846 
847 inline
849 {
850  Select(e_Ints, NCBI_NS_NCBI::eDoNotResetVariant);
851  return *m_Ints;
852 }
853 
854 inline
856 {
857  return m_choice == e_Reals;
858 }
859 
860 inline
862 {
863  CheckSelected(e_Reals);
864  return *m_Reals;
865 }
866 
867 inline
869 {
870  Select(e_Reals, NCBI_NS_NCBI::eDoNotResetVariant);
871  return *m_Reals;
872 }
873 
874 inline
876 {
877  return m_choice == e_Oss;
878 }
879 
880 inline
882 {
883  CheckSelected(e_Oss);
884  return *m_Oss;
885 }
886 
887 inline
889 {
890  Select(e_Oss, NCBI_NS_NCBI::eDoNotResetVariant);
891  return *m_Oss;
892 }
893 
894 inline
896 {
897  return m_choice == e_Fields;
898 }
899 
900 inline
902 {
903  CheckSelected(e_Fields);
904  return *m_Fields;
905 }
906 
907 inline
909 {
910  Select(e_Fields, NCBI_NS_NCBI::eDoNotResetVariant);
911  return *m_Fields;
912 }
913 
914 inline
916 {
917  return m_choice == e_Objects;
918 }
919 
920 inline
922 {
923  CheckSelected(e_Objects);
924  return *m_Objects;
925 }
926 
927 inline
929 {
930  Select(e_Objects, NCBI_NS_NCBI::eDoNotResetVariant);
931  return *m_Objects;
932 }
933 
934 inline
936 {
937  return m_Label.NotEmpty();
938 }
939 
940 inline
942 {
943  return true;
944 }
945 
946 inline
948 {
949  if ( !m_Label ) {
950  const_cast<CUser_field_Base*>(this)->ResetLabel();
951  }
952  return (*m_Label);
953 }
954 
955 inline
957 {
958  if ( !m_Label ) {
959  ResetLabel();
960  }
961  return (*m_Label);
962 }
963 
964 inline
966 {
967  return ((m_set_State[0] & 0xc) != 0);
968 }
969 
970 inline
972 {
973  return IsSetNum();
974 }
975 
976 inline
978 {
979  m_Num = 0;
980  m_set_State[0] &= ~0xc;
981 }
982 
983 inline
985 {
986  if (!CanGetNum()) {
987  ThrowUnassigned(1);
988  }
989  return m_Num;
990 }
991 
992 inline
994 {
995  m_Num = value;
996  m_set_State[0] |= 0xc;
997 }
998 
999 inline
1001 {
1002 #ifdef _DEBUG
1003  if (!IsSetNum()) {
1004  memset(&m_Num,UnassignedByte(),sizeof(m_Num));
1005  }
1006 #endif
1007  m_set_State[0] |= 0x4;
1008  return m_Num;
1009 }
1010 
1011 inline
1013 {
1014  return m_Data.NotEmpty();
1015 }
1016 
1017 inline
1019 {
1020  return true;
1021 }
1022 
1023 inline
1025 {
1026  if ( !m_Data ) {
1027  const_cast<CUser_field_Base*>(this)->ResetData();
1028  }
1029  return (*m_Data);
1030 }
1031 
1032 inline
1034 {
1035  if ( !m_Data ) {
1036  ResetData();
1037  }
1038  return (*m_Data);
1039 }
1040 
1041 ///////////////////////////////////////////////////////////
1042 ////////////////// end of inline methods //////////////////
1043 ///////////////////////////////////////////////////////////
1044 
1045 
1046 
1047 
1048 
1049 END_objects_SCOPE // namespace ncbi::objects::
1050 
1052 
1053 
1054 #endif // OBJECTS_GENERAL_USER_FIELD_BASE_HPP
CRef –.
Definition: ncbiobj.hpp:618
Base class for all serializable objects.
Definition: serialbase.hpp:150
CUser_field_Base –.
Definition: User_field_.hpp:80
char value[7]
Definition: config.c:431
vector< CConstRef< CObject > > GetObjects(CSeq_entry_Handle seh, const string &field, CFieldNamePanel::EFieldType field_type, int subtype, const string &ncRNA_class, CConstRef< objects::CSeq_submit > submit, CRef< CEditingActionConstraint > constraint, vector< CSeq_entry_Handle > *descr_context=nullptr)
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
EResetVariant
Definition: serialbase.hpp:76
@ eDoResetVariant
Definition: serialbase.hpp:77
@ eDoNotResetVariant
Definition: serialbase.hpp:78
string GetLabel(const CSeq_id &id)
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
std::string CStringUTF8
Definition: ncbistl.hpp:254
#define NCBI_GENERAL_EXPORT
Definition: ncbi_export.h:511
TOs & SetOs(void)
Select the variant.
const TStr & GetStr(void) const
Get the variant data.
E_Choice
Choice variants.
TFields & SetFields(void)
Select the variant.
void ResetLabel(void)
Reset Label data member.
NCBI_NS_NCBI::CUnionBuffer< TObjects > m_Objects
Uint4 m_set_State[1]
CUser_field_Base(const CUser_field_Base &)
bool IsStrs(void) const
Check if variant Strs is selected.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
bool CanGetData(void) const
Check if it is safe to call GetData method.
const TOss & GetOss(void) const
Get the variant data.
CUser_field_Base & operator=(const CUser_field_Base &)
TInt & SetInt(void)
Select the variant.
CObject_id TLabel
vector< double > TReals
const TFields & GetFields(void) const
Get the variant data.
TOss & SetOss(void)
Select the variant.
vector< CRef< CUser_field > > TFields
TBool GetBool(void) const
Get the variant data.
vector< vector< char > * > TOss
CRef< TData > m_Data
C_Data(const C_Data &)
bool CanGetNum(void) const
Check if it is safe to call GetNum method.
NCBI_NS_NCBI::CUnionBuffer< TFields > m_Fields
bool IsFields(void) const
Check if variant Fields is selected.
bool IsInt(void) const
Check if variant Int is selected.
TData & SetData(void)
Assign a value to Data data member.
bool IsStr(void) const
Check if variant Str is selected.
NCBI_NS_NCBI::CUnionBuffer< TStrs > m_Strs
NCBI_NS_NCBI::CUnionBuffer< TReals > m_Reals
vector< CRef< CUser_object > > TObjects
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsSetNum(void) const
required for strs, ints, reals, oss Check if a value has been assigned to Num data member.
TStr & SetStr(void)
Select the variant.
TLabel & SetLabel(void)
Assign a value to Label data member.
TInt GetInt(void) const
Get the variant data.
bool IsInts(void) const
Check if variant Ints is selected.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
TReal & SetReal(void)
Select the variant.
bool IsObjects(void) const
Check if variant Objects is selected.
NCBI_NS_NCBI::CUnionBuffer< TOss > m_Oss
bool IsOss(void) const
Check if variant Oss is selected.
CRef< TLabel > m_Label
C_Data & operator=(const C_Data &)
TObjects & SetObjects(void)
Select the variant.
TReal GetReal(void) const
Get the variant data.
TReals & SetReals(void)
Select the variant.
TInts & SetInts(void)
Select the variant.
NCBI_NS_NCBI::CSerialObject * m_object
TBool & SetBool(void)
Select the variant.
TNum & SetNum(void)
Assign a value to Num data member.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
const TReals & GetReals(void) const
Get the variant data.
void ResetNum(void)
Reset Num data member.
bool IsReal(void) const
Check if variant Real is selected.
const TLabel & GetLabel(void) const
Get the Label member data.
NCBI_NS_NCBI::CUnionBuffer< CStringUTF8 > m_string_utf8
bool IsObject(void) const
Check if variant Object is selected.
Tparent::CMemberIndex< E_memberIndex, 4 > TmemberIndex
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
CSerialObject Tparent
Definition: User_field_.hpp:81
bool IsOs(void) const
Check if variant Os is selected.
TStrs & SetStrs(void)
Select the variant.
vector< CStringUTF8 > TStrs
bool CanGetLabel(void) const
Check if it is safe to call GetLabel method.
bool IsBool(void) const
Check if variant Bool is selected.
void ResetData(void)
Reset Data data member.
NCBI_NS_NCBI::CUnionBuffer< TInts > m_Ints
bool IsReals(void) const
Check if variant Reals is selected.
const TOs & GetOs(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TOs > m_Os
E_Choice Which(void) const
Which variant is currently selected.
const TInts & GetInts(void) const
Get the variant data.
const TObjects & GetObjects(void) const
Get the variant data.
TNum GetNum(void) const
Get the Num member data.
@ e_Object
for using other definitions
@ e_not_set
Modified on Thu Sep 21 03:46:39 2023 by modify_doxy.py rev. 669887