41 #ifndef OBJECTS_PUB_PUB_SET_BASE_HPP
42 #define OBJECTS_PUB_PUB_SET_BASE_HPP
52 #ifndef BEGIN_objects_SCOPE
53 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
54 # define END_objects_SCOPE END_SCOPE(objects)
112 virtual void Reset(
void);
115 virtual void ResetSelection(
void);
121 E_Choice Which(
void)
const;
127 void CheckSelected(E_Choice index)
const;
133 NCBI_NORETURN
void ThrowInvalidSelection(E_Choice index)
const;
141 static string SelectionName(E_Choice index);
159 typedef list< CRef< CPub > >
TPub;
163 typedef list< CRef< CCit_book > >
TBook;
164 typedef list< CRef< CCit_proc > >
TProc;
177 bool IsPub(
void)
const;
183 const TPub& GetPub(
void)
const;
198 bool IsMedline(
void)
const;
204 const TMedline& GetMedline(
void)
const;
219 bool IsArticle(
void)
const;
225 const TArticle& GetArticle(
void)
const;
246 const TJournal& GetJournal(
void)
const;
261 bool IsBook(
void)
const;
267 const TBook& GetBook(
void)
const;
273 TBook& SetBook(
void);
282 bool IsProc(
void)
const;
288 const TProc& GetProc(
void)
const;
294 TProc& SetProc(
void);
303 bool IsPatent(
void)
const;
309 const TPatent& GetPatent(
void)
const;
327 static const char*
const sm_SelectionNames[];
330 NCBI_NS_NCBI::CUnionBuffer<TPub>
m_Pub;
334 NCBI_NS_NCBI::CUnionBuffer<TBook>
m_Book;
335 NCBI_NS_NCBI::CUnionBuffer<TProc>
m_Proc;
Base class for all serializable objects.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
NCBI_NS_NCBI::CUnionBuffer< TJournal > m_Journal
NCBI_NS_NCBI::CUnionBuffer< TPub > m_Pub
NCBI_NS_NCBI::CUnionBuffer< TBook > m_Book
bool IsArticle(void) const
Check if variant Article is selected.
TMedline & SetMedline(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< TPatent > m_Patent
CPub_set_Base(const CPub_set_Base &)
void ThrowInvalidSelection(E_Choice index) const
Throw 'InvalidSelection' exception.
E_Choice Which(void) const
Which variant is currently selected.
DECLARE_INTERNAL_TYPE_INFO()
TProc & SetProc(void)
Select the variant.
const TArticle & GetArticle(void) const
Get the variant data.
const TBook & GetBook(void) const
Get the variant data.
bool IsPatent(void) const
Check if variant Patent is selected.
NCBI_NS_NCBI::CUnionBuffer< TArticle > m_Article
const TMedline & GetMedline(void) const
Get the variant data.
TBook & SetBook(void)
Select the variant.
list< CRef< CCit_jour > > TJournal
list< CRef< CCit_proc > > TProc
bool IsBook(void) const
Check if variant Book is selected.
TArticle & SetArticle(void)
Select the variant.
const TPub & GetPub(void) const
Get the variant data.
CPub_set_Base & operator=(const CPub_set_Base &)
bool IsProc(void) const
Check if variant Proc is selected.
NCBI_NS_NCBI::CUnionBuffer< TPatent > m_Patent
void * m_dummy_pointer_for_alignment
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
void DoSelect(E_Choice index, CObjectMemoryPool *pool=0)
NCBI_NS_NCBI::CUnionBuffer< TPub > m_Pub
const TJournal & GetJournal(void) const
Get the variant data.
TJournal & SetJournal(void)
Select the variant.
list< CRef< CPub > > TPub
NCBI_NS_NCBI::CUnionBuffer< TJournal > m_Journal
list< CRef< CCit_pat > > TPatent
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
bool IsPub(void) const
Check if variant Pub is selected.
bool IsMedline(void) const
Check if variant Medline is selected.
NCBI_NS_NCBI::CUnionBuffer< TMedline > m_Medline
TPub & SetPub(void)
Select the variant.
TPatent & SetPatent(void)
Select the variant.
const TPatent & GetPatent(void) const
Get the variant data.
NCBI_NS_NCBI::CUnionBuffer< TProc > m_Proc
NCBI_NS_NCBI::CUnionBuffer< TArticle > m_Article
bool IsJournal(void) const
Check if variant Journal is selected.
NCBI_NS_NCBI::CUnionBuffer< TProc > m_Proc
list< CRef< CCit_art > > TArticle
NCBI_NS_NCBI::CUnionBuffer< TBook > m_Book
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
list< CRef< CMedline_entry > > TMedline
void Select(E_Choice index, EResetVariant reset, CObjectMemoryPool *pool)
Select the requested variant if needed, allocating CObject variants from memory pool.
NCBI_NS_NCBI::CUnionBuffer< TMedline > m_Medline
list< CRef< CCit_book > > TBook
const TProc & GetProc(void) const
Get the variant data.
virtual void ResetSelection(void)
Reset the selection (set it to e_not_set).
@ e_not_set
No variant selected.
@ e_Proc
proceedings of a meeting
static bool IsJournal(const CPub &pub)