seq_entry_info.cpp

来自「ncbi源码」· C++ 代码 · 共 630 行 · 第 1/2 页

CPP
630
字号
    }    x_DSUnmapObject(m_Object, ds);    TParent::x_DSDetachContents(ds);}void CSeq_entry_Info::x_DSMapObject(CConstRef<TObject> obj, CDataSource& ds){    ds.x_Map(obj, this);}void CSeq_entry_Info::x_DSUnmapObject(CConstRef<TObject> obj, CDataSource& ds){    ds.x_Unmap(obj, this);}void CSeq_entry_Info::x_SetObject(TObject& obj){    x_CheckWhich(CSeq_entry::e_not_set);    _ASSERT(!m_Object);    _ASSERT(!m_Contents);    m_Object.Reset(&obj);    switch ( (m_Which = obj.Which()) ) {    case CSeq_entry::e_Seq:        m_Contents.Reset(new CBioseq_Info(obj.SetSeq()));        break;    case CSeq_entry::e_Set:        m_Contents.Reset(new CBioseq_set_Info(obj.SetSet()));        break;    default:        break;    }    x_AttachContents();}void CSeq_entry_Info::x_SetObject(const CSeq_entry_Info& info){    x_CheckWhich(CSeq_entry::e_not_set);    _ASSERT(!m_Object);    _ASSERT(!m_Contents);    m_Which = info.m_Which;    m_Object.Reset(new CSeq_entry);    switch ( m_Which ) {    case CSeq_entry::e_Seq:    {        CRef<CBioseq_Info> seq(new CBioseq_Info(info.GetSeq()));        m_Contents.Reset(seq);        x_AttachObjectVariant(seq->x_GetObject());        break;    }    case CSeq_entry::e_Set:    {        CRef<CBioseq_set_Info> seqset(new CBioseq_set_Info(info.GetSet()));        m_Contents.Reset(seqset);        x_AttachObjectVariant(seqset->x_GetObject());        break;    }    default:        break;    }    x_AttachContents();}void CSeq_entry_Info::x_DetachObjectVariant(void){    m_Object->Reset();}void CSeq_entry_Info::x_AttachObjectVariant(CBioseq_set& seqset){    x_DetachObjectVariant();    m_Object->SetSet(seqset);}void CSeq_entry_Info::x_AttachObjectVariant(CBioseq& seq){    x_DetachObjectVariant();    m_Object->SetSeq(seq);}/*CRef<CSeq_entry> CSeq_entry_Info::x_CreateObject(void) const{            CRef<TObject> obj(new TObject);    switch ( Which() ) {    case CSeq_entry::e_Set:        obj->SetSet(const_cast<CBioseq_set&>                    (*GetSet().GetCompleteBioseq_set()));        break;    case CSeq_entry::e_Seq:        obj->SetSeq(const_cast<CBioseq&>                    (*GetSeq().GetCompleteBioseq()));        break;    default:        break;    }    return obj;}*/void CSeq_entry_Info::x_AttachContents(void){    if ( m_Contents ) {        m_Contents->x_ParentAttach(*this);        x_AttachObject(*m_Contents);    }}void CSeq_entry_Info::x_DetachContents(void){    if ( m_Contents ) {        x_DetachObject(*m_Contents);        m_Contents->x_ParentDetach(*this);    }}void CSeq_entry_Info::UpdateAnnotIndex(void) const{    if ( x_DirtyAnnotIndex() ) {        GetTSE_Info().UpdateAnnotIndex(*this);        _ASSERT(!x_DirtyAnnotIndex());    }}void CSeq_entry_Info::x_UpdateAnnotIndexContents(CTSE_Info& tse){    m_Contents->x_UpdateAnnotIndex(tse);    TParent::x_UpdateAnnotIndexContents(tse);}bool CSeq_entry_Info::IsSetDescr(void) const{    return bool(m_Contents) && m_Contents->IsSetDescr();}const CSeq_descr& CSeq_entry_Info::GetDescr(void) const{    return m_Contents->GetDescr();}void CSeq_entry_Info::SetDescr(TDescr& v){    m_Contents->SetDescr(v);}void CSeq_entry_Info::ResetDescr(void){    m_Contents->ResetDescr();}bool CSeq_entry_Info::AddSeqdesc(CSeqdesc& d){    return m_Contents->AddSeqdesc(d);}bool CSeq_entry_Info::RemoveSeqdesc(const CSeqdesc& d){    return m_Contents->RemoveSeqdesc(d);}void CSeq_entry_Info::AddDescr(CSeq_entry_Info& src){    if ( src.IsSetDescr() ) {        m_Contents->AddSeq_descr(src.m_Contents->x_SetDescr());    }}CRef<CSeq_annot_Info> CSeq_entry_Info::AddAnnot(const CSeq_annot& annot){    return m_Contents->AddAnnot(annot);}void CSeq_entry_Info::AddAnnot(CRef<CSeq_annot_Info> annot){    m_Contents->AddAnnot(annot);}void CSeq_entry_Info::RemoveAnnot(CRef<CSeq_annot_Info> annot){    m_Contents->RemoveAnnot(annot);}CRef<CSeq_entry_Info> CSeq_entry_Info::AddEntry(CSeq_entry& entry,                                                  int index){    x_CheckWhich(CSeq_entry::e_Set);    return SetSet().AddEntry(entry, index);}void CSeq_entry_Info::AddEntry(CRef<CSeq_entry_Info> entry, int index){    x_CheckWhich(CSeq_entry::e_Set);    SetSet().AddEntry(entry, index);}void CSeq_entry_Info::RemoveEntry(CRef<CSeq_entry_Info> entry){    x_CheckWhich(CSeq_entry::e_Set);    SetSet().RemoveEntry(entry);}END_SCOPE(objects)END_NCBI_SCOPE/* * =========================================================================== * $Log: seq_entry_info.cpp,v $ * Revision 1000.3  2004/06/01 19:24:00  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.15 * * Revision 1.15  2004/05/21 21:42:13  gorelenk * Added PCH ncbi_pch.hpp * * Revision 1.14  2004/03/31 17:08:07  vasilche * Implemented ConvertSeqToSet and ConvertSetToSeq. * * Revision 1.13  2004/03/25 19:27:44  vasilche * Implemented MoveTo and CopyTo methods of handles. * * Revision 1.12  2004/03/24 18:30:30  vasilche * Fixed edit API. * Every *_Info object has its own shallow copy of original object. * * Revision 1.11  2004/03/16 15:47:28  vasilche * Added CBioseq_set_Handle and set of EditHandles * * Revision 1.10  2004/02/03 19:02:18  vasilche * Fixed broken 'dirty annot index' state after RemoveEntry(). * * Revision 1.9  2004/02/02 14:46:44  vasilche * Several performance fixed - do not iterate whole tse set in CDataSource. * * Revision 1.8  2004/01/29 19:33:07  vasilche * Fixed coredump on WorkShop when invalid Seq-entry is added to CScope. * * Revision 1.7  2004/01/22 20:10:40  vasilche * 1. Splitted ID2 specs to two parts. * ID2 now specifies only protocol. * Specification of ID2 split data is moved to seqsplit ASN module. * For now they are still reside in one resulting library as before - libid2. * As the result split specific headers are now in objects/seqsplit. * 2. Moved ID2 and ID1 specific code out of object manager. * Protocol is processed by corresponding readers. * ID2 split parsing is processed by ncbi_xreader library - used by all readers. * 3. Updated OBJMGR_LIBS correspondingly. * * Revision 1.6  2003/12/18 16:38:07  grichenk * Added CScope::RemoveEntry() * * Revision 1.5  2003/12/11 17:02:50  grichenk * Fixed CRef resetting in constructors. * * Revision 1.4  2003/11/19 22:18:03  grichenk * All exceptions are now CException-derived. Catch "exception" rather * than "runtime_error". * * Revision 1.3  2003/09/30 16:22:03  vasilche * Updated internal object manager classes to be able to load ID2 data. * SNP blobs are loaded as ID2 split blobs - readers convert them automatically. * Scope caches results of requests for data to data loaders. * Optimized CSeq_id_Handle for gis. * Optimized bioseq lookup in scope. * Reduced object allocations in annotation iterators. * CScope is allowed to be destroyed before other objects using this scope are * deleted (feature iterators, bioseq handles etc). * Optimized lookup for matching Seq-ids in CSeq_id_Mapper. * Added 'adaptive' option to objmgr_demo application. * * Revision 1.2  2003/06/02 16:06:38  dicuccio * Rearranged src/objects/ subtree.  This includes the following shifts: *     - src/objects/asn2asn --> arc/app/asn2asn *     - src/objects/testmedline --> src/objects/ncbimime/test *     - src/objects/objmgr --> src/objmgr *     - src/objects/util --> src/objmgr/util *     - src/objects/alnmgr --> src/objtools/alnmgr *     - src/objects/flat --> src/objtools/flat *     - src/objects/validator --> src/objtools/validator *     - src/objects/cddalignview --> src/objtools/cddalignview * In addition, libseq now includes six of the objects/seq... libs, and libmmdb * replaces the three libmmdb? libs. * * Revision 1.1  2003/04/24 16:12:38  vasilche * Object manager internal structures are splitted more straightforward. * Removed excessive header dependencies. * * * =========================================================================== */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?