/* $Id$
 * ===========================================================================
 *
 *                            PUBLIC DOMAIN NOTICE
 *               National Center for Biotechnology Information
 *
 *  This software/database is a "United States Government Work" under the
 *  terms of the United States Copyright Act.  It was written as part of
 *  the author's official duties as a United States Government employee and
 *  thus cannot be copyrighted.  This software/database is freely available
 *  to the public for use. The National Library of Medicine and the U.S.
 *  Government have not placed any restriction on its use or reproduction.
 *
 *  Although all reasonable efforts have been taken to ensure the accuracy
 *  and reliability of the software and data, the NLM and the U.S.
 *  Government do not and cannot warrant the performance or results that
 *  may be obtained by using this software or data. The NLM and the U.S.
 *  Government disclaim all warranties, express or implied, including
 *  warranties of performance, merchantability or fitness for any particular
 *  purpose.
 *
 *  Please cite the author in any work or product based on this material.
 *
 * ===========================================================================
 *
 * File Description:
 *   This code was generated by application DATATOOL
 *   using the following specifications:
 *   'seqfeat.asn'.
 *
 * ATTENTION:
 *   Don't edit or commit this file into CVS as this file will
 *   be overridden (by DATATOOL) without warning!
 * ===========================================================================
 */

// standard includes
#include <ncbi_pch.hpp>
#include <serial/serialimpl.hpp>

// generated includes
#include <objects/seqfeat/Variation_ref.hpp>
#include <objects/general/Dbtag.hpp>
#include <objects/general/Object_id.hpp>
#include <objects/general/User_object.hpp>
#include <objects/pub/Pub.hpp>
#include <objects/seqfeat/Ext_loc.hpp>
#include <objects/seqfeat/Phenotype.hpp>
#include <objects/seqfeat/Population_data.hpp>
#include <objects/seqfeat/SubSource.hpp>
#include <objects/seqfeat/VariantProperties.hpp>
#include <objects/seqfeat/Variation_inst.hpp>
#include <objects/seqloc/Seq_loc.hpp>
BEGIN_NCBI_SCOPE

BEGIN_objects_SCOPE // namespace ncbi::objects::


// generated classes

BEGIN_NAMED_ENUM_IN_INFO("", CVariation_ref_Base::, EMethod_E, true)
{
    SET_ENUM_INTERNAL_NAME("Variation-ref.method", "E");
    SET_ENUM_MODULE("NCBI-Variation");
    ADD_ENUM_VALUE("unknown", eMethod_E_unknown);
    ADD_ENUM_VALUE("bac-acgh", eMethod_E_bac_acgh);
    ADD_ENUM_VALUE("computational", eMethod_E_computational);
    ADD_ENUM_VALUE("curated", eMethod_E_curated);
    ADD_ENUM_VALUE("digital-array", eMethod_E_digital_array);
    ADD_ENUM_VALUE("expression-array", eMethod_E_expression_array);
    ADD_ENUM_VALUE("fish", eMethod_E_fish);
    ADD_ENUM_VALUE("flanking-sequence", eMethod_E_flanking_sequence);
    ADD_ENUM_VALUE("maph", eMethod_E_maph);
    ADD_ENUM_VALUE("mcd-analysis", eMethod_E_mcd_analysis);
    ADD_ENUM_VALUE("mlpa", eMethod_E_mlpa);
    ADD_ENUM_VALUE("oea-assembly", eMethod_E_oea_assembly);
    ADD_ENUM_VALUE("oligo-acgh", eMethod_E_oligo_acgh);
    ADD_ENUM_VALUE("paired-end", eMethod_E_paired_end);
    ADD_ENUM_VALUE("pcr", eMethod_E_pcr);
    ADD_ENUM_VALUE("qpcr", eMethod_E_qpcr);
    ADD_ENUM_VALUE("read-depth", eMethod_E_read_depth);
    ADD_ENUM_VALUE("roma", eMethod_E_roma);
    ADD_ENUM_VALUE("rt-pcr", eMethod_E_rt_pcr);
    ADD_ENUM_VALUE("sage", eMethod_E_sage);
    ADD_ENUM_VALUE("sequence-alignment", eMethod_E_sequence_alignment);
    ADD_ENUM_VALUE("sequencing", eMethod_E_sequencing);
    ADD_ENUM_VALUE("snp-array", eMethod_E_snp_array);
    ADD_ENUM_VALUE("snp-genoytyping", eMethod_E_snp_genoytyping);
    ADD_ENUM_VALUE("southern", eMethod_E_southern);
    ADD_ENUM_VALUE("western", eMethod_E_western);
    ADD_ENUM_VALUE("optical-mapping", eMethod_E_optical_mapping);
    ADD_ENUM_VALUE("other", eMethod_E_other);
}
END_ENUM_INFO

BEGIN_NAMED_ENUM_IN_INFO("", CVariation_ref_Base::, EAllele_origin, true)
{
    SET_ENUM_INTERNAL_NAME("Variation-ref", "allele-origin");
    SET_ENUM_MODULE("NCBI-Variation");
    ADD_ENUM_VALUE("unknown", eAllele_origin_unknown);
    ADD_ENUM_VALUE("germline", eAllele_origin_germline);
    ADD_ENUM_VALUE("somatic", eAllele_origin_somatic);
    ADD_ENUM_VALUE("inherited", eAllele_origin_inherited);
    ADD_ENUM_VALUE("paternal", eAllele_origin_paternal);
    ADD_ENUM_VALUE("maternal", eAllele_origin_maternal);
    ADD_ENUM_VALUE("de-novo", eAllele_origin_de_novo);
    ADD_ENUM_VALUE("biparental", eAllele_origin_biparental);
    ADD_ENUM_VALUE("uniparental", eAllele_origin_uniparental);
    ADD_ENUM_VALUE("not-tested", eAllele_origin_not_tested);
    ADD_ENUM_VALUE("tested-inconclusive", eAllele_origin_tested_inconclusive);
    ADD_ENUM_VALUE("other", eAllele_origin_other);
}
END_ENUM_INFO

BEGIN_NAMED_ENUM_IN_INFO("", CVariation_ref_Base::, EAllele_state, true)
{
    SET_ENUM_INTERNAL_NAME("Variation-ref", "allele-state");
    SET_ENUM_MODULE("NCBI-Variation");
    ADD_ENUM_VALUE("unknown", eAllele_state_unknown);
    ADD_ENUM_VALUE("homozygous", eAllele_state_homozygous);
    ADD_ENUM_VALUE("heterozygous", eAllele_state_heterozygous);
    ADD_ENUM_VALUE("hemizygous", eAllele_state_hemizygous);
    ADD_ENUM_VALUE("nullizygous", eAllele_state_nullizygous);
    ADD_ENUM_VALUE("other", eAllele_state_other);
}
END_ENUM_INFO

BEGIN_NAMED_ENUM_IN_INFO("", CVariation_ref_Base::C_Data::C_Set::, EData_set_type, true)
{
    SET_ENUM_INTERNAL_NAME("Variation-ref.data.set", "type");
    SET_ENUM_MODULE("NCBI-Variation");
    ADD_ENUM_VALUE("unknown", eData_set_type_unknown);
    ADD_ENUM_VALUE("compound", eData_set_type_compound);
    ADD_ENUM_VALUE("products", eData_set_type_products);
    ADD_ENUM_VALUE("haplotype", eData_set_type_haplotype);
    ADD_ENUM_VALUE("genotype", eData_set_type_genotype);
    ADD_ENUM_VALUE("mosaic", eData_set_type_mosaic);
    ADD_ENUM_VALUE("individual", eData_set_type_individual);
    ADD_ENUM_VALUE("population", eData_set_type_population);
    ADD_ENUM_VALUE("alleles", eData_set_type_alleles);
    ADD_ENUM_VALUE("package", eData_set_type_package);
    ADD_ENUM_VALUE("other", eData_set_type_other);
}
END_ENUM_INFO

void CVariation_ref_Base::C_Data::C_Set::ResetVariations(void)
{
    m_Variations.clear();
    m_set_State[0] &= ~0xc;
}

void CVariation_ref_Base::C_Data::C_Set::ResetName(void)
{
    m_Name.erase();
    m_set_State[0] &= ~0x30;
}

void CVariation_ref_Base::C_Data::C_Set::Reset(void)
{
    ResetType();
    ResetVariations();
    ResetName();
}

BEGIN_NAMED_CLASS_INFO("", CVariation_ref_Base::C_Data::C_Set)
{
    SET_INTERNAL_NAME("Variation-ref.data", "set");
    SET_CLASS_MODULE("NCBI-Variation");
    ADD_NAMED_ENUM_MEMBER("type", m_Type, EData_set_type)->SetSetFlag(MEMBER_PTR(m_set_State[0]));
    ADD_NAMED_MEMBER("variations", m_Variations, STL_list_set, (STL_CRef, (CLASS, (CVariation_ref))))->SetSetFlag(MEMBER_PTR(m_set_State[0]));
    ADD_NAMED_STD_MEMBER("name", m_Name)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    info->RandomOrder();
    info->CodeVersion(21600);
}
END_CLASS_INFO

// constructor
CVariation_ref_Base::C_Data::C_Set::C_Set(void)
    : m_Type((EData_set_type)(0))
{
    memset(m_set_State,0,sizeof(m_set_State));
}

// destructor
CVariation_ref_Base::C_Data::C_Set::~C_Set(void)
{
}


void CVariation_ref_Base::C_Data::Reset(void)
{
    if ( m_choice != e_not_set )
        ResetSelection();
}

void CVariation_ref_Base::C_Data::ResetSelection(void)
{
    switch ( m_choice ) {
    case e_Note:
        m_string.Destruct();
        break;
    case e_Instance:
    case e_Set:
        m_object->RemoveReference();
        break;
    default:
        break;
    }
    m_choice = e_not_set;
}

void CVariation_ref_Base::C_Data::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
{
    switch ( index ) {
    case e_Instance:
        (m_object = new(pool) ncbi::objects::CVariation_inst())->AddReference();
        break;
    case e_Set:
        (m_object = new(pool) C_Set())->AddReference();
        break;
    case e_Note:
        m_string.Construct();
        break;
    default:
        break;
    }
    m_choice = index;
}

const char* const CVariation_ref_Base::C_Data::sm_SelectionNames[] = {
    "not set",
    "unknown",
    "note",
    "uniparental-disomy",
    "instance",
    "set",
    "complex"
};

NCBI_NS_STD::string CVariation_ref_Base::C_Data::SelectionName(E_Choice index)
{
    return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
}

void CVariation_ref_Base::C_Data::ThrowInvalidSelection(E_Choice index) const
{
    throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
}

void CVariation_ref_Base::C_Data::SetNote(const CVariation_ref_Base::C_Data::TNote& value)
{
    Select(e_Note, NCBI_NS_NCBI::eDoNotResetVariant);
    *m_string = value;
}

const CVariation_ref_Base::C_Data::TInstance& CVariation_ref_Base::C_Data::GetInstance(void) const
{
    CheckSelected(e_Instance);
    return *static_cast<const TInstance*>(m_object);
}

CVariation_ref_Base::C_Data::TInstance& CVariation_ref_Base::C_Data::SetInstance(void)
{
    Select(e_Instance, NCBI_NS_NCBI::eDoNotResetVariant);
    return *static_cast<TInstance*>(m_object);
}

void CVariation_ref_Base::C_Data::SetInstance(CVariation_ref_Base::C_Data::TInstance& value)
{
    TInstance* ptr = &value;
    if ( m_choice != e_Instance || m_object != ptr ) {
        ResetSelection();
        (m_object = ptr)->AddReference();
        m_choice = e_Instance;
    }
}

const CVariation_ref_Base::C_Data::TSet& CVariation_ref_Base::C_Data::GetSet(void) const
{
    CheckSelected(e_Set);
    return *static_cast<const TSet*>(m_object);
}

CVariation_ref_Base::C_Data::TSet& CVariation_ref_Base::C_Data::SetSet(void)
{
    Select(e_Set, NCBI_NS_NCBI::eDoNotResetVariant);
    return *static_cast<TSet*>(m_object);
}

void CVariation_ref_Base::C_Data::SetSet(CVariation_ref_Base::C_Data::TSet& value)
{
    TSet* ptr = &value;
    if ( m_choice != e_Set || m_object != ptr ) {
        ResetSelection();
        (m_object = ptr)->AddReference();
        m_choice = e_Set;
    }
}

// helper methods

// type info
BEGIN_NAMED_CHOICE_INFO("", CVariation_ref_Base::C_Data)
{
    SET_INTERNAL_NAME("Variation-ref", "data");
    SET_CHOICE_MODULE("NCBI-Variation");
    ADD_NAMED_NULL_CHOICE_VARIANT("unknown", null, ());
    ADD_NAMED_BUF_CHOICE_VARIANT("note", m_string, STD, (string));
    ADD_NAMED_NULL_CHOICE_VARIANT("uniparental-disomy", null, ());
    ADD_NAMED_REF_CHOICE_VARIANT("instance", m_object, CVariation_inst);
    ADD_NAMED_REF_CHOICE_VARIANT("set", m_object, C_Set);
    ADD_NAMED_NULL_CHOICE_VARIANT("complex", null, ());
    info->CodeVersion(21600);
}
END_CHOICE_INFO

// constructor
CVariation_ref_Base::C_Data::C_Data(void)
    : m_choice(e_not_set)
{
}

// destructor
CVariation_ref_Base::C_Data::~C_Data(void)
{
    Reset();
}


void CVariation_ref_Base::C_E_Consequence::C_Frameshift::Reset(void)
{
    ResetPhase();
    ResetX_length();
}

BEGIN_NAMED_CLASS_INFO("", CVariation_ref_Base::C_E_Consequence::C_Frameshift)
{
    SET_INTERNAL_NAME("Variation-ref.consequence.E", "frameshift");
    SET_CLASS_MODULE("NCBI-Variation");
    ADD_NAMED_STD_MEMBER("phase", m_Phase)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_STD_MEMBER("x-length", m_X_length)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    info->RandomOrder();
    info->CodeVersion(21600);
}
END_CLASS_INFO

// constructor
CVariation_ref_Base::C_E_Consequence::C_Frameshift::C_Frameshift(void)
    : m_Phase(0), m_X_length(0)
{
    memset(m_set_State,0,sizeof(m_set_State));
}

// destructor
CVariation_ref_Base::C_E_Consequence::C_Frameshift::~C_Frameshift(void)
{
}


void CVariation_ref_Base::C_E_Consequence::C_Loss_of_heterozygosity::ResetReference(void)
{
    m_Reference.erase();
    m_set_State[0] &= ~0x3;
}

void CVariation_ref_Base::C_E_Consequence::C_Loss_of_heterozygosity::ResetTest(void)
{
    m_Test.erase();
    m_set_State[0] &= ~0xc;
}

void CVariation_ref_Base::C_E_Consequence::C_Loss_of_heterozygosity::Reset(void)
{
    ResetReference();
    ResetTest();
}

BEGIN_NAMED_CLASS_INFO("", CVariation_ref_Base::C_E_Consequence::C_Loss_of_heterozygosity)
{
    SET_INTERNAL_NAME("Variation-ref.consequence.E", "loss-of-heterozygosity");
    SET_CLASS_MODULE("NCBI-Variation");
    ADD_NAMED_STD_MEMBER("reference", m_Reference)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_STD_MEMBER("test", m_Test)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    info->RandomOrder();
    info->CodeVersion(21600);
}
END_CLASS_INFO

// constructor
CVariation_ref_Base::C_E_Consequence::C_Loss_of_heterozygosity::C_Loss_of_heterozygosity(void)
{
    memset(m_set_State,0,sizeof(m_set_State));
}

// destructor
CVariation_ref_Base::C_E_Consequence::C_Loss_of_heterozygosity::~C_Loss_of_heterozygosity(void)
{
}


void CVariation_ref_Base::C_E_Consequence::Reset(void)
{
    if ( m_choice != e_not_set )
        ResetSelection();
}

void CVariation_ref_Base::C_E_Consequence::ResetSelection(void)
{
    switch ( m_choice ) {
    case e_Note:
        m_string.Destruct();
        break;
    case e_Variation:
    case e_Frameshift:
    case e_Loss_of_heterozygosity:
        m_object->RemoveReference();
        break;
    default:
        break;
    }
    m_choice = e_not_set;
}

void CVariation_ref_Base::C_E_Consequence::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool)
{
    switch ( index ) {
    case e_Variation:
        (m_object = new(pool) ncbi::objects::CVariation_ref())->AddReference();
        break;
    case e_Frameshift:
        (m_object = new(pool) C_Frameshift())->AddReference();
        break;
    case e_Loss_of_heterozygosity:
        (m_object = new(pool) C_Loss_of_heterozygosity())->AddReference();
        break;
    case e_Note:
        m_string.Construct();
        break;
    default:
        break;
    }
    m_choice = index;
}

const char* const CVariation_ref_Base::C_E_Consequence::sm_SelectionNames[] = {
    "not set",
    "unknown",
    "splicing",
    "note",
    "variation",
    "frameshift",
    "loss-of-heterozygosity"
};

NCBI_NS_STD::string CVariation_ref_Base::C_E_Consequence::SelectionName(E_Choice index)
{
    return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
}

void CVariation_ref_Base::C_E_Consequence::ThrowInvalidSelection(E_Choice index) const
{
    throw NCBI_NS_NCBI::CInvalidChoiceSelection(DIAG_COMPILE_INFO, this, m_choice, index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0]));
}

void CVariation_ref_Base::C_E_Consequence::SetNote(const CVariation_ref_Base::C_E_Consequence::TNote& value)
{
    Select(e_Note, NCBI_NS_NCBI::eDoNotResetVariant);
    *m_string = value;
}

const CVariation_ref_Base::C_E_Consequence::TVariation& CVariation_ref_Base::C_E_Consequence::GetVariation(void) const
{
    CheckSelected(e_Variation);
    return *static_cast<const TVariation*>(m_object);
}

CVariation_ref_Base::C_E_Consequence::TVariation& CVariation_ref_Base::C_E_Consequence::SetVariation(void)
{
    Select(e_Variation, NCBI_NS_NCBI::eDoNotResetVariant);
    return *static_cast<TVariation*>(m_object);
}

void CVariation_ref_Base::C_E_Consequence::SetVariation(CVariation_ref_Base::C_E_Consequence::TVariation& value)
{
    TVariation* ptr = &value;
    if ( m_choice != e_Variation || m_object != ptr ) {
        ResetSelection();
        (m_object = ptr)->AddReference();
        m_choice = e_Variation;
    }
}

const CVariation_ref_Base::C_E_Consequence::TFrameshift& CVariation_ref_Base::C_E_Consequence::GetFrameshift(void) const
{
    CheckSelected(e_Frameshift);
    return *static_cast<const TFrameshift*>(m_object);
}

CVariation_ref_Base::C_E_Consequence::TFrameshift& CVariation_ref_Base::C_E_Consequence::SetFrameshift(void)
{
    Select(e_Frameshift, NCBI_NS_NCBI::eDoNotResetVariant);
    return *static_cast<TFrameshift*>(m_object);
}

void CVariation_ref_Base::C_E_Consequence::SetFrameshift(CVariation_ref_Base::C_E_Consequence::TFrameshift& value)
{
    TFrameshift* ptr = &value;
    if ( m_choice != e_Frameshift || m_object != ptr ) {
        ResetSelection();
        (m_object = ptr)->AddReference();
        m_choice = e_Frameshift;
    }
}

const CVariation_ref_Base::C_E_Consequence::TLoss_of_heterozygosity& CVariation_ref_Base::C_E_Consequence::GetLoss_of_heterozygosity(void) const
{
    CheckSelected(e_Loss_of_heterozygosity);
    return *static_cast<const TLoss_of_heterozygosity*>(m_object);
}

CVariation_ref_Base::C_E_Consequence::TLoss_of_heterozygosity& CVariation_ref_Base::C_E_Consequence::SetLoss_of_heterozygosity(void)
{
    Select(e_Loss_of_heterozygosity, NCBI_NS_NCBI::eDoNotResetVariant);
    return *static_cast<TLoss_of_heterozygosity*>(m_object);
}

void CVariation_ref_Base::C_E_Consequence::SetLoss_of_heterozygosity(CVariation_ref_Base::C_E_Consequence::TLoss_of_heterozygosity& value)
{
    TLoss_of_heterozygosity* ptr = &value;
    if ( m_choice != e_Loss_of_heterozygosity || m_object != ptr ) {
        ResetSelection();
        (m_object = ptr)->AddReference();
        m_choice = e_Loss_of_heterozygosity;
    }
}

// helper methods

// type info
BEGIN_NAMED_CHOICE_INFO("", CVariation_ref_Base::C_E_Consequence)
{
    SET_INTERNAL_NAME("Variation-ref.consequence", "E");
    SET_CHOICE_MODULE("NCBI-Variation");
    ADD_NAMED_NULL_CHOICE_VARIANT("unknown", null, ());
    ADD_NAMED_NULL_CHOICE_VARIANT("splicing", null, ());
    ADD_NAMED_BUF_CHOICE_VARIANT("note", m_string, STD, (string));
    ADD_NAMED_REF_CHOICE_VARIANT("variation", m_object, CVariation_ref);
    ADD_NAMED_REF_CHOICE_VARIANT("frameshift", m_object, C_Frameshift);
    ADD_NAMED_REF_CHOICE_VARIANT("loss-of-heterozygosity", m_object, C_Loss_of_heterozygosity);
    info->CodeVersion(21600);
}
END_CHOICE_INFO

// constructor
CVariation_ref_Base::C_E_Consequence::C_E_Consequence(void)
    : m_choice(e_not_set)
{
}

// destructor
CVariation_ref_Base::C_E_Consequence::~C_E_Consequence(void)
{
    Reset();
}


void CVariation_ref_Base::C_E_Somatic_origin::C_Condition::ResetDescription(void)
{
    m_Description.erase();
    m_set_State[0] &= ~0x3;
}

void CVariation_ref_Base::C_E_Somatic_origin::C_Condition::ResetObject_id(void)
{
    m_Object_id.clear();
    m_set_State[0] &= ~0xc;
}

void CVariation_ref_Base::C_E_Somatic_origin::C_Condition::Reset(void)
{
    ResetDescription();
    ResetObject_id();
}

BEGIN_NAMED_CLASS_INFO("", CVariation_ref_Base::C_E_Somatic_origin::C_Condition)
{
    SET_INTERNAL_NAME("Variation-ref.somatic-origin.E", "condition");
    SET_CLASS_MODULE("NCBI-Variation");
    ADD_NAMED_STD_MEMBER("description", m_Description)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_MEMBER("object-id", m_Object_id, STL_list_set, (STL_CRef, (CLASS, (CDbtag))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    info->RandomOrder();
    info->CodeVersion(21600);
}
END_CLASS_INFO

// constructor
CVariation_ref_Base::C_E_Somatic_origin::C_Condition::C_Condition(void)
{
    memset(m_set_State,0,sizeof(m_set_State));
}

// destructor
CVariation_ref_Base::C_E_Somatic_origin::C_Condition::~C_Condition(void)
{
}


void CVariation_ref_Base::C_E_Somatic_origin::ResetSource(void)
{
    m_Source.Reset();
}

void CVariation_ref_Base::C_E_Somatic_origin::SetSource(CVariation_ref_Base::C_E_Somatic_origin::TSource& value)
{
    m_Source.Reset(&value);
}

CVariation_ref_Base::C_E_Somatic_origin::TSource& CVariation_ref_Base::C_E_Somatic_origin::SetSource(void)
{
    if ( !m_Source )
        m_Source.Reset(new ncbi::objects::CSubSource());
    return (*m_Source);
}

void CVariation_ref_Base::C_E_Somatic_origin::ResetCondition(void)
{
    m_Condition.Reset();
}

void CVariation_ref_Base::C_E_Somatic_origin::SetCondition(CVariation_ref_Base::C_E_Somatic_origin::TCondition& value)
{
    m_Condition.Reset(&value);
}

CVariation_ref_Base::C_E_Somatic_origin::TCondition& CVariation_ref_Base::C_E_Somatic_origin::SetCondition(void)
{
    if ( !m_Condition )
        m_Condition.Reset(new C_Condition());
    return (*m_Condition);
}

void CVariation_ref_Base::C_E_Somatic_origin::Reset(void)
{
    ResetSource();
    ResetCondition();
}

BEGIN_NAMED_CLASS_INFO("", CVariation_ref_Base::C_E_Somatic_origin)
{
    SET_INTERNAL_NAME("Variation-ref.somatic-origin", "E");
    SET_CLASS_MODULE("NCBI-Variation");
    ADD_NAMED_REF_MEMBER("source", m_Source, CSubSource)->SetOptional();
    ADD_NAMED_REF_MEMBER("condition", m_Condition, C_Condition)->SetOptional();
    info->RandomOrder();
    info->CodeVersion(21600);
}
END_CLASS_INFO

// constructor
CVariation_ref_Base::C_E_Somatic_origin::C_E_Somatic_origin(void)
{
    memset(m_set_State,0,sizeof(m_set_State));
}

// destructor
CVariation_ref_Base::C_E_Somatic_origin::~C_E_Somatic_origin(void)
{
}


void CVariation_ref_Base::ResetId(void)
{
    m_Id.Reset();
}

void CVariation_ref_Base::SetId(CVariation_ref_Base::TId& value)
{
    m_Id.Reset(&value);
}

CVariation_ref_Base::TId& CVariation_ref_Base::SetId(void)
{
    if ( !m_Id )
        m_Id.Reset(new ncbi::objects::CDbtag());
    return (*m_Id);
}

void CVariation_ref_Base::ResetParent_id(void)
{
    m_Parent_id.Reset();
}

void CVariation_ref_Base::SetParent_id(CVariation_ref_Base::TParent_id& value)
{
    m_Parent_id.Reset(&value);
}

CVariation_ref_Base::TParent_id& CVariation_ref_Base::SetParent_id(void)
{
    if ( !m_Parent_id )
        m_Parent_id.Reset(new ncbi::objects::CDbtag());
    return (*m_Parent_id);
}

void CVariation_ref_Base::ResetSample_id(void)
{
    m_Sample_id.Reset();
}

void CVariation_ref_Base::SetSample_id(CVariation_ref_Base::TSample_id& value)
{
    m_Sample_id.Reset(&value);
}

CVariation_ref_Base::TSample_id& CVariation_ref_Base::SetSample_id(void)
{
    if ( !m_Sample_id )
        m_Sample_id.Reset(new ncbi::objects::CObject_id());
    return (*m_Sample_id);
}

void CVariation_ref_Base::ResetOther_ids(void)
{
    m_Other_ids.clear();
    m_set_State[0] &= ~0xc0;
}

void CVariation_ref_Base::ResetName(void)
{
    m_Name.erase();
    m_set_State[0] &= ~0x300;
}

void CVariation_ref_Base::ResetSynonyms(void)
{
    m_Synonyms.clear();
    m_set_State[0] &= ~0xc00;
}

void CVariation_ref_Base::ResetDescription(void)
{
    m_Description.erase();
    m_set_State[0] &= ~0x3000;
}

void CVariation_ref_Base::ResetPhenotype(void)
{
    m_Phenotype.clear();
    m_set_State[0] &= ~0xc000;
}

void CVariation_ref_Base::ResetMethod(void)
{
    m_Method.clear();
    m_set_State[0] &= ~0x30000;
}

void CVariation_ref_Base::ResetPopulation_data(void)
{
    m_Population_data.clear();
    m_set_State[0] &= ~0xc0000;
}

void CVariation_ref_Base::ResetVariant_prop(void)
{
    m_Variant_prop.Reset();
}

void CVariation_ref_Base::SetVariant_prop(CVariation_ref_Base::TVariant_prop& value)
{
    m_Variant_prop.Reset(&value);
}

CVariation_ref_Base::TVariant_prop& CVariation_ref_Base::SetVariant_prop(void)
{
    if ( !m_Variant_prop )
        m_Variant_prop.Reset(new ncbi::objects::CVariantProperties());
    return (*m_Variant_prop);
}

void CVariation_ref_Base::ResetClinical_test(void)
{
    m_Clinical_test.clear();
    m_set_State[0] &= ~0x3000000;
}

void CVariation_ref_Base::ResetPub(void)
{
    m_Pub.Reset();
}

void CVariation_ref_Base::SetPub(CVariation_ref_Base::TPub& value)
{
    m_Pub.Reset(&value);
}

CVariation_ref_Base::TPub& CVariation_ref_Base::SetPub(void)
{
    if ( !m_Pub )
        m_Pub.Reset(new ncbi::objects::CPub());
    return (*m_Pub);
}

void CVariation_ref_Base::ResetData(void)
{
    if ( !m_Data ) {
        m_Data.Reset(new TData());
        return;
    }
    (*m_Data).Reset();
}

void CVariation_ref_Base::SetData(CVariation_ref_Base::TData& value)
{
    m_Data.Reset(&value);
}

void CVariation_ref_Base::ResetConsequence(void)
{
    m_Consequence.clear();
    m_set_State[1] &= ~0xc0;
}

void CVariation_ref_Base::ResetLocation(void)
{
    m_Location.Reset();
}

void CVariation_ref_Base::SetLocation(CVariation_ref_Base::TLocation& value)
{
    m_Location.Reset(&value);
}

CVariation_ref_Base::TLocation& CVariation_ref_Base::SetLocation(void)
{
    if ( !m_Location )
        m_Location.Reset(new ncbi::objects::CSeq_loc());
    return (*m_Location);
}

void CVariation_ref_Base::ResetExt_locs(void)
{
    m_Ext_locs.clear();
    m_set_State[1] &= ~0xc00;
}

void CVariation_ref_Base::ResetExt(void)
{
    m_Ext.Reset();
}

void CVariation_ref_Base::SetExt(CVariation_ref_Base::TExt& value)
{
    m_Ext.Reset(&value);
}

CVariation_ref_Base::TExt& CVariation_ref_Base::SetExt(void)
{
    if ( !m_Ext )
        m_Ext.Reset(new ncbi::objects::CUser_object());
    return (*m_Ext);
}

void CVariation_ref_Base::ResetSomatic_origin(void)
{
    m_Somatic_origin.clear();
    m_set_State[1] &= ~0xc000;
}

void CVariation_ref_Base::Reset(void)
{
    ResetId();
    ResetParent_id();
    ResetSample_id();
    ResetOther_ids();
    ResetName();
    ResetSynonyms();
    ResetDescription();
    ResetPhenotype();
    ResetMethod();
    ResetPopulation_data();
    ResetVariant_prop();
    ResetValidated();
    ResetClinical_test();
    ResetAllele_origin();
    ResetAllele_state();
    ResetAllele_frequency();
    ResetIs_ancestral_allele();
    ResetPub();
    ResetData();
    ResetConsequence();
    ResetLocation();
    ResetExt_locs();
    ResetExt();
    ResetSomatic_origin();
}

BEGIN_NAMED_BASE_CLASS_INFO("Variation-ref", CVariation_ref)
{
    SET_CLASS_MODULE("NCBI-Variation");
    ADD_NAMED_REF_MEMBER("id", m_Id, CDbtag)->SetOptional();
    ADD_NAMED_REF_MEMBER("parent-id", m_Parent_id, CDbtag)->SetOptional();
    ADD_NAMED_REF_MEMBER("sample-id", m_Sample_id, CObject_id)->SetOptional();
    ADD_NAMED_MEMBER("other-ids", m_Other_ids, STL_list_set, (STL_CRef, (CLASS, (CDbtag))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_STD_MEMBER("name", m_Name)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_MEMBER("synonyms", m_Synonyms, STL_list_set, (STD, (string)))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_STD_MEMBER("description", m_Description)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_MEMBER("phenotype", m_Phenotype, STL_list_set, (STL_CRef, (CLASS, (CPhenotype))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_MEMBER("method", m_Method, STL_list_set, (ENUM, (int, EMethod_E)))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_MEMBER("population-data", m_Population_data, STL_list_set, (STL_CRef, (CLASS, (CPopulation_data))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_REF_MEMBER("variant-prop", m_Variant_prop, CVariantProperties)->SetOptional();
    ADD_NAMED_STD_MEMBER("validated", m_Validated)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_MEMBER("clinical-test", m_Clinical_test, STL_list_set, (STL_CRef, (CLASS, (CDbtag))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_ENUM_MEMBER("allele-origin", m_Allele_origin, EAllele_origin)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_ENUM_MEMBER("allele-state", m_Allele_state, EAllele_state)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_STD_MEMBER("allele-frequency", m_Allele_frequency)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_STD_MEMBER("is-ancestral-allele", m_Is_ancestral_allele)->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_REF_MEMBER("pub", m_Pub, CPub)->SetOptional();
    ADD_NAMED_REF_MEMBER("data", m_Data, C_Data);
    ADD_NAMED_MEMBER("consequence", m_Consequence, STL_list_set, (STL_CRef, (CLASS, (C_E_Consequence))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_REF_MEMBER("location", m_Location, CSeq_loc)->SetOptional();
    ADD_NAMED_MEMBER("ext-locs", m_Ext_locs, STL_list_set, (STL_CRef, (CLASS, (CExt_loc))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    ADD_NAMED_REF_MEMBER("ext", m_Ext, CUser_object)->SetOptional();
    ADD_NAMED_MEMBER("somatic-origin", m_Somatic_origin, STL_list_set, (STL_CRef, (CLASS, (C_E_Somatic_origin))))->SetSetFlag(MEMBER_PTR(m_set_State[0]))->SetOptional();
    info->RandomOrder();
    info->CodeVersion(21600);
}
END_CLASS_INFO

// constructor
CVariation_ref_Base::CVariation_ref_Base(void)
    : m_Validated(0), m_Allele_origin((EAllele_origin)(0)), m_Allele_state((EAllele_state)(0)), m_Allele_frequency(0), m_Is_ancestral_allele(0)
{
    memset(m_set_State,0,sizeof(m_set_State));
    if ( !IsAllocatedInPool() ) {
        ResetData();
    }
}

// destructor
CVariation_ref_Base::~CVariation_ref_Base(void)
{
}



END_objects_SCOPE // namespace ncbi::objects::

END_NCBI_SCOPE

