NCBI C++ ToolKit
ProjectItem_.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 ProjectItem_.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/gbproj/gbproj.asn">gbproj.asn</a>
34 /// and additional tune-up parameters:
35 /// <a href="/IEB/ToolBox/CPP_DOC/lxr/source/src/objects/gbproj/gbproj.def">gbproj.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_GBPROJ_PROJECTITEM_BASE_HPP
42 #define OBJECTS_GBPROJ_PROJECTITEM_BASE_HPP
43 
44 // extra headers
46 
47 // standard includes
48 #include <serial/serialbase.hpp>
49 
50 // generated includes
51 #include <list>
52 #include <string>
53 
55 
56 #ifndef BEGIN_objects_SCOPE
57 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
58 # define END_objects_SCOPE END_SCOPE(objects)
59 #endif
60 BEGIN_objects_SCOPE // namespace ncbi::objects::
61 
62 
63 // forward declarations
65 class CAnnotdesc;
66 class CDummyObsoleteType;
67 class CSeq_align;
68 class CSeq_align_set;
69 class CSeq_annot;
70 class CSeq_entry;
71 class CSeq_id;
72 class CSeq_submit;
73 
74 
75 // generated classes
76 
77 
78 /** @addtogroup dataspec_NCBI_GBProject
79  *
80  * @{
81  */
82 
83 /////////////////////////////////////////////////////////////////////////////
84 ///
85 /// CProjectItem_Base --
86 ///
87 
89 {
91 public:
92  // constructor
93  CProjectItem_Base(void);
94  // destructor
95  virtual ~CProjectItem_Base(void);
96 
97  // type info
99 
100  /////////////////////////////////////////////////////////////////////////////
101  /// the item we represent
102  ///
103  /// C_Item --
104  ///
105 
107  {
109  public:
110  // constructor
111  C_Item(void);
112  // destructor
113  ~C_Item(void);
114 
115  // type info
117 
118 
119  /// Choice variants.
120  enum E_Choice {
121  e_not_set = 0, ///< No variant selected
122  e_Id, ///< for projects that simply import a far-pointer
123  e_Entry, ///< for projects that contain something else
124  e_Annot, ///< annotation only
125  e_Submit, ///< for submission
126  e_Seq_align, ///< seq-align and seq-align-set as registered items
128  e_Obsolete_plugin, ///< plugin message This is deprecated. DO NOT USE THIS FIELD. The original spec is: plugin PluginMessage. It is intended to be removed, but a complete removal will cause order shift for the rest of fields in this choice, and cause deserialization failure for existing ASN files since this filed is in the middle of the spec.
129  e_Other, ///< arbitrary object (use with care!)
130  e_Pmid, ///< PubMed ID
131  e_Taxid ///< Taxonomy ID
132  };
133  /// Maximum+1 value of the choice variant enumerator.
135  e_MaxChoice = 11 ///< == e_Taxid+1
136  };
137 
138  /// Reset the whole object
139  void Reset(void);
140 
141  /// Reset the selection (set it to e_not_set).
142  void ResetSelection(void);
143 
144  /// Which variant is currently selected.
145  ///
146  /// @return
147  /// Choice state enumerator.
148  E_Choice Which(void) const;
149 
150  /// Verify selection, throw exception if it differs from the expected.
151  ///
152  /// @param index
153  /// Expected selection.
154  void CheckSelected(E_Choice index) const;
155 
156  /// Throw 'InvalidSelection' exception.
157  ///
158  /// @param index
159  /// Expected selection.
160  NCBI_NORETURN void ThrowInvalidSelection(E_Choice index) const;
161 
162  /// Retrieve selection name (for diagnostic purposes).
163  ///
164  /// @param index
165  /// One of possible selection states.
166  /// @return
167  /// Name string.
168  static string SelectionName(E_Choice index);
169 
170  /// Select the requested variant if needed.
171  ///
172  /// @param index
173  /// New selection state.
174  /// @param reset
175  /// Flag that defines the resetting of the variant data. The data will
176  /// be reset if either the current selection differs from the new one,
177  /// or the flag is set to eDoResetVariant.
179  /// Select the requested variant if needed,
180  /// allocating CObject variants from memory pool.
181  void Select(E_Choice index,
182  EResetVariant reset,
183  CObjectMemoryPool* pool);
184 
185  // types
186  typedef CSeq_id TId;
194  typedef list< int > TPmid;
195  typedef list< int > TTaxid;
196 
197  // getters
198  // setters
199 
200 
201  /// Check if variant Id is selected.
202  ///
203  /// Id type is defined as 'typedef CSeq_id TId'.
204  /// @return
205  /// - true, if the variant is selected.
206  /// - false, otherwise.
207  bool IsId(void) const;
208 
209  /// Get the variant data.
210  ///
211  /// @return
212  /// Reference to the data.
213  const TId& GetId(void) const;
214 
215  /// Select the variant.
216  ///
217  /// @return
218  /// Reference to the variant data.
219  TId& SetId(void);
220  /// Select the variant and set its data.
221  ///
222  /// @param value
223  /// Reference to the data.
224  void SetId(TId& value);
225 
226 
227  /// Check if variant Entry is selected.
228  ///
229  /// Entry type is defined as 'typedef CSeq_entry TEntry'.
230  /// @return
231  /// - true, if the variant is selected.
232  /// - false, otherwise.
233  bool IsEntry(void) const;
234 
235  /// Get the variant data.
236  ///
237  /// @return
238  /// Reference to the data.
239  const TEntry& GetEntry(void) const;
240 
241  /// Select the variant.
242  ///
243  /// @return
244  /// Reference to the variant data.
245  TEntry& SetEntry(void);
246  /// Select the variant and set its data.
247  ///
248  /// @param value
249  /// Reference to the data.
250  void SetEntry(TEntry& value);
251 
252 
253  /// Check if variant Annot is selected.
254  ///
255  /// Annot type is defined as 'typedef CSeq_annot TAnnot'.
256  /// @return
257  /// - true, if the variant is selected.
258  /// - false, otherwise.
259  bool IsAnnot(void) const;
260 
261  /// Get the variant data.
262  ///
263  /// @return
264  /// Reference to the data.
265  const TAnnot& GetAnnot(void) const;
266 
267  /// Select the variant.
268  ///
269  /// @return
270  /// Reference to the variant data.
271  TAnnot& SetAnnot(void);
272  /// Select the variant and set its data.
273  ///
274  /// @param value
275  /// Reference to the data.
276  void SetAnnot(TAnnot& value);
277 
278 
279  /// Check if variant Submit is selected.
280  ///
281  /// Submit type is defined as 'typedef CSeq_submit TSubmit'.
282  /// @return
283  /// - true, if the variant is selected.
284  /// - false, otherwise.
285  bool IsSubmit(void) const;
286 
287  /// Get the variant data.
288  ///
289  /// @return
290  /// Reference to the data.
291  const TSubmit& GetSubmit(void) const;
292 
293  /// Select the variant.
294  ///
295  /// @return
296  /// Reference to the variant data.
297  TSubmit& SetSubmit(void);
298  /// Select the variant and set its data.
299  ///
300  /// @param value
301  /// Reference to the data.
302  void SetSubmit(TSubmit& value);
303 
304 
305  /// Check if variant Seq_align is selected.
306  ///
307  /// Seq_align type is defined as 'typedef CSeq_align TSeq_align'.
308  /// @return
309  /// - true, if the variant is selected.
310  /// - false, otherwise.
311  bool IsSeq_align(void) const;
312 
313  /// Get the variant data.
314  ///
315  /// @return
316  /// Reference to the data.
317  const TSeq_align& GetSeq_align(void) const;
318 
319  /// Select the variant.
320  ///
321  /// @return
322  /// Reference to the variant data.
323  TSeq_align& SetSeq_align(void);
324  /// Select the variant and set its data.
325  ///
326  /// @param value
327  /// Reference to the data.
328  void SetSeq_align(TSeq_align& value);
329 
330 
331  /// Check if variant Seq_align_set is selected.
332  ///
333  /// Seq_align_set type is defined as 'typedef CSeq_align_set TSeq_align_set'.
334  /// @return
335  /// - true, if the variant is selected.
336  /// - false, otherwise.
337  bool IsSeq_align_set(void) const;
338 
339  /// Get the variant data.
340  ///
341  /// @return
342  /// Reference to the data.
343  const TSeq_align_set& GetSeq_align_set(void) const;
344 
345  /// Select the variant.
346  ///
347  /// @return
348  /// Reference to the variant data.
349  TSeq_align_set& SetSeq_align_set(void);
350  /// Select the variant and set its data.
351  ///
352  /// @param value
353  /// Reference to the data.
354  void SetSeq_align_set(TSeq_align_set& value);
355 
356 
357  /// Check if variant Obsolete_plugin is selected.
358  ///
359  /// Obsolete_plugin type is defined as 'typedef CDummyObsoleteType TObsolete_plugin'.
360  /// @return
361  /// - true, if the variant is selected.
362  /// - false, otherwise.
363  bool IsObsolete_plugin(void) const;
364 
365  /// Get the variant data.
366  ///
367  /// @return
368  /// Reference to the data.
369  const TObsolete_plugin& GetObsolete_plugin(void) const;
370 
371  /// Select the variant.
372  ///
373  /// @return
374  /// Reference to the variant data.
375  TObsolete_plugin& SetObsolete_plugin(void);
376  /// Select the variant and set its data.
377  ///
378  /// @param value
379  /// Reference to the data.
380  void SetObsolete_plugin(TObsolete_plugin& value);
381 
382 
383  /// Check if variant Other is selected.
384  ///
385  /// Other type is defined as 'typedef CAbstractProjectItem TOther'.
386  /// @return
387  /// - true, if the variant is selected.
388  /// - false, otherwise.
389  bool IsOther(void) const;
390 
391  /// Get the variant data.
392  ///
393  /// @return
394  /// Reference to the data.
395  const TOther& GetOther(void) const;
396 
397  /// Select the variant.
398  ///
399  /// @return
400  /// Reference to the variant data.
401  TOther& SetOther(void);
402  /// Select the variant and set its data.
403  ///
404  /// @param value
405  /// Reference to the data.
406  void SetOther(TOther& value);
407 
408 
409  /// Check if variant Pmid is selected.
410  ///
411  /// Pmid type is defined as 'typedef list< int > TPmid'.
412  /// @return
413  /// - true, if the variant is selected.
414  /// - false, otherwise.
415  bool IsPmid(void) const;
416 
417  /// Get the variant data.
418  ///
419  /// @return
420  /// Reference to the data.
421  const TPmid& GetPmid(void) const;
422 
423  /// Select the variant.
424  ///
425  /// @return
426  /// Reference to the variant data.
427  TPmid& SetPmid(void);
428 
429 
430  /// Check if variant Taxid is selected.
431  ///
432  /// Taxid type is defined as 'typedef list< int > TTaxid'.
433  /// @return
434  /// - true, if the variant is selected.
435  /// - false, otherwise.
436  bool IsTaxid(void) const;
437 
438  /// Get the variant data.
439  ///
440  /// @return
441  /// Reference to the data.
442  const TTaxid& GetTaxid(void) const;
443 
444  /// Select the variant.
445  ///
446  /// @return
447  /// Reference to the variant data.
448  TTaxid& SetTaxid(void);
449 
450 
451  private:
452  // copy constructor and assignment operator
453  C_Item(const C_Item& );
455  // choice state
457  // helper methods
458  void DoSelect(E_Choice index, CObjectMemoryPool* pool = 0);
459 
460  static const char* const sm_SelectionNames[];
461  // data
462  union {
463  NCBI_NS_NCBI::CUnionBuffer<TPmid> m_Pmid;
464  NCBI_NS_NCBI::CUnionBuffer<TTaxid> m_Taxid;
465  NCBI_NS_NCBI::CSerialObject *m_object;
466  };
467  };
468  // types
469  typedef int TId;
470  typedef string TLabel;
471  typedef list< CRef< CAnnotdesc > > TDescr;
472  typedef C_Item TItem;
473  typedef string TData_plugin;
474  typedef bool TDisabled;
475 
476  // member index
477  enum class E_memberIndex {
478  e__allMandatory = 0,
479  e_id,
480  e_label,
481  e_descr,
482  e_item,
483  e_data_plugin,
484  e_disabled
485  };
487 
488  // getters
489  // setters
490 
491  /// serial number - must be unique in a project (GBProject)
492  /// Check if a value has been assigned to Id data member.
493  ///
494  /// Data member Id is mandatory;
495  /// its type is defined as 'typedef int TId'
496  /// @return
497  /// - true, if a value has been assigned.
498  /// - false, otherwise.
499  bool IsSetId(void) const;
500 
501  /// Check if it is safe to call GetId method.
502  ///
503  /// @return
504  /// - true, if the data member is getatable.
505  /// - false, otherwise.
506  bool CanGetId(void) const;
507 
508  /// Reset Id data member.
509  void ResetId(void);
510 
511  /// Get the Id member data.
512  ///
513  /// @return
514  /// Copy of the member data.
515  TId GetId(void) const;
516 
517  /// Assign a value to Id data member.
518  ///
519  /// @param value
520  /// Value to assign
521  void SetId(TId value);
522 
523  /// Assign a value to Id data member.
524  ///
525  /// @return
526  /// Reference to the data value.
527  TId& SetId(void);
528 
529  /// user-defined label
530  /// Check if a value has been assigned to Label data member.
531  ///
532  /// Data member Label is optional;
533  /// its type is defined as 'typedef string TLabel'
534  /// @return
535  /// - true, if a value has been assigned.
536  /// - false, otherwise.
537  bool IsSetLabel(void) const;
538 
539  /// Check if it is safe to call GetLabel method.
540  ///
541  /// @return
542  /// - true, if the data member is getatable.
543  /// - false, otherwise.
544  bool CanGetLabel(void) const;
545 
546  /// Reset Label data member.
547  void ResetLabel(void);
548 
549  /// Get the Label member data.
550  ///
551  /// @return
552  /// Reference to the member data.
553  const TLabel& GetLabel(void) const;
554 
555  /// Assign a value to Label data member.
556  ///
557  /// @param value
558  /// Value to assign
559  void SetLabel(const TLabel& value);
560  void SetLabel(TLabel&& value);
561 
562  /// Assign a value to Label data member.
563  ///
564  /// @return
565  /// Reference to the data value.
566  TLabel& SetLabel(void);
567 
568  /// user-defined descriptors
569  /// Check if a value has been assigned to Descr data member.
570  ///
571  /// Data member Descr is optional;
572  /// its type is defined as 'typedef list< CRef< CAnnotdesc > > TDescr'
573  /// @return
574  /// - true, if a value has been assigned.
575  /// - false, otherwise.
576  bool IsSetDescr(void) const;
577 
578  /// Check if it is safe to call GetDescr method.
579  ///
580  /// @return
581  /// - true, if the data member is getatable.
582  /// - false, otherwise.
583  bool CanGetDescr(void) const;
584 
585  /// Reset Descr data member.
586  void ResetDescr(void);
587 
588  /// Get the Descr member data.
589  ///
590  /// @return
591  /// Reference to the member data.
592  const TDescr& GetDescr(void) const;
593 
594  /// Assign a value to Descr data member.
595  ///
596  /// @return
597  /// Reference to the data value.
598  TDescr& SetDescr(void);
599 
600  /// Check if a value has been assigned to Item data member.
601  ///
602  /// Data member Item is mandatory;
603  /// its type is defined as 'typedef C_Item TItem'
604  /// @return
605  /// - true, if a value has been assigned.
606  /// - false, otherwise.
607  bool IsSetItem(void) const;
608 
609  /// Check if it is safe to call GetItem method.
610  ///
611  /// @return
612  /// - true, if the data member is getatable.
613  /// - false, otherwise.
614  bool CanGetItem(void) const;
615 
616  /// Reset Item data member.
617  void ResetItem(void);
618 
619  /// Get the Item member data.
620  ///
621  /// @return
622  /// Reference to the member data.
623  const TItem& GetItem(void) const;
624 
625  /// Assign a value to Item data member.
626  ///
627  /// @param value
628  /// Reference to value.
629  void SetItem(TItem& value);
630 
631  /// Assign a value to Item data member.
632  ///
633  /// @return
634  /// Reference to the data value.
635  TItem& SetItem(void);
636 
637  ///name of the plugin that can handle External Data for the project
638  /// Check if a value has been assigned to Data_plugin data member.
639  ///
640  /// Data member Data_plugin is optional;
641  /// its type is defined as 'typedef string TData_plugin'
642  /// @return
643  /// - true, if a value has been assigned.
644  /// - false, otherwise.
645  bool IsSetData_plugin(void) const;
646 
647  /// Check if it is safe to call GetData_plugin method.
648  ///
649  /// @return
650  /// - true, if the data member is getatable.
651  /// - false, otherwise.
652  bool CanGetData_plugin(void) const;
653 
654  /// Reset Data_plugin data member.
655  void ResetData_plugin(void);
656 
657  /// Get the Data_plugin member data.
658  ///
659  /// @return
660  /// Reference to the member data.
661  const TData_plugin& GetData_plugin(void) const;
662 
663  /// Assign a value to Data_plugin data member.
664  ///
665  /// @param value
666  /// Value to assign
667  void SetData_plugin(const TData_plugin& value);
668  void SetData_plugin(TData_plugin&& value);
669 
670  /// Assign a value to Data_plugin data member.
671  ///
672  /// @return
673  /// Reference to the data value.
674  TData_plugin& SetData_plugin(void);
675 
676  /// "folder open" state
677  /// Check if a value has been assigned to Disabled data member.
678  ///
679  /// Data member Disabled is optional;
680  /// its type is defined as 'typedef bool TDisabled'
681  /// @return
682  /// - true, if a value has been assigned.
683  /// - false, otherwise.
684  bool IsSetDisabled(void) const;
685 
686  /// Check if it is safe to call GetDisabled method.
687  ///
688  /// @return
689  /// - true, if the data member is getatable.
690  /// - false, otherwise.
691  bool CanGetDisabled(void) const;
692 
693  /// Reset Disabled data member.
694  void ResetDisabled(void);
695 
696  /// Get the Disabled member data.
697  ///
698  /// @return
699  /// Copy of the member data.
700  TDisabled GetDisabled(void) const;
701 
702  /// Assign a value to Disabled data member.
703  ///
704  /// @param value
705  /// Value to assign
706  void SetDisabled(TDisabled value);
707 
708  /// Assign a value to Disabled data member.
709  ///
710  /// @return
711  /// Reference to the data value.
712  TDisabled& SetDisabled(void);
713 
714  /// Reset the whole object
715  virtual void Reset(void);
716 
717 
718 private:
719  // Prohibit copy constructor and assignment operator
722 
723  // data
724  Uint4 m_set_State[1];
725  int m_Id;
726  string m_Label;
727  list< CRef< CAnnotdesc > > m_Descr;
731 };
732 
733 /* @} */
734 
735 
736 
737 
738 
739 ///////////////////////////////////////////////////////////
740 ///////////////////// inline methods //////////////////////
741 ///////////////////////////////////////////////////////////
742 inline
744 {
745  return m_choice;
746 }
747 
748 inline
750 {
751  if ( m_choice != index )
752  ThrowInvalidSelection(index);
753 }
754 
755 inline
756 void CProjectItem_Base::C_Item::Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset, NCBI_NS_NCBI::CObjectMemoryPool* pool)
757 {
758  if ( reset == NCBI_NS_NCBI::eDoResetVariant || m_choice != index ) {
759  if ( m_choice != e_not_set )
760  ResetSelection();
761  DoSelect(index, pool);
762  }
763 }
764 
765 inline
767 {
768  Select(index, reset, 0);
769 }
770 
771 inline
773 {
774  return m_choice == e_Id;
775 }
776 
777 inline
779 {
780  return m_choice == e_Entry;
781 }
782 
783 inline
785 {
786  return m_choice == e_Annot;
787 }
788 
789 inline
791 {
792  return m_choice == e_Submit;
793 }
794 
795 inline
797 {
798  return m_choice == e_Seq_align;
799 }
800 
801 inline
803 {
804  return m_choice == e_Seq_align_set;
805 }
806 
807 inline
809 {
810  return m_choice == e_Obsolete_plugin;
811 }
812 
813 inline
815 {
816  return m_choice == e_Other;
817 }
818 
819 inline
821 {
822  return m_choice == e_Pmid;
823 }
824 
825 inline
827 {
828  CheckSelected(e_Pmid);
829  return *m_Pmid;
830 }
831 
832 inline
834 {
835  Select(e_Pmid, NCBI_NS_NCBI::eDoNotResetVariant);
836  return *m_Pmid;
837 }
838 
839 inline
841 {
842  return m_choice == e_Taxid;
843 }
844 
845 inline
847 {
848  CheckSelected(e_Taxid);
849  return *m_Taxid;
850 }
851 
852 inline
854 {
855  Select(e_Taxid, NCBI_NS_NCBI::eDoNotResetVariant);
856  return *m_Taxid;
857 }
858 
859 inline
861 {
862  return ((m_set_State[0] & 0x3) != 0);
863 }
864 
865 inline
867 {
868  return IsSetId();
869 }
870 
871 inline
873 {
874  m_Id = 0;
875  m_set_State[0] &= ~0x3;
876 }
877 
878 inline
880 {
881  if (!CanGetId()) {
882  ThrowUnassigned(0);
883  }
884  return m_Id;
885 }
886 
887 inline
889 {
890  m_Id = value;
891  m_set_State[0] |= 0x3;
892 }
893 
894 inline
896 {
897 #ifdef _DEBUG
898  if (!IsSetId()) {
899  memset(&m_Id,UnassignedByte(),sizeof(m_Id));
900  }
901 #endif
902  m_set_State[0] |= 0x1;
903  return m_Id;
904 }
905 
906 inline
908 {
909  return ((m_set_State[0] & 0xc) != 0);
910 }
911 
912 inline
914 {
915  return IsSetLabel();
916 }
917 
918 inline
920 {
921  if (!CanGetLabel()) {
922  ThrowUnassigned(1);
923  }
924  return m_Label;
925 }
926 
927 inline
929 {
930  m_Label = value;
931  m_set_State[0] |= 0xc;
932 }
933 
934 inline
936 {
937  m_Label = std::forward<CProjectItem_Base::TLabel>(value);
938  m_set_State[0] |= 0xc;
939 }
940 
941 inline
943 {
944 #ifdef _DEBUG
945  if (!IsSetLabel()) {
947  }
948 #endif
949  m_set_State[0] |= 0x4;
950  return m_Label;
951 }
952 
953 inline
955 {
956  return ((m_set_State[0] & 0x30) != 0);
957 }
958 
959 inline
961 {
962  return true;
963 }
964 
965 inline
967 {
968  return m_Descr;
969 }
970 
971 inline
973 {
974  m_set_State[0] |= 0x10;
975  return m_Descr;
976 }
977 
978 inline
980 {
981  return m_Item.NotEmpty();
982 }
983 
984 inline
986 {
987  return true;
988 }
989 
990 inline
992 {
993  if ( !m_Item ) {
994  const_cast<CProjectItem_Base*>(this)->ResetItem();
995  }
996  return (*m_Item);
997 }
998 
999 inline
1001 {
1002  if ( !m_Item ) {
1003  ResetItem();
1004  }
1005  return (*m_Item);
1006 }
1007 
1008 inline
1010 {
1011  return ((m_set_State[0] & 0x300) != 0);
1012 }
1013 
1014 inline
1016 {
1017  return IsSetData_plugin();
1018 }
1019 
1020 inline
1022 {
1023  if (!CanGetData_plugin()) {
1024  ThrowUnassigned(4);
1025  }
1026  return m_Data_plugin;
1027 }
1028 
1029 inline
1031 {
1032  m_Data_plugin = value;
1033  m_set_State[0] |= 0x300;
1034 }
1035 
1036 inline
1038 {
1039  m_Data_plugin = std::forward<CProjectItem_Base::TData_plugin>(value);
1040  m_set_State[0] |= 0x300;
1041 }
1042 
1043 inline
1045 {
1046 #ifdef _DEBUG
1047  if (!IsSetData_plugin()) {
1049  }
1050 #endif
1051  m_set_State[0] |= 0x100;
1052  return m_Data_plugin;
1053 }
1054 
1055 inline
1057 {
1058  return ((m_set_State[0] & 0xc00) != 0);
1059 }
1060 
1061 inline
1063 {
1064  return IsSetDisabled();
1065 }
1066 
1067 inline
1069 {
1070  m_Disabled = 0;
1071  m_set_State[0] &= ~0xc00;
1072 }
1073 
1074 inline
1076 {
1077  if (!CanGetDisabled()) {
1078  ThrowUnassigned(5);
1079  }
1080  return m_Disabled;
1081 }
1082 
1083 inline
1085 {
1086  m_Disabled = value;
1087  m_set_State[0] |= 0xc00;
1088 }
1089 
1090 inline
1092 {
1093 #ifdef _DEBUG
1094  if (!IsSetDisabled()) {
1095  memset(&m_Disabled,UnassignedByte(),sizeof(m_Disabled));
1096  }
1097 #endif
1098  m_set_State[0] |= 0x400;
1099  return m_Disabled;
1100 }
1101 
1102 ///////////////////////////////////////////////////////////
1103 ////////////////// end of inline methods //////////////////
1104 ///////////////////////////////////////////////////////////
1105 
1106 
1107 
1108 
1109 
1110 END_objects_SCOPE // namespace ncbi::objects::
1111 
1113 
1114 
1115 #endif // OBJECTS_GBPROJ_PROJECTITEM_BASE_HPP
CAnnotdesc –.
Definition: Annotdesc.hpp:66
CDummyObsoleteType –.
the item we represent
CProjectItem_Base –.
CRef –.
Definition: ncbiobj.hpp:618
Definition: Seq_entry.hpp:56
Base class for all serializable objects.
Definition: serialbase.hpp:150
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_GBPROJ_EXPORT
Definition: gbproj_export.h:69
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
string GetLabel(const CSeq_id &id)
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
bool IsObsolete_plugin(void) const
Check if variant Obsolete_plugin is selected.
CSeq_align_set TSeq_align_set
bool IsSetItem(void) const
Check if a value has been assigned to Item data member.
bool IsSetLabel(void) const
user-defined label Check if a value has been assigned to Label data member.
CProjectItem_Base & operator=(const CProjectItem_Base &)
TDescr & SetDescr(void)
Assign a value to Descr data member.
bool CanGetItem(void) const
Check if it is safe to call GetItem method.
bool IsTaxid(void) const
Check if variant Taxid is selected.
bool IsSubmit(void) const
Check if variant Submit is selected.
TId GetId(void) const
Get the Id member data.
TDisabled & SetDisabled(void)
Assign a value to Disabled data member.
bool IsSetDisabled(void) const
"folder open" state Check if a value has been assigned to Disabled data member.
bool IsId(void) const
Check if variant Id is selected.
TLabel & SetLabel(void)
Assign a value to Label data member.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
void ResetItem(void)
Reset Item data member.
E_Choice Which(void) const
Which variant is currently selected.
void ResetDisabled(void)
Reset Disabled data member.
TDisabled GetDisabled(void) const
Get the Disabled member data.
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
const TLabel & GetLabel(void) const
Get the Label member data.
TData_plugin & SetData_plugin(void)
Assign a value to Data_plugin data member.
C_Item(const C_Item &)
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
bool IsPmid(void) const
Check if variant Pmid is selected.
bool IsAnnot(void) const
Check if variant Annot is selected.
const TItem & GetItem(void) const
Get the Item member data.
bool CanGetId(void) const
Check if it is safe to call GetId method.
bool IsSeq_align_set(void) const
Check if variant Seq_align_set is selected.
bool IsSetDescr(void) const
user-defined descriptors Check if a value has been assigned to Descr data member.
const TDescr & GetDescr(void) const
Get the Descr member data.
Tparent::CMemberIndex< E_memberIndex, 7 > TmemberIndex
bool IsEntry(void) const
Check if variant Entry is selected.
bool CanGetData_plugin(void) const
Check if it is safe to call GetData_plugin method.
C_Item & operator=(const C_Item &)
TId & SetId(void)
Assign a value to Id data member.
const TData_plugin & GetData_plugin(void) const
Get the Data_plugin member data.
list< CRef< CAnnotdesc > > m_Descr
bool IsSetId(void) const
serial number - must be unique in a project (GBProject) Check if a value has been assigned to Id data...
NCBI_NS_NCBI::CUnionBuffer< TPmid > m_Pmid
bool CanGetLabel(void) const
Check if it is safe to call GetLabel method.
CAbstractProjectItem TOther
bool IsOther(void) const
Check if variant Other is selected.
CDummyObsoleteType TObsolete_plugin
bool CanGetDisabled(void) const
Check if it is safe to call GetDisabled method.
TItem & SetItem(void)
Assign a value to Item data member.
CProjectItem_Base(const CProjectItem_Base &)
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TTaxid & GetTaxid(void) const
Get the variant data.
CRef< TItem > m_Item
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
void ResetId(void)
Reset Id data member.
const TPmid & GetPmid(void) const
Get the variant data.
NCBI_NS_NCBI::CSerialObject * m_object
TPmid & SetPmid(void)
Select the variant.
bool IsSeq_align(void) const
Check if variant Seq_align is selected.
TTaxid & SetTaxid(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< TTaxid > m_Taxid
bool IsSetData_plugin(void) const
name of the plugin that can handle External Data for the project Check if a value has been assigned t...
CSerialObject Tparent
list< CRef< CAnnotdesc > > TDescr
@ e_Obsolete_plugin
plugin message This is deprecated. DO NOT USE THIS FIELD. The original spec is: plugin PluginMessage....
@ e_Other
arbitrary object (use with care!)
@ e_Annot
annotation only
@ e_Id
for projects that simply import a far-pointer
@ e_Seq_align
seq-align and seq-align-set as registered items
@ e_Entry
for projects that contain something else
@ e_not_set
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Tue Apr 23 07:40:25 2024 by modify_doxy.py rev. 669887