41 #ifndef OBJECTS_GBPROJ_PROJECTITEM_BASE_HPP
42 #define OBJECTS_GBPROJ_PROJECTITEM_BASE_HPP
56 #ifndef BEGIN_objects_SCOPE
57 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
58 # define END_objects_SCOPE END_SCOPE(objects)
142 void ResetSelection(
void);
148 E_Choice Which(
void)
const;
154 void CheckSelected(E_Choice index)
const;
160 NCBI_NORETURN
void ThrowInvalidSelection(E_Choice index)
const;
168 static string SelectionName(E_Choice index);
207 bool IsId(
void)
const;
233 bool IsEntry(
void)
const;
239 const TEntry& GetEntry(
void)
const;
259 bool IsAnnot(
void)
const;
265 const TAnnot& GetAnnot(
void)
const;
285 bool IsSubmit(
void)
const;
291 const TSubmit& GetSubmit(
void)
const;
311 bool IsSeq_align(
void)
const;
337 bool IsSeq_align_set(
void)
const;
363 bool IsObsolete_plugin(
void)
const;
389 bool IsOther(
void)
const;
395 const TOther& GetOther(
void)
const;
415 bool IsPmid(
void)
const;
421 const TPmid& GetPmid(
void)
const;
427 TPmid& SetPmid(
void);
436 bool IsTaxid(
void)
const;
442 const TTaxid& GetTaxid(
void)
const;
460 static const char*
const sm_SelectionNames[];
463 NCBI_NS_NCBI::CUnionBuffer<TPmid>
m_Pmid;
471 typedef list< CRef< CAnnotdesc > >
TDescr;
499 bool IsSetId(
void)
const;
506 bool CanGetId(
void)
const;
537 bool IsSetLabel(
void)
const;
544 bool CanGetLabel(
void)
const;
547 void ResetLabel(
void);
576 bool IsSetDescr(
void)
const;
583 bool CanGetDescr(
void)
const;
586 void ResetDescr(
void);
592 const TDescr& GetDescr(
void)
const;
607 bool IsSetItem(
void)
const;
614 bool CanGetItem(
void)
const;
617 void ResetItem(
void);
623 const TItem& GetItem(
void)
const;
635 TItem& SetItem(
void);
645 bool IsSetData_plugin(
void)
const;
652 bool CanGetData_plugin(
void)
const;
655 void ResetData_plugin(
void);
684 bool IsSetDisabled(
void)
const;
691 bool CanGetDisabled(
void)
const;
694 void ResetDisabled(
void);
715 virtual void Reset(
void);
751 if ( m_choice != index )
752 ThrowInvalidSelection(index);
761 DoSelect(index, pool);
768 Select(index, reset, 0);
774 return m_choice == e_Id;
780 return m_choice == e_Entry;
786 return m_choice == e_Annot;
792 return m_choice == e_Submit;
798 return m_choice == e_Seq_align;
804 return m_choice == e_Seq_align_set;
810 return m_choice == e_Obsolete_plugin;
816 return m_choice == e_Other;
822 return m_choice == e_Pmid;
828 CheckSelected(e_Pmid);
842 return m_choice == e_Taxid;
848 CheckSelected(e_Taxid);
937 m_Label = std::forward<CProjectItem_Base::TLabel>(
value);
Base class for all serializable objects.
Defines to provide correct exporting from DLLs in Windows.
#define NCBI_GBPROJ_EXPORT
static char UnassignedByte(void)
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
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
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
DECLARE_INTERNAL_TYPE_INFO()
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.
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 &)
DECLARE_INTERNAL_TYPE_INFO()
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TTaxid & GetTaxid(void) const
Get the variant data.
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...
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_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
const GenericPointer< typename T::ValueType > T2 value