📄 annot_types_ci.hpp
字号:
/* * =========================================================================== * PRODUCTION $Log: annot_types_ci.hpp,v $ * PRODUCTION Revision 1000.3 2004/04/12 17:27:00 gouriano * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.70 * PRODUCTION * =========================================================================== */#ifndef ANNOT_TYPES_CI__HPP#define ANNOT_TYPES_CI__HPP/* $Id: annot_types_ci.hpp,v 1000.3 2004/04/12 17:27:00 gouriano Exp $* ===========================================================================** 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.** ===========================================================================** Author: Aleksey Grichenko, Michael Kimelman, Eugene Vasilchenko** File Description:* Object manager iterators**/#include <objmgr/impl/annot_collector.hpp>BEGIN_NCBI_SCOPEBEGIN_SCOPE(objects)// Base class for specific annotation iteratorsclass NCBI_XOBJMGR_EXPORT CAnnotTypes_CI{public: typedef SAnnotSelector::TAnnotType TAnnotType; CAnnotTypes_CI(void); // short methods CAnnotTypes_CI(TAnnotType type, CScope& scope, const CSeq_loc& loc, const SAnnotSelector& params); CAnnotTypes_CI(TAnnotType type, const CBioseq_Handle& bioseq, TSeqPos start, TSeqPos stop, const SAnnotSelector& params); // Iterate everything from the seq-annot CAnnotTypes_CI(TAnnotType type, const CSeq_annot_Handle& annot); // Iterate everything from the seq-annot CAnnotTypes_CI(TAnnotType type, const CSeq_annot_Handle& annot, const SAnnotSelector& params); // Iterate everything from the seq-entry CAnnotTypes_CI(TAnnotType type, const CSeq_entry_Handle& entry); // Iterate everything from the seq-entry CAnnotTypes_CI(TAnnotType type, const CSeq_entry_Handle& entry, const SAnnotSelector& params); // Search all TSEs in all datasources, by default get annotations defined // on segments in the same TSE (eResolve_TSE method). CAnnotTypes_CI(TAnnotType type, CScope& scope, const CSeq_loc& loc, //const SAnnotSelector& selector, SAnnotSelector::EOverlapType overlap_type, SAnnotSelector::EResolveMethod resolve); // Search only in TSE, containing the bioseq, by default get annotations // defined on segments in the same TSE (eResolve_TSE method). // If "entry" is set, search only annotations from the seq-entry specified // (but no its sub-entries or parent entry). CAnnotTypes_CI(TAnnotType type, const CBioseq_Handle& bioseq, TSeqPos start, TSeqPos stop, //const SAnnotSelector& selector, SAnnotSelector::EOverlapType overlap_type, SAnnotSelector::EResolveMethod resolve); virtual ~CAnnotTypes_CI(void); // Rewind annot iterator to point to the very first annot object, // the same as immediately after construction. void Rewind(void); CSeq_annot_Handle GetAnnot(void) const; const CSeq_annot& GetSeq_annot(void) const; // Get number of annotations size_t GetSize(void) const;protected: typedef CAnnot_Collector::TAnnotSet TAnnotSet; typedef TAnnotSet::const_iterator TIterator; // Check if a datasource and an annotation are selected. bool IsValid(void) const; // Move to the next valid position void Next(void); void Prev(void); // Return current annotation const CAnnotObject_Ref& Get(void) const; CScope& GetScope(void) const; CAnnot_Collector& GetCollector(void); const TIterator& GetIterator(void) const;private: const TAnnotSet& x_GetAnnotSet(void) const; CRef<CAnnot_Collector> m_DataCollector; // Current annotation TIterator m_CurrAnnot;};/////////////////////////////////////////////////////////////////////////////// CAnnotTypes_CI/////////////////////////////////////////////////////////////////////////////inlineconst CAnnotTypes_CI::TAnnotSet& CAnnotTypes_CI::x_GetAnnotSet(void) const{ _ASSERT(m_DataCollector); return m_DataCollector->GetAnnotSet();}inlinebool CAnnotTypes_CI::IsValid(void) const{ return bool(m_DataCollector) && m_CurrAnnot != x_GetAnnotSet().end();}inlinevoid CAnnotTypes_CI::Rewind(void){ m_CurrAnnot = x_GetAnnotSet().begin();}inlinevoid CAnnotTypes_CI::Next(void){ ++m_CurrAnnot;}inlinevoid CAnnotTypes_CI::Prev(void){ --m_CurrAnnot;}inlineconst CAnnotObject_Ref& CAnnotTypes_CI::Get(void) const{ _ASSERT( IsValid() ); return *m_CurrAnnot;}inlineCAnnot_Collector& CAnnotTypes_CI::GetCollector(void){ _ASSERT(m_DataCollector); return *m_DataCollector;}inlineconst CAnnotTypes_CI::TIterator& CAnnotTypes_CI::GetIterator(void) const{ _ASSERT( IsValid() ); return m_CurrAnnot;}inlinesize_t CAnnotTypes_CI::GetSize(void) const{ return x_GetAnnotSet().size();}inlineCScope& CAnnotTypes_CI::GetScope(void) const{ _ASSERT(m_DataCollector); return m_DataCollector->GetScope();}END_SCOPE(objects)END_NCBI_SCOPE/** ---------------------------------------------------------------------------* $Log: annot_types_ci.hpp,v $* Revision 1000.3 2004/04/12 17:27:00 gouriano* PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.70** Revision 1.70 2004/04/07 13:20:16 grichenk* Moved more data from iterators to CAnnot_Collector** Revision 1.69 2004/04/05 15:56:13 grichenk* Redesigned CAnnotTypes_CI: moved all data and data collecting* functions to CAnnotDataCollector. CAnnotTypes_CI is no more* inherited from SAnnotSelector.** Revision 1.68 2004/03/16 18:09:29 vasilche* Include <memory> for auto_ptr** Revision 1.67 2004/03/16 15:47:25 vasilche* Added CBioseq_set_Handle and set of EditHandles** Revision 1.66 2004/02/19 19:25:08 vasilche* Hidded implementation of CAnnotObject_Ref.* Added necessary access methods.** Revision 1.65 2004/02/19 17:14:36 vasilche* Removed unused include.** Revision 1.64 2004/02/06 18:31:53 vasilche* Fixed annot sorting class - deal with different annot types (graph align feat).** Revision 1.63 2004/02/05 19:53:39 grichenk* Fixed type matching in SAnnotSelector. Added IncludeAnnotType().*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -