41 #ifndef espell__OBJTOOLS_EUTILS_ESPELL_SPELLEDQUERY_BASE_HPP
42 #define espell__OBJTOOLS_EUTILS_ESPELL_SPELLEDQUERY_BASE_HPP
51 #ifndef BEGIN_espell_SCOPE
52 # define BEGIN_espell_SCOPE BEGIN_SCOPE(espell)
53 # define END_espell_SCOPE END_SCOPE(espell)
73 typedef NCBI_NS_NCBI::CSerialObject
Tparent;
91 typedef NCBI_NS_NCBI::CSerialObject
Tparent;
117 void ResetSelection(
void);
123 E_Choice Which(
void)
const;
129 void CheckSelected(E_Choice index)
const;
135 NCBI_NORETURN
void ThrowInvalidSelection(E_Choice index)
const;
156 void Select(E_Choice index,
158 NCBI_NS_NCBI::CObjectMemoryPool* pool);
174 bool IsReplaced(
void)
const;
180 const TReplaced& GetReplaced(
void)
const;
201 bool IsOriginal(
void)
const;
207 const TOriginal& GetOriginal(
void)
const;
229 void DoSelect(
E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool = 0);
231 static const char*
const sm_SelectionNames[];
234 NCBI_NS_NCBI::CUnionBuffer<NCBI_NS_STD::string>
m_string;
239 typedef NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_Data > >
Tdata;
251 bool IsSet(
void)
const;
258 bool CanGet(
void)
const;
276 operator const Tdata& (void)
const;
278 operator Tdata& (void);
289 NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_Data > >
m_data;
310 if ( m_choice != index )
311 ThrowInvalidSelection(index);
320 DoSelect(index, pool);
327 Select(index, reset, 0);
333 return m_choice == e_Replaced;
339 CheckSelected(e_Replaced);
353 return m_choice == e_Original;
359 CheckSelected(e_Original);
#define BEGIN_espell_SCOPE
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define NCBI_EUTILS_EXPORT
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
CSpelledQuery_Base(const CSpelledQuery_Base &)
bool CanGet(void) const
Check if it is safe to call Get method.
const TOriginal & GetOriginal(void) const
Get the variant data.
bool IsSet(void) const
Check if a value has been assigned to data member.
void * m_dummy_pointer_for_alignment
C_Data & operator=(const C_Data &)
const TReplaced & GetReplaced(void) const
Get the variant data.
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_Data > > Tdata
TReplaced & SetReplaced(void)
Select the variant.
CSpelledQuery_Base & operator=(const CSpelledQuery_Base &)
NCBI_NS_NCBI::CSerialObject Tparent
void Select(E_Choice index, NCBI_NS_NCBI::EResetVariant reset=NCBI_NS_NCBI::eDoResetVariant)
Select the requested variant if needed.
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
E_Choice Which(void) const
Which variant is currently selected.
NCBI_NS_STD::string TOriginal
NCBI_NS_STD::list< NCBI_NS_NCBI::CRef< C_Data > > m_data
bool IsOriginal(void) const
Check if variant Original is selected.
const Tdata & Get(void) const
Get the member data.
TOriginal & SetOriginal(void)
Select the variant.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
DECLARE_INTERNAL_TYPE_INFO()
Tdata & Set(void)
Assign a value to data member.
NCBI_NS_STD::string TReplaced
DECLARE_INTERNAL_TYPE_INFO()
bool IsReplaced(void) const
Check if variant Replaced is selected.
NCBI_NS_NCBI::CSerialObject Tparent
const TYPE & Get(const CNamedParameterList *param)
const GenericPointer< typename T::ValueType > T2 value