NCBI C++ ToolKit
ProjectItem_.hpp
Go to the documentation of this file.

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