NCBI C++ Toolkit Cross Reference

  C++/src/objects/seq/Annotdesc_.cpp


/* $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: * 'seq.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/seq/Annotdesc.hpp> #include <objects/general/Date.hpp> #include <objects/general/User_object.hpp> #include <objects/seq/Align_def.hpp> #include <objects/seq/Pubdesc.hpp> #include <objects/seqloc/Seq_id.hpp> #include <objects/seqloc/Seq_loc.hpp> BEGIN_NCBI_SCOPE BEGIN_objects_SCOPE // namespace ncbi::objects:: // generated classes void CAnnotdesc_Base::Reset(void) { if ( m_choice != e_not_set ) ResetSelection(); } void CAnnotdesc_Base::ResetSelection(void) { switch ( m_choice ) { case e_Name: case e_Title: case e_Comment: m_string.Destruct(); break; case e_Pub: case e_User: case e_Create_date: case e_Update_date: case e_Src: case e_Align: case e_Region: m_object->RemoveReference(); break; default: break; } m_choice = e_not_set; } void CAnnotdesc_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool) { switch ( index ) { case e_Pub: (m_object = new(pool) ncbi::objects::CPubdesc())->AddReference(); break; case e_User: (m_object = new(pool) ncbi::objects::CUser_object())->AddReference(); break; case e_Create_date: (m_object = new(pool) ncbi::objects::CDate())->AddReference(); break; case e_Update_date: (m_object = new(pool) ncbi::objects::CDate())->AddReference(); break; case e_Src: (m_object = new(pool) ncbi::objects::CSeq_id())->AddReference(); break; case e_Align: (m_object = new(pool) ncbi::objects::CAlign_def())->AddReference(); break; case e_Region: (m_object = new(pool) ncbi::objects::CSeq_loc())->AddReference(); break; case e_Name: case e_Title: case e_Comment: m_string.Construct(); break; default: break; } m_choice = index; } const char* const CAnnotdesc_Base::sm_SelectionNames[] = { "not set", "name", "title", "comment", "pub", "user", "create-date", "update-date", "src", "align", "region" }; NCBI_NS_STD::string CAnnotdesc_Base::SelectionName(E_Choice index) { return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0])); } void CAnnotdesc_Base::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 CAnnotdesc_Base::SetName(const CAnnotdesc_Base::TName& value) { Select(e_Name, NCBI_NS_NCBI::eDoNotResetVariant); *m_string = value; } void CAnnotdesc_Base::SetTitle(const CAnnotdesc_Base::TTitle& value) { Select(e_Title, NCBI_NS_NCBI::eDoNotResetVariant); *m_string = value; } void CAnnotdesc_Base::SetComment(const CAnnotdesc_Base::TComment& value) { Select(e_Comment, NCBI_NS_NCBI::eDoNotResetVariant); *m_string = value; } const CAnnotdesc_Base::TPub& CAnnotdesc_Base::GetPub(void) const { CheckSelected(e_Pub); return *static_cast<const TPub*>(m_object); } CAnnotdesc_Base::TPub& CAnnotdesc_Base::SetPub(void) { Select(e_Pub, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TPub*>(m_object); } void CAnnotdesc_Base::SetPub(CAnnotdesc_Base::TPub& value) { TPub* ptr = &value; if ( m_choice != e_Pub || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Pub; } } const CAnnotdesc_Base::TUser& CAnnotdesc_Base::GetUser(void) const { CheckSelected(e_User); return *static_cast<const TUser*>(m_object); } CAnnotdesc_Base::TUser& CAnnotdesc_Base::SetUser(void) { Select(e_User, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TUser*>(m_object); } void CAnnotdesc_Base::SetUser(CAnnotdesc_Base::TUser& value) { TUser* ptr = &value; if ( m_choice != e_User || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_User; } } const CAnnotdesc_Base::TCreate_date& CAnnotdesc_Base::GetCreate_date(void) const { CheckSelected(e_Create_date); return *static_cast<const TCreate_date*>(m_object); } CAnnotdesc_Base::TCreate_date& CAnnotdesc_Base::SetCreate_date(void) { Select(e_Create_date, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TCreate_date*>(m_object); } void CAnnotdesc_Base::SetCreate_date(CAnnotdesc_Base::TCreate_date& value) { TCreate_date* ptr = &value; if ( m_choice != e_Create_date || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Create_date; } } const CAnnotdesc_Base::TUpdate_date& CAnnotdesc_Base::GetUpdate_date(void) const { CheckSelected(e_Update_date); return *static_cast<const TUpdate_date*>(m_object); } CAnnotdesc_Base::TUpdate_date& CAnnotdesc_Base::SetUpdate_date(void) { Select(e_Update_date, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TUpdate_date*>(m_object); } void CAnnotdesc_Base::SetUpdate_date(CAnnotdesc_Base::TUpdate_date& value) { TUpdate_date* ptr = &value; if ( m_choice != e_Update_date || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Update_date; } } const CAnnotdesc_Base::TSrc& CAnnotdesc_Base::GetSrc(void) const { CheckSelected(e_Src); return *static_cast<const TSrc*>(m_object); } CAnnotdesc_Base::TSrc& CAnnotdesc_Base::SetSrc(void) { Select(e_Src, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TSrc*>(m_object); } void CAnnotdesc_Base::SetSrc(CAnnotdesc_Base::TSrc& value) { TSrc* ptr = &value; if ( m_choice != e_Src || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Src; } } const CAnnotdesc_Base::TAlign& CAnnotdesc_Base::GetAlign(void) const { CheckSelected(e_Align); return *static_cast<const TAlign*>(m_object); } CAnnotdesc_Base::TAlign& CAnnotdesc_Base::SetAlign(void) { Select(e_Align, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TAlign*>(m_object); } void CAnnotdesc_Base::SetAlign(CAnnotdesc_Base::TAlign& value) { TAlign* ptr = &value; if ( m_choice != e_Align || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Align; } } const CAnnotdesc_Base::TRegion& CAnnotdesc_Base::GetRegion(void) const { CheckSelected(e_Region); return *static_cast<const TRegion*>(m_object); } CAnnotdesc_Base::TRegion& CAnnotdesc_Base::SetRegion(void) { Select(e_Region, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TRegion*>(m_object); } void CAnnotdesc_Base::SetRegion(CAnnotdesc_Base::TRegion& value) { TRegion* ptr = &value; if ( m_choice != e_Region || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Region; } } // helper methods // type info BEGIN_NAMED_BASE_CHOICE_INFO("Annotdesc", CAnnotdesc) { SET_CHOICE_MODULE("NCBI-Sequence"); ADD_NAMED_BUF_CHOICE_VARIANT("name", m_string, STD, (string)); ADD_NAMED_BUF_CHOICE_VARIANT("title", m_string, STD, (string)); ADD_NAMED_BUF_CHOICE_VARIANT("comment", m_string, STD, (string)); ADD_NAMED_REF_CHOICE_VARIANT("pub", m_object, CPubdesc); ADD_NAMED_REF_CHOICE_VARIANT("user", m_object, CUser_object); ADD_NAMED_REF_CHOICE_VARIANT("create-date", m_object, CDate); ADD_NAMED_REF_CHOICE_VARIANT("update-date", m_object, CDate); ADD_NAMED_REF_CHOICE_VARIANT("src", m_object, CSeq_id); ADD_NAMED_REF_CHOICE_VARIANT("align", m_object, CAlign_def); ADD_NAMED_REF_CHOICE_VARIANT("region", m_object, CSeq_loc); info->CodeVersion(21600); } END_CHOICE_INFO // constructor CAnnotdesc_Base::CAnnotdesc_Base(void) : m_choice(e_not_set) { } // destructor CAnnotdesc_Base::~CAnnotdesc_Base(void) { Reset(); } END_objects_SCOPE // namespace ncbi::objects:: END_NCBI_SCOPE

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.