NCBI C++ Toolkit Cross Reference

  C++/src/objects/blast/Blast4_queries_.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: * 'blast.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/blast/Blast4_queries.hpp> #include <objects/scoremat/PssmWithParameters.hpp> #include <objects/seqloc/Seq_loc.hpp> #include <objects/seqset/Bioseq_set.hpp> BEGIN_NCBI_SCOPE BEGIN_objects_SCOPE // namespace ncbi::objects:: // generated classes void CBlast4_queries_Base::Reset(void) { if ( m_choice != e_not_set ) ResetSelection(); } void CBlast4_queries_Base::ResetSelection(void) { switch ( m_choice ) { case e_Seq_loc_list: m_Seq_loc_list.Destruct(); break; case e_Pssm: case e_Bioseq_set: m_object->RemoveReference(); break; default: break; } m_choice = e_not_set; } void CBlast4_queries_Base::DoSelect(E_Choice index, NCBI_NS_NCBI::CObjectMemoryPool* pool) { switch ( index ) { case e_Pssm: (m_object = new(pool) ncbi::objects::CPssmWithParameters())->AddReference(); break; case e_Seq_loc_list: m_Seq_loc_list.Construct(); break; case e_Bioseq_set: (m_object = new(pool) ncbi::objects::CBioseq_set())->AddReference(); break; default: break; } m_choice = index; } const char* const CBlast4_queries_Base::sm_SelectionNames[] = { "not set", "pssm", "seq-loc-list", "bioseq-set" }; NCBI_NS_STD::string CBlast4_queries_Base::SelectionName(E_Choice index) { return NCBI_NS_NCBI::CInvalidChoiceSelection::GetName(index, sm_SelectionNames, sizeof(sm_SelectionNames)/sizeof(sm_SelectionNames[0])); } void CBlast4_queries_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])); } const CBlast4_queries_Base::TPssm& CBlast4_queries_Base::GetPssm(void) const { CheckSelected(e_Pssm); return *static_cast<const TPssm*>(m_object); } CBlast4_queries_Base::TPssm& CBlast4_queries_Base::SetPssm(void) { Select(e_Pssm, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TPssm*>(m_object); } void CBlast4_queries_Base::SetPssm(CBlast4_queries_Base::TPssm& value) { TPssm* ptr = &value; if ( m_choice != e_Pssm || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Pssm; } } const CBlast4_queries_Base::TBioseq_set& CBlast4_queries_Base::GetBioseq_set(void) const { CheckSelected(e_Bioseq_set); return *static_cast<const TBioseq_set*>(m_object); } CBlast4_queries_Base::TBioseq_set& CBlast4_queries_Base::SetBioseq_set(void) { Select(e_Bioseq_set, NCBI_NS_NCBI::eDoNotResetVariant); return *static_cast<TBioseq_set*>(m_object); } void CBlast4_queries_Base::SetBioseq_set(CBlast4_queries_Base::TBioseq_set& value) { TBioseq_set* ptr = &value; if ( m_choice != e_Bioseq_set || m_object != ptr ) { ResetSelection(); (m_object = ptr)->AddReference(); m_choice = e_Bioseq_set; } } // helper methods // type info BEGIN_NAMED_BASE_CHOICE_INFO("Blast4-queries", CBlast4_queries) { SET_CHOICE_MODULE("NCBI-Blast4"); ADD_NAMED_REF_CHOICE_VARIANT("pssm", m_object, CPssmWithParameters); ADD_NAMED_BUF_CHOICE_VARIANT("seq-loc-list", m_Seq_loc_list, STL_list, (STL_CRef, (CLASS, (CSeq_loc)))); ADD_NAMED_REF_CHOICE_VARIANT("bioseq-set", m_object, CBioseq_set); } END_CHOICE_INFO // constructor CBlast4_queries_Base::CBlast4_queries_Base(void) : m_choice(e_not_set) { } // destructor CBlast4_queries_Base::~CBlast4_queries_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.