NCBI C++ ToolKit
Biostruc_feature_.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 Biostruc_feature_.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/mmdb3/mmdb3.asn">mmdb3.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/mmdb3/mmdb3.def">mmdb3.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_MMDB3_BIOSTRUC_FEATURE_BASE_HPP
42 #define OBJECTS_MMDB3_BIOSTRUC_FEATURE_BASE_HPP
43 
44 // standard includes
45 #include <serial/serialbase.hpp>
46 
47 // generated includes
48 #include <string>
51 
53 
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
57 #endif
58 BEGIN_objects_SCOPE // namespace ncbi::objects::
59 
60 
61 // forward declarations
62 class CBiostruc_script;
63 class CCamera;
66 class CChem_graph_pntrs;
67 class CColor_prop;
68 class COther_feature;
69 class CRegion_pntrs;
70 class CRegion_similarity;
71 class CTransform;
72 class CUser_object;
73 
74 
75 // generated classes
76 
77 
78 /** @addtogroup dataspec_MMDB_Features
79  *
80  * @{
81  */
82 
83 /////////////////////////////////////////////////////////////////////////////
84 /// An explicitly specified type in Biostruc-feature allows for
85 /// efficient extraction and indexing of feature sets of a specific type.
86 /// Special types are provided for coloring and rendering, as
87 /// as needed by molecular graphics programs.
88 /// new
89 ///
90 /// CBiostruc_feature_Base --
91 ///
92 
94 {
96 public:
97  // constructor
99  // destructor
100  virtual ~CBiostruc_feature_Base(void);
101 
102  // type info
104 
105  enum EType {
106  eType_helix = 1,
107  eType_strand = 2,
108  eType_sheet = 3,
109  eType_turn = 4,
110  eType_site = 5,
111  eType_footnote = 6,
112  eType_comment = 7, ///< new
113  eType_interaction = 8, ///< interaction Data
114  eType_subgraph = 100, ///< NCBI domain reserved
115  eType_region = 101,
116  eType_core = 102, ///< user core definition
117  eType_supercore = 103, ///< NCBI reserved
118  eType_color = 150, ///< new
119  eType_render = 151, ///< new
120  eType_label = 152, ///< new
121  eType_transform = 153, ///< new
122  eType_camera = 154, ///< new
123  eType_script = 155, ///< for scripts
124  eType_alignment = 200, ///< VAST reserved
125  eType_similarity = 201,
126  eType_multalign = 202, ///< multiple alignment
127  eType_indirect = 203, ///< new
128  eType_cn3dstate = 254, ///< Cn3D reserved
129  eType_other = 255
130  };
131 
132  /// Access to EType's attributes (values, names) as defined in spec
133  static const NCBI_NS_NCBI::CEnumeratedTypeValues* ENUM_METHOD_NAME(EType)(void);
134 
135  /////////////////////////////////////////////////////////////////////////////
136  ///
137  /// C_Property --
138  ///
139 
141  {
143  public:
144  // constructor
145  C_Property(void);
146  // destructor
147  ~C_Property(void);
148 
149  // type info
151 
152 
153  /// Choice variants.
154  enum E_Choice {
155  e_not_set = 0, ///< No variant selected
161  e_User
162  };
163  /// Maximum+1 value of the choice variant enumerator.
165  e_MaxChoice = 7 ///< == e_User+1
166  };
167 
168  /// Reset the whole object
169  void Reset(void);
170 
171  /// Reset the selection (set it to e_not_set).
172  void ResetSelection(void);
173 
174  /// Which variant is currently selected.
175  ///
176  /// @return
177  /// Choice state enumerator.
178  E_Choice Which(void) const;
179 
180  /// Verify selection, throw exception if it differs from the expected.
181  ///
182  /// @param index
183  /// Expected selection.
184  void CheckSelected(E_Choice index) const;
185 
186  /// Throw 'InvalidSelection' exception.
187  ///
188  /// @param index
189  /// Expected selection.
190  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
191 
192  /// Retrieve selection name (for diagnostic purposes).
193  ///
194  /// @param index
195  /// One of possible selection states.
196  /// @return
197  /// Name string.
198  static string SelectionName(E_Choice index);
199 
200  /// Select the requested variant if needed.
201  ///
202  /// @param index
203  /// New selection state.
204  /// @param reset
205  /// Flag that defines the resetting of the variant data. The data will
206  /// be reset if either the current selection differs from the new one,
207  /// or the flag is set to eDoResetVariant.
209  /// Select the requested variant if needed,
210  /// allocating CObject variants from memory pool.
211  void Select(E_Choice index,
212  EResetVariant reset,
213  CObjectMemoryPool* pool);
214 
215  // types
217  typedef int TRender;
219  typedef CCamera TCamera;
222 
223  // getters
224  // setters
225 
226 
227  /// Check if variant Color is selected.
228  ///
229  /// Color type is defined as 'typedef CColor_prop TColor'.
230  /// @return
231  /// - true, if the variant is selected.
232  /// - false, otherwise.
233  bool IsColor(void) const;
234 
235  /// Get the variant data.
236  ///
237  /// @return
238  /// Reference to the data.
239  const TColor& GetColor(void) const;
240 
241  /// Select the variant.
242  ///
243  /// @return
244  /// Reference to the variant data.
245  TColor& SetColor(void);
246  /// Select the variant and set its data.
247  ///
248  /// @param value
249  /// Reference to the data.
250  void SetColor(TColor& value);
251 
252 
253  /// Check if variant Render is selected.
254  ///
255  /// Render type is defined as 'typedef int TRender'.
256  /// @return
257  /// - true, if the variant is selected.
258  /// - false, otherwise.
259  bool IsRender(void) const;
260 
261  /// Get the variant data.
262  ///
263  /// @return
264  /// Copy of the variant data.
265  TRender GetRender(void) const;
266 
267  /// Select the variant.
268  ///
269  /// @return
270  /// Reference to the variant data.
271  TRender& SetRender(void);
272 
273  /// Select the variant and set its data.
274  ///
275  /// @param value
276  /// Variant data.
277  void SetRender(TRender value);
278 
279 
280  /// Check if variant Transform is selected.
281  ///
282  /// Transform type is defined as 'typedef CTransform TTransform'.
283  /// @return
284  /// - true, if the variant is selected.
285  /// - false, otherwise.
286  bool IsTransform(void) const;
287 
288  /// Get the variant data.
289  ///
290  /// @return
291  /// Reference to the data.
292  const TTransform& GetTransform(void) const;
293 
294  /// Select the variant.
295  ///
296  /// @return
297  /// Reference to the variant data.
298  TTransform& SetTransform(void);
299  /// Select the variant and set its data.
300  ///
301  /// @param value
302  /// Reference to the data.
303  void SetTransform(TTransform& value);
304 
305 
306  /// Check if variant Camera is selected.
307  ///
308  /// Camera type is defined as 'typedef CCamera TCamera'.
309  /// @return
310  /// - true, if the variant is selected.
311  /// - false, otherwise.
312  bool IsCamera(void) const;
313 
314  /// Get the variant data.
315  ///
316  /// @return
317  /// Reference to the data.
318  const TCamera& GetCamera(void) const;
319 
320  /// Select the variant.
321  ///
322  /// @return
323  /// Reference to the variant data.
324  TCamera& SetCamera(void);
325  /// Select the variant and set its data.
326  ///
327  /// @param value
328  /// Reference to the data.
329  void SetCamera(TCamera& value);
330 
331 
332  /// Check if variant Script is selected.
333  ///
334  /// Script type is defined as 'typedef CBiostruc_script TScript'.
335  /// @return
336  /// - true, if the variant is selected.
337  /// - false, otherwise.
338  bool IsScript(void) const;
339 
340  /// Get the variant data.
341  ///
342  /// @return
343  /// Reference to the data.
344  const TScript& GetScript(void) const;
345 
346  /// Select the variant.
347  ///
348  /// @return
349  /// Reference to the variant data.
350  TScript& SetScript(void);
351  /// Select the variant and set its data.
352  ///
353  /// @param value
354  /// Reference to the data.
355  void SetScript(TScript& value);
356 
357 
358  /// Check if variant User is selected.
359  ///
360  /// User type is defined as 'typedef CUser_object TUser'.
361  /// @return
362  /// - true, if the variant is selected.
363  /// - false, otherwise.
364  bool IsUser(void) const;
365 
366  /// Get the variant data.
367  ///
368  /// @return
369  /// Reference to the data.
370  const TUser& GetUser(void) const;
371 
372  /// Select the variant.
373  ///
374  /// @return
375  /// Reference to the variant data.
376  TUser& SetUser(void);
377  /// Select the variant and set its data.
378  ///
379  /// @param value
380  /// Reference to the data.
381  void SetUser(TUser& value);
382 
383 
384  private:
385  // copy constructor and assignment operator
388  // choice state
390  // helper methods
391  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
392 
393  static const char* const sm_SelectionNames[];
394  // data
395  union {
397  NCBI_NS_NCBI::CSerialObject *m_object;
398  };
399  };
400  /////////////////////////////////////////////////////////////////////////////
401  ///
402  /// C_Location --
403  ///
404 
406  {
408  public:
409  // constructor
410  C_Location(void);
411  // destructor
412  ~C_Location(void);
413 
414  // type info
416 
417 
418  /// Choice variants.
419  enum E_Choice {
420  e_not_set = 0, ///< No variant selected
426  e_Indirect
427  };
428  /// Maximum+1 value of the choice variant enumerator.
430  e_MaxChoice = 7 ///< == e_Indirect+1
431  };
432 
433  /// Reset the whole object
434  void Reset(void);
435 
436  /// Reset the selection (set it to e_not_set).
437  void ResetSelection(void);
438 
439  /// Which variant is currently selected.
440  ///
441  /// @return
442  /// Choice state enumerator.
443  E_Choice Which(void) const;
444 
445  /// Verify selection, throw exception if it differs from the expected.
446  ///
447  /// @param index
448  /// Expected selection.
449  void CheckSelected(E_Choice index) const;
450 
451  /// Throw 'InvalidSelection' exception.
452  ///
453  /// @param index
454  /// Expected selection.
455  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
456 
457  /// Retrieve selection name (for diagnostic purposes).
458  ///
459  /// @param index
460  /// One of possible selection states.
461  /// @return
462  /// Name string.
463  static string SelectionName(E_Choice index);
464 
465  /// Select the requested variant if needed.
466  ///
467  /// @param index
468  /// New selection state.
469  /// @param reset
470  /// Flag that defines the resetting of the variant data. The data will
471  /// be reset if either the current selection differs from the new one,
472  /// or the flag is set to eDoResetVariant.
474  /// Select the requested variant if needed,
475  /// allocating CObject variants from memory pool.
476  void Select(E_Choice index,
477  EResetVariant reset,
478  CObjectMemoryPool* pool);
479 
480  // types
487 
488  // getters
489  // setters
490 
491 
492  /// Check if variant Subgraph is selected.
493  ///
494  /// Subgraph type is defined as 'typedef CChem_graph_pntrs TSubgraph'.
495  /// @return
496  /// - true, if the variant is selected.
497  /// - false, otherwise.
498  bool IsSubgraph(void) const;
499 
500  /// Get the variant data.
501  ///
502  /// @return
503  /// Reference to the data.
504  const TSubgraph& GetSubgraph(void) const;
505 
506  /// Select the variant.
507  ///
508  /// @return
509  /// Reference to the variant data.
510  TSubgraph& SetSubgraph(void);
511  /// Select the variant and set its data.
512  ///
513  /// @param value
514  /// Reference to the data.
515  void SetSubgraph(TSubgraph& value);
516 
517 
518  /// Check if variant Region is selected.
519  ///
520  /// Region type is defined as 'typedef CRegion_pntrs TRegion'.
521  /// @return
522  /// - true, if the variant is selected.
523  /// - false, otherwise.
524  bool IsRegion(void) const;
525 
526  /// Get the variant data.
527  ///
528  /// @return
529  /// Reference to the data.
530  const TRegion& GetRegion(void) const;
531 
532  /// Select the variant.
533  ///
534  /// @return
535  /// Reference to the variant data.
536  TRegion& SetRegion(void);
537  /// Select the variant and set its data.
538  ///
539  /// @param value
540  /// Reference to the data.
541  void SetRegion(TRegion& value);
542 
543 
544  /// Check if variant Alignment is selected.
545  ///
546  /// Alignment type is defined as 'typedef CChem_graph_alignment TAlignment'.
547  /// @return
548  /// - true, if the variant is selected.
549  /// - false, otherwise.
550  bool IsAlignment(void) const;
551 
552  /// Get the variant data.
553  ///
554  /// @return
555  /// Reference to the data.
556  const TAlignment& GetAlignment(void) const;
557 
558  /// Select the variant.
559  ///
560  /// @return
561  /// Reference to the variant data.
562  TAlignment& SetAlignment(void);
563  /// Select the variant and set its data.
564  ///
565  /// @param value
566  /// Reference to the data.
567  void SetAlignment(TAlignment& value);
568 
569 
570  /// Check if variant Interaction is selected.
571  ///
572  /// Interaction type is defined as 'typedef CChem_graph_interaction TInteraction'.
573  /// @return
574  /// - true, if the variant is selected.
575  /// - false, otherwise.
576  bool IsInteraction(void) const;
577 
578  /// Get the variant data.
579  ///
580  /// @return
581  /// Reference to the data.
582  const TInteraction& GetInteraction(void) const;
583 
584  /// Select the variant.
585  ///
586  /// @return
587  /// Reference to the variant data.
588  TInteraction& SetInteraction(void);
589  /// Select the variant and set its data.
590  ///
591  /// @param value
592  /// Reference to the data.
593  void SetInteraction(TInteraction& value);
594 
595 
596  /// Check if variant Similarity is selected.
597  ///
598  /// Similarity type is defined as 'typedef CRegion_similarity TSimilarity'.
599  /// @return
600  /// - true, if the variant is selected.
601  /// - false, otherwise.
602  bool IsSimilarity(void) const;
603 
604  /// Get the variant data.
605  ///
606  /// @return
607  /// Reference to the data.
608  const TSimilarity& GetSimilarity(void) const;
609 
610  /// Select the variant.
611  ///
612  /// @return
613  /// Reference to the variant data.
614  TSimilarity& SetSimilarity(void);
615  /// Select the variant and set its data.
616  ///
617  /// @param value
618  /// Reference to the data.
619  void SetSimilarity(TSimilarity& value);
620 
621 
622  /// Check if variant Indirect is selected.
623  ///
624  /// Indirect type is defined as 'typedef COther_feature TIndirect'.
625  /// @return
626  /// - true, if the variant is selected.
627  /// - false, otherwise.
628  bool IsIndirect(void) const;
629 
630  /// Get the variant data.
631  ///
632  /// @return
633  /// Reference to the data.
634  const TIndirect& GetIndirect(void) const;
635 
636  /// Select the variant.
637  ///
638  /// @return
639  /// Reference to the variant data.
640  TIndirect& SetIndirect(void);
641  /// Select the variant and set its data.
642  ///
643  /// @param value
644  /// Reference to the data.
645  void SetIndirect(TIndirect& value);
646 
647 
648  private:
649  // copy constructor and assignment operator
652  // choice state
654  // helper methods
655  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
656 
657  static const char* const sm_SelectionNames[];
658  // data
659  NCBI_NS_NCBI::CSerialObject *m_object;
660  };
661  // types
663  typedef string TName;
664  typedef int TType;
667 
668  // member index
669  enum class E_memberIndex {
670  e__allMandatory = 0,
671  e_id,
672  e_name,
673  e_type,
674  e_property,
675  e_location
676  };
678 
679  // getters
680  // setters
681 
682  /// Check if a value has been assigned to Id data member.
683  ///
684  /// Data member Id is optional;
685  /// its type is defined as 'typedef CBiostruc_feature_id TId'
686  /// @return
687  /// - true, if a value has been assigned.
688  /// - false, otherwise.
689  bool IsSetId(void) const;
690 
691  /// Check if it is safe to call GetId method.
692  ///
693  /// @return
694  /// - true, if the data member is getatable.
695  /// - false, otherwise.
696  bool CanGetId(void) const;
697 
698  /// Reset Id data member.
699  void ResetId(void);
700 
701  /// Get the Id member data.
702  ///
703  /// @return
704  /// Reference to the member data.
705  const TId& GetId(void) const;
706 
707  /// Assign a value to Id data member.
708  ///
709  /// @param value
710  /// Value to assign
711  void SetId(const TId& value);
712 
713  /// Assign a value to Id data member.
714  ///
715  /// @return
716  /// Reference to the data value.
717  TId& SetId(void);
718 
719  /// Check if a value has been assigned to Name data member.
720  ///
721  /// Data member Name is optional;
722  /// its type is defined as 'typedef string TName'
723  /// @return
724  /// - true, if a value has been assigned.
725  /// - false, otherwise.
726  bool IsSetName(void) const;
727 
728  /// Check if it is safe to call GetName method.
729  ///
730  /// @return
731  /// - true, if the data member is getatable.
732  /// - false, otherwise.
733  bool CanGetName(void) const;
734 
735  /// Reset Name data member.
736  void ResetName(void);
737 
738  /// Get the Name member data.
739  ///
740  /// @return
741  /// Reference to the member data.
742  const TName& GetName(void) const;
743 
744  /// Assign a value to Name data member.
745  ///
746  /// @param value
747  /// Value to assign
748  void SetName(const TName& value);
749  void SetName(TName&& value);
750 
751  /// Assign a value to Name data member.
752  ///
753  /// @return
754  /// Reference to the data value.
755  TName& SetName(void);
756 
757  /// Check if a value has been assigned to Type data member.
758  ///
759  /// Data member Type is optional;
760  /// its type is defined as 'typedef int TType'
761  /// @return
762  /// - true, if a value has been assigned.
763  /// - false, otherwise.
764  bool IsSetType(void) const;
765 
766  /// Check if it is safe to call GetType method.
767  ///
768  /// @return
769  /// - true, if the data member is getatable.
770  /// - false, otherwise.
771  bool CanGetType(void) const;
772 
773  /// Reset Type data member.
774  void ResetType(void);
775 
776  /// Get the Type member data.
777  ///
778  /// @return
779  /// Copy of the member data.
780  TType GetType(void) const;
781 
782  /// Assign a value to Type data member.
783  ///
784  /// @param value
785  /// Value to assign
786  void SetType(TType value);
787 
788  /// Assign a value to Type data member.
789  ///
790  /// @return
791  /// Reference to the data value.
792  TType& SetType(void);
793 
794  /// Check if a value has been assigned to Property data member.
795  ///
796  /// Data member Property is optional;
797  /// its type is defined as 'typedef C_Property TProperty'
798  /// @return
799  /// - true, if a value has been assigned.
800  /// - false, otherwise.
801  bool IsSetProperty(void) const;
802 
803  /// Check if it is safe to call GetProperty method.
804  ///
805  /// @return
806  /// - true, if the data member is getatable.
807  /// - false, otherwise.
808  bool CanGetProperty(void) const;
809 
810  /// Reset Property data member.
811  void ResetProperty(void);
812 
813  /// Get the Property member data.
814  ///
815  /// @return
816  /// Reference to the member data.
817  const TProperty& GetProperty(void) const;
818 
819  /// Assign a value to Property data member.
820  ///
821  /// @param value
822  /// Reference to value.
823  void SetProperty(TProperty& value);
824 
825  /// Assign a value to Property data member.
826  ///
827  /// @return
828  /// Reference to the data value.
829  TProperty& SetProperty(void);
830 
831  /// Check if a value has been assigned to Location data member.
832  ///
833  /// Data member Location is optional;
834  /// its type is defined as 'typedef C_Location TLocation'
835  /// @return
836  /// - true, if a value has been assigned.
837  /// - false, otherwise.
838  bool IsSetLocation(void) const;
839 
840  /// Check if it is safe to call GetLocation method.
841  ///
842  /// @return
843  /// - true, if the data member is getatable.
844  /// - false, otherwise.
845  bool CanGetLocation(void) const;
846 
847  /// Reset Location data member.
848  void ResetLocation(void);
849 
850  /// Get the Location member data.
851  ///
852  /// @return
853  /// Reference to the member data.
854  const TLocation& GetLocation(void) const;
855 
856  /// Assign a value to Location data member.
857  ///
858  /// @param value
859  /// Reference to value.
860  void SetLocation(TLocation& value);
861 
862  /// Assign a value to Location data member.
863  ///
864  /// @return
865  /// Reference to the data value.
866  TLocation& SetLocation(void);
867 
868  /// Reset the whole object
869  virtual void Reset(void);
870 
871 
872 private:
873  // Prohibit copy constructor and assignment operator
876 
877  // data
878  Uint4 m_set_State[1];
880  string m_Name;
881  int m_Type;
884 };
885 
886 /* @} */
887 
888 
889 
890 
891 
892 ///////////////////////////////////////////////////////////
893 ///////////////////// inline methods //////////////////////
894 ///////////////////////////////////////////////////////////
895 inline
897 {
898  return m_choice;
899 }
900 
901 inline
903 {
904  if ( m_choice != index )
905  ThrowInvalidSelection(index);
906 }
907 
908 inline
909 void CBiostruc_feature_Base::C_Property::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
910 {
911  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
912  if ( m_choice != e_not_set )
913  ResetSelection();
914  DoSelect(index, pool);
915  }
916 }
917 
918 inline
920 {
921  Select(index, reset, 0);
922 }
923 
924 inline
926 {
927  return m_choice == e_Color;
928 }
929 
930 inline
932 {
933  return m_choice == e_Render;
934 }
935 
936 inline
938 {
939  CheckSelected(e_Render);
940  return m_Render;
941 }
942 
943 inline
945 {
946  Select(e_Render, NCBI_NS_NCBI::eDoNotResetVariant);
947  return m_Render;
948 }
949 
950 inline
952 {
953  Select(e_Render, NCBI_NS_NCBI::eDoNotResetVariant);
954  m_Render = value;
955 }
956 
957 inline
959 {
960  return m_choice == e_Transform;
961 }
962 
963 inline
965 {
966  return m_choice == e_Camera;
967 }
968 
969 inline
971 {
972  return m_choice == e_Script;
973 }
974 
975 inline
977 {
978  return m_choice == e_User;
979 }
980 
981 inline
983 {
984  return m_choice;
985 }
986 
987 inline
989 {
990  if ( m_choice != index )
991  ThrowInvalidSelection(index);
992 }
993 
994 inline
995 void CBiostruc_feature_Base::C_Location::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
996 {
997  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
998  if ( m_choice != e_not_set )
999  ResetSelection();
1000  DoSelect(index, pool);
1001  }
1002 }
1003 
1004 inline
1006 {
1007  Select(index, reset, 0);
1008 }
1009 
1010 inline
1012 {
1013  return m_choice == e_Subgraph;
1014 }
1015 
1016 inline
1018 {
1019  return m_choice == e_Region;
1020 }
1021 
1022 inline
1024 {
1025  return m_choice == e_Alignment;
1026 }
1027 
1028 inline
1030 {
1031  return m_choice == e_Interaction;
1032 }
1033 
1034 inline
1036 {
1037  return m_choice == e_Similarity;
1038 }
1039 
1040 inline
1042 {
1043  return m_choice == e_Indirect;
1044 }
1045 
1046 inline
1048 {
1049  return ((m_set_State[0] & 0x3) != 0);
1050 }
1051 
1052 inline
1054 {
1055  return IsSetId();
1056 }
1057 
1058 inline
1060 {
1062  m_set_State[0] &= ~0x3;
1063 }
1064 
1065 inline
1067 {
1068  if (!CanGetId()) {
1069  ThrowUnassigned(0);
1070  }
1071  return m_Id;
1072 }
1073 
1074 inline
1076 {
1077  m_Id = value;
1078  m_set_State[0] |= 0x3;
1079 }
1080 
1081 inline
1083 {
1084  m_set_State[0] |= 0x1;
1085  return m_Id;
1086 }
1087 
1088 inline
1090 {
1091  return ((m_set_State[0] & 0xc) != 0);
1092 }
1093 
1094 inline
1096 {
1097  return IsSetName();
1098 }
1099 
1100 inline
1102 {
1103  if (!CanGetName()) {
1104  ThrowUnassigned(1);
1105  }
1106  return m_Name;
1107 }
1108 
1109 inline
1111 {
1112  m_Name = value;
1113  m_set_State[0] |= 0xc;
1114 }
1115 
1116 inline
1118 {
1119  m_Name = std::forward<CBiostruc_feature_Base::TName>(value);
1120  m_set_State[0] |= 0xc;
1121 }
1122 
1123 inline
1125 {
1126 #ifdef _DEBUG
1127  if (!IsSetName()) {
1129  }
1130 #endif
1131  m_set_State[0] |= 0x4;
1132  return m_Name;
1133 }
1134 
1135 inline
1137 {
1138  return ((m_set_State[0] & 0x30) != 0);
1139 }
1140 
1141 inline
1143 {
1144  return IsSetType();
1145 }
1146 
1147 inline
1149 {
1150  m_Type = (EType)(0);
1151  m_set_State[0] &= ~0x30;
1152 }
1153 
1154 inline
1156 {
1157  if (!CanGetType()) {
1158  ThrowUnassigned(2);
1159  }
1160  return m_Type;
1161 }
1162 
1163 inline
1165 {
1166  m_Type = value;
1167  m_set_State[0] |= 0x30;
1168 }
1169 
1170 inline
1172 {
1173 #ifdef _DEBUG
1174  if (!IsSetType()) {
1175  memset(&m_Type,UnassignedByte(),sizeof(m_Type));
1176  }
1177 #endif
1178  m_set_State[0] |= 0x10;
1179  return m_Type;
1180 }
1181 
1182 inline
1184 {
1185  return m_Property.NotEmpty();
1186 }
1187 
1188 inline
1190 {
1191  return IsSetProperty();
1192 }
1193 
1194 inline
1196 {
1197  if (!CanGetProperty()) {
1198  ThrowUnassigned(3);
1199  }
1200  return (*m_Property);
1201 }
1202 
1203 inline
1205 {
1206  return m_Location.NotEmpty();
1207 }
1208 
1209 inline
1211 {
1212  return IsSetLocation();
1213 }
1214 
1215 inline
1217 {
1218  if (!CanGetLocation()) {
1219  ThrowUnassigned(4);
1220  }
1221  return (*m_Location);
1222 }
1223 
1224 ///////////////////////////////////////////////////////////
1225 ////////////////// end of inline methods //////////////////
1226 ///////////////////////////////////////////////////////////
1227 
1228 
1229 
1230 
1231 
1232 END_objects_SCOPE // namespace ncbi::objects::
1233 
1235 
1236 
1237 #endif // OBJECTS_MMDB3_BIOSTRUC_FEATURE_BASE_HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
An explicitly specified type in Biostruc-feature allows for efficient extraction and indexing of feat...
CBiostruc_feature_id –.
CBiostruc_script –.
CCamera –.
Definition: Camera.hpp:66
CChem_graph_alignment –.
CChem_graph_interaction –.
CChem_graph_pntrs –.
CColor_prop –.
Definition: Color_prop.hpp:66
COther_feature –.
CRef –.
Definition: ncbiobj.hpp:618
CRegion_pntrs –.
CRegion_similarity –.
Base class for all serializable objects.
Definition: serialbase.hpp:150
CTransform –.
Definition: Transform.hpp:66
CRgbaColor & GetColor(CSeqFeatData::ESubtype subtype)
static char UnassignedByte(void)
Definition: serialbase.hpp:181
void ThrowUnassigned(TMemberIndex index) const
EResetVariant
Definition: serialbase.hpp:76
#define ENUM_METHOD_NAME(EnumName)
Definition: serialbase.hpp:994
static string UnassignedString(void)
Definition: serialbase.hpp:175
@ eDoResetVariant
Definition: serialbase.hpp:77
@ eDoNotResetVariant
Definition: serialbase.hpp:78
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,...
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_MMDB3_EXPORT
Definition: ncbi_export.h:640
bool IsSetProperty(void) const
Check if a value has been assigned to Property data member.
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
TId & SetId(void)
Assign a value to Id data member.
bool IsTransform(void) const
Check if variant Transform is selected.
CBiostruc_feature_Base & operator=(const CBiostruc_feature_Base &)
E_Choice Which(void) const
Which variant is currently selected.
TName & SetName(void)
Assign a value to Name data member.
CBiostruc_feature_id m_Id
bool IsColor(void) const
Check if variant Color is selected.
bool IsUser(void) const
Check if variant User is selected.
TRender & SetRender(void)
Select the variant.
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsSetLocation(void) const
Check if a value has been assigned to Location data member.
const TProperty & GetProperty(void) const
Get the Property member data.
bool IsSubgraph(void) const
Check if variant Subgraph is selected.
const TLocation & GetLocation(void) const
Get the Location member data.
bool CanGetId(void) const
Check if it is safe to call GetId method.
C_Property & operator=(const C_Property &)
bool IsSimilarity(void) const
Check if variant Similarity is selected.
TRender GetRender(void) const
Get the variant data.
bool CanGetName(void) const
Check if it is safe to call GetName method.
CRef< TProperty > m_Property
C_Location & operator=(const C_Location &)
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool CanGetType(void) const
Check if it is safe to call GetType method.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
NCBI_NS_NCBI::CSerialObject * m_object
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
bool IsAlignment(void) const
Check if variant Alignment is selected.
NCBI_NS_NCBI::CSerialObject * m_object
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
void ResetId(void)
Reset Id data member.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
Tparent::CMemberIndex< E_memberIndex, 6 > TmemberIndex
const TName & GetName(void) const
Get the Name member data.
CRef< TLocation > m_Location
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
bool IsIndirect(void) const
Check if variant Indirect is selected.
CBiostruc_feature_Base(const CBiostruc_feature_Base &)
TType & SetType(void)
Assign a value to Type data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
bool IsRegion(void) const
Check if variant Region is selected.
TType GetType(void) const
Get the Type member data.
bool IsInteraction(void) const
Check if variant Interaction is selected.
bool IsRender(void) const
Check if variant Render is selected.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
bool IsScript(void) const
Check if variant Script is selected.
bool CanGetProperty(void) const
Check if it is safe to call GetProperty method.
bool IsSetName(void) const
Check if a value has been assigned to Name data member.
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
CBiostruc_feature_id TId
bool IsCamera(void) const
Check if variant Camera is selected.
void ResetType(void)
Reset Type data member.
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Sep 20 14:58:09 2024 by modify_doxy.py rev. 669887