41 #ifndef OBJECTS_SEQFEAT_GENETIC_CODE_BASE_HPP
42 #define OBJECTS_SEQFEAT_GENETIC_CODE_BASE_HPP
54 #ifndef BEGIN_objects_SCOPE
55 # define BEGIN_objects_SCOPE BEGIN_SCOPE(objects)
56 # define END_objects_SCOPE END_SCOPE(objects)
135 void ResetSelection(
void);
141 E_Choice Which(
void)
const;
147 void CheckSelected(E_Choice index)
const;
153 NCBI_NORETURN
void ThrowInvalidSelection(E_Choice index)
const;
161 static string SelectionName(E_Choice index);
198 bool IsName(
void)
const;
204 const TName& GetName(
void)
const;
210 TName& SetName(
void);
225 bool IsId(
void)
const;
252 bool IsNcbieaa(
void)
const;
258 const TNcbieaa& GetNcbieaa(
void)
const;
279 bool IsNcbi8aa(
void)
const;
285 const TNcbi8aa& GetNcbi8aa(
void)
const;
300 bool IsNcbistdaa(
void)
const;
321 bool IsSncbieaa(
void)
const;
327 const TSncbieaa& GetSncbieaa(
void)
const;
348 bool IsSncbi8aa(
void)
const;
354 const TSncbi8aa& GetSncbi8aa(
void)
const;
369 bool IsSncbistdaa(
void)
const;
393 static const char*
const sm_SelectionNames[];
401 NCBI_NS_NCBI::CUnionBuffer<NCBI_NS_STD::string>
m_string;
418 bool IsSet(
void)
const;
425 bool CanGet(
void)
const;
443 operator const Tdata& (void)
const;
445 operator Tdata& (void);
477 if ( m_choice != index )
478 ThrowInvalidSelection(index);
487 DoSelect(index, pool);
494 Select(index, reset, 0);
500 return m_choice == e_Name;
506 CheckSelected(e_Name);
520 return m_choice == e_Id;
547 return m_choice == e_Ncbieaa;
553 CheckSelected(e_Ncbieaa);
567 return m_choice == e_Ncbi8aa;
573 CheckSelected(e_Ncbi8aa);
587 return m_choice == e_Ncbistdaa;
593 CheckSelected(e_Ncbistdaa);
607 return m_choice == e_Sncbieaa;
613 CheckSelected(e_Sncbieaa);
627 return m_choice == e_Sncbi8aa;
633 CheckSelected(e_Sncbi8aa);
647 return m_choice == e_Sncbistdaa;
653 CheckSelected(e_Sncbistdaa);
654 return *m_Sncbistdaa;
661 return *m_Sncbistdaa;
each code is 64 cells long, in the order where T=0,C=1,A=2,G=3, TTT=0, TTC=1, TCA=4,...
Base class for all serializable objects.
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.
#define NCBI_SEQFEAT_EXPORT
void Select(E_Choice index, EResetVariant reset=eDoResetVariant)
Select the requested variant if needed.
list< CRef< C_E > > m_data
bool IsSncbistdaa(void) const
Check if variant Sncbistdaa is selected.
TName & SetName(void)
Select the variant.
TId GetId(void) const
Get the variant data.
TNcbi8aa & SetNcbi8aa(void)
Select the variant.
TId & SetId(void)
Select the variant.
Tdata & Set(void)
Assign a value to data member.
DECLARE_INTERNAL_TYPE_INFO()
CGenetic_code_Base & operator=(const CGenetic_code_Base &)
const TNcbieaa & GetNcbieaa(void) const
Get the variant data.
const TSncbieaa & GetSncbieaa(void) const
Get the variant data.
bool IsNcbi8aa(void) const
Check if variant Ncbi8aa is selected.
const TNcbistdaa & GetNcbistdaa(void) const
Get the variant data.
bool CanGet(void) const
Check if it is safe to call Get method.
vector< char > TNcbistdaa
bool IsSncbi8aa(void) const
Check if variant Sncbi8aa is selected.
bool IsSncbieaa(void) const
Check if variant Sncbieaa is selected.
E_Choice Which(void) const
Which variant is currently selected.
CGenetic_code_Base(const CGenetic_code_Base &)
const TSncbistdaa & GetSncbistdaa(void) const
Get the variant data.
void CheckSelected(E_Choice index) const
Verify selection, throw exception if it differs from the expected.
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< TSncbi8aa > m_Sncbi8aa
list< CRef< C_E > > Tdata
DECLARE_INTERNAL_TYPE_INFO()
const Tdata & Get(void) const
Get the member data.
NCBI_NS_NCBI::CUnionBuffer< NCBI_NS_STD::string > m_string
const TName & GetName(void) const
Get the variant data.
bool IsNcbieaa(void) const
Check if variant Ncbieaa is selected.
bool IsSet(void) const
Check if a value has been assigned to data member.
TSncbieaa & SetSncbieaa(void)
Select the variant.
NCBI_NS_NCBI::CUnionBuffer< TNcbi8aa > m_Ncbi8aa
NCBI_NS_NCBI::CUnionBuffer< TSncbistdaa > m_Sncbistdaa
TSncbistdaa & SetSncbistdaa(void)
Select the variant.
const TSncbi8aa & GetSncbi8aa(void) const
Get the variant data.
TNcbieaa & SetNcbieaa(void)
Select the variant.
bool IsName(void) const
Check if variant Name is selected.
C_E & operator=(const C_E &)
vector< char > TSncbistdaa
bool IsId(void) const
Check if variant Id is selected.
TSncbi8aa & SetSncbi8aa(void)
Select the variant.
TNcbistdaa & SetNcbistdaa(void)
Select the variant.
bool IsNcbistdaa(void) const
Check if variant Ncbistdaa is selected.
E_ChoiceStopper
Maximum+1 value of the choice variant enumerator.
NCBI_NS_NCBI::CUnionBuffer< TNcbistdaa > m_Ncbistdaa
void * m_dummy_pointer_for_alignment
const TNcbi8aa & GetNcbi8aa(void) const
Get the variant data.
@ e_Sncbieaa
start, indexed to IUPAC extended
@ e_Ncbi8aa
indexed to NCBI8aa
@ e_Sncbi8aa
start, indexed to NCBI8aa
@ e_Ncbistdaa
indexed to NCBIstdaa
@ e_Ncbieaa
indexed to IUPAC extended
const TYPE & Get(const CNamedParameterList *param)
const GenericPointer< typename T::ValueType > T2 value