41 #ifndef OBJECTS_TAXON3_T3STATUSFLAGS_BASE_HPP
42 #define OBJECTS_TAXON3_T3STATUSFLAGS_BASE_HPP
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
118 void ResetSelection(
void);
124 E_Choice Which(
void)
const;
130 void CheckSelected(E_Choice index)
const;
136 NCBI_NORETURN
void ThrowInvalidSelection(E_Choice index)
const;
144 static string SelectionName(E_Choice index);
176 bool IsBool(
void)
const;
182 TBool GetBool(
void)
const;
188 TBool& SetBool(
void);
203 bool IsInt(
void)
const;
209 TInt GetInt(
void)
const;
230 bool IsStr(
void)
const;
236 const TStr& GetStr(
void)
const;
260 static const char*
const sm_SelectionNames[];
265 NCBI_NS_NCBI::CUnionBuffer<NCBI_NS_STD::string>
m_string;
291 bool IsSetProperty(
void)
const;
298 bool CanGetProperty(
void)
const;
301 void ResetProperty(
void);
307 const TProperty& GetProperty(
void)
const;
329 bool IsSetValue(
void)
const;
336 bool CanGetValue(
void)
const;
339 void ResetValue(
void);
345 const TValue& GetValue(
void)
const;
360 virtual void Reset(
void);
392 if ( m_choice != index )
393 ThrowInvalidSelection(index);
402 DoSelect(index, pool);
409 Select(index, reset, 0);
415 return m_choice == e_Bool;
421 CheckSelected(e_Bool);
442 return m_choice == e_Int;
448 CheckSelected(e_Int);
469 return m_choice == e_Str;
475 CheckSelected(e_Str);
Base class for all serializable objects.
void ThrowUnassigned(TMemberIndex index) const
static string UnassignedString(void)
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.
#define NCBI_TAXON3_EXPORT
bool IsBool(void) const
Check if variant Bool is selected.
TBool & SetBool(void)
Select the variant.
TValue & SetValue(void)
Assign a value to Value data member.
Tparent::CMemberIndex< E_memberIndex, 3 > TmemberIndex
DECLARE_INTERNAL_TYPE_INFO()
TBool GetBool(void) const
Get the variant data.
CT3StatusFlags_Base & operator=(const CT3StatusFlags_Base &)
TInt & SetInt(void)
Select the variant.
bool CanGetProperty(void) const
Check if it is safe to call GetProperty method.
bool IsStr(void) const
Check if variant Str is selected.
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
const TStr & GetStr(void) const
Get the variant data.
const TProperty & GetProperty(void) const
Get the Property member data.
E_Choice Which(void) const
Which variant is currently selected.
bool CanGetValue(void) const
Check if it is safe to call GetValue method.
bool IsInt(void) const
Check if variant Int is selected.
const TValue & GetValue(void) const
Get the Value member data.
TProperty & SetProperty(void)
Assign a value to Property data member.
void * m_dummy_pointer_for_alignment
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
void ResetValue(void)
Reset Value data member.
CT3StatusFlags_Base(const CT3StatusFlags_Base &)
TStr & SetStr(void)
Select the variant.
DECLARE_INTERNAL_TYPE_INFO()
C_Value & operator=(const C_Value &)
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
bool IsSetProperty(void) const
Check if a value has been assigned to Property data member.
TInt GetInt(void) const
Get the variant data.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
bool IsSetValue(void) const
Check if a value has been assigned to Value data member.
const GenericPointer< typename T::ValueType > T2 value