41 #ifndef OBJECTS_VARREP_VARIANT_BASE_HPP
42 #define OBJECTS_VARREP_VARIANT_BASE_HPP
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
101 virtual void Reset(
void);
User-defined methods of the data storage class.
Base class for all serializable objects.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const TSimple & GetSimple(void) const
Get the variant data.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
static const char *const sm_SelectionNames[]
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
CVariant_Base & operator=(const CVariant_Base &)
virtual void Reset(void)
Reset the whole object.
TSpecial & SetSpecial(void)
Select the variant.
TSpecial GetSpecial(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.
virtual ~CVariant_Base(void)
E_Choice Which(void) const
Which variant is currently selected.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
NCBI_NS_NCBI::CSerialObject * m_object
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
TSimple & SetSimple(void)
Select the variant.
CVariant_Base(const CVariant_Base &)
bool IsSimple(void) const
Check if variant Simple is selected.
bool IsSpecial(void) const
Check if variant Special is selected.
DECLARE_INTERNAL_TYPE_INFO()
@ e_MaxChoice
== e_Special+1
@ e_not_set
No variant selected.
const GenericPointer< typename T::ValueType > T2 value