⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 seq_loc.hpp

📁 ncbi源码
💻 HPP
📖 第 1 页 / 共 2 页
字号:
    if ( range.GetFrom() == TSeqPos(kDirtyCache) )        range = x_UpdateTotalRange();    return range;}inlinevoid CSeq_loc::CheckId(const CSeq_id*& id) const{    const CSeq_id* my_id = m_IdCache;    if ( my_id == 0 ) {        x_CheckId(my_id);        m_IdCache = my_id;    }    x_UpdateId(id, my_id);}inlinevoid CSeq_loc::SetId(const CSeq_id& id){    InvalidateIdCache();    CRef<CSeq_id> nc_id(new CSeq_id);    nc_id->Assign(id);    SetId(*nc_id);    m_IdCache = nc_id.GetPointer();}inlineint CSeq_loc::Compare(const CSeq_loc& loc) const{    CSeq_loc::TRange range1 = GetTotalRange();    CSeq_loc::TRange range2 = loc.GetTotalRange();    // smallest left extreme first    if ( range1.GetFrom() != range2.GetFrom() ) {        return range1.GetFrom() < range2.GetFrom()? -1: 1;    }    // longest first    if ( range1.GetToOpen() != range2.GetToOpen() ) {        return range1.GetToOpen() < range2.GetToOpen()? 1: -1;    }    return 0;}/////////////////// end of CSeq_loc inline methods/////////////////// CSeq_loc_CI inline methodsinlineCSeq_loc_CI::SLoc_Info::SLoc_Info(void)    : m_Id(0),      m_Strand(eNa_strand_unknown),      m_Loc(0){    return;}inlineCSeq_loc_CI& CSeq_loc_CI::operator++ (void){    ++m_CurLoc;    return *this;}inlinebool CSeq_loc_CI::x_IsValid(void) const{    return m_CurLoc != m_LocList.end();}inlineCSeq_loc_CI::operator bool (void) const{    return x_IsValid();}inlinevoid CSeq_loc_CI::x_CheckNotValid(const char* where) const{    if ( !x_IsValid() )        x_ThrowNotValid(where);}inlineconst CSeq_id& CSeq_loc_CI::GetSeq_id(void) const{    x_CheckNotValid("GetSeq_id()");    return *m_CurLoc->m_Id;}inlineCSeq_loc_CI::TRange CSeq_loc_CI::GetRange(void) const{    x_CheckNotValid("GetRange()");    return m_CurLoc->m_Range;}inlineENa_strand CSeq_loc_CI::GetStrand(void) const{    x_CheckNotValid("GetStrand()");    return m_CurLoc->m_Strand;}inlineconst CSeq_loc& CSeq_loc_CI::GetSeq_loc(void) const{    x_CheckNotValid("GetSeq_loc()");    if ( !m_CurLoc->m_Loc ) {        NCBI_THROW(CException, eUnknown,            "CSeq_loc_CI::GetSeq_loc() -- NULL seq-loc");    }    return *m_CurLoc->m_Loc;}inlineconst CInt_fuzz* CSeq_loc_CI::GetFuzzFrom(void) const{    x_CheckNotValid("GetFuzzFrom()");    return m_CurLoc->m_Fuzz[0];}inlineconst CInt_fuzz* CSeq_loc_CI::GetFuzzTo(void) const{    x_CheckNotValid("GetFuzzTo()");    return m_CurLoc->m_Fuzz[1];}inlinebool CSeq_loc_CI::IsWhole(void) const{    x_CheckNotValid("IsWhole()");    return m_CurLoc->m_Range.IsWhole();}inlinebool CSeq_loc_CI::IsEmpty(void) const{    x_CheckNotValid("IsEmpty()");    return m_CurLoc->m_Range.Empty();}inlinebool CSeq_loc_CI::IsPoint(void) const{    x_CheckNotValid("IsPoint()");    return m_CurLoc->m_Range.GetLength() == 1;}/////////////////// end of CSeq_loc_CI inline methodsEND_objects_SCOPE // namespace ncbi::objects::END_NCBI_SCOPE/* * =========================================================================== * $Log: Seq_loc.hpp,v $ * Revision 1000.3  2004/06/01 19:30:53  gouriano * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.37 * * Revision 1.37  2004/05/06 16:54:41  shomrat * Added methods to set partial left and right * * Revision 1.36  2004/03/25 15:58:41  gouriano * Added possibility to copy and compare serial object non-recursively * * Revision 1.35  2004/03/16 18:08:56  vasilche * Use GetPointer() to avoid ambiguity * * Revision 1.34  2004/02/17 21:10:58  vasilche * Fixed possible race condition in CSeq_loc::CheckId(). * * Revision 1.33  2004/01/29 21:07:08  shomrat * Made cache invalidation methods public * * Revision 1.32  2004/01/28 17:16:31  shomrat * Added methods to ease the construction of objects * * Revision 1.31  2003/12/31 15:36:07  grichenk * Moved CompareLocations() from CSeq_feat to CSeq_loc, * renamed it to Compare(). * * Revision 1.30  2003/11/21 14:45:00  grichenk * Replaced runtime_error with CException * * Revision 1.29  2003/10/15 15:50:21  ucko * CSeq_loc::SetId: add a version that takes a const ID and stores a new copy. * CSeq_loc_CI: expose fuzz (if present). * * Revision 1.28  2003/10/14 16:49:53  dicuccio * Added SetId() * * Revision 1.27  2003/09/22 18:38:13  grichenk * Fixed circular seq-locs processing by TestForOverlap() * * Revision 1.26  2003/09/17 18:39:01  grichenk * + GetStart(), GetEnd(), GetCircularLength() * * Revision 1.25  2003/06/18 16:00:07  vasilche * Fixed GetTotalRange() in multithreaded app. * * Revision 1.24  2003/06/13 17:21:18  grichenk * Added seq-id caching for single-id seq-locs * * Revision 1.23  2003/04/02 15:17:45  grichenk * Added flag for CSeq_loc_CI to skip/include empty locations. * * Revision 1.22  2003/02/06 22:23:29  vasilche * Added CSeq_id::Assign(), CSeq_loc::Assign(). * Added int CSeq_id::Compare() (not safe). * Added caching of CSeq_loc::GetTotalRange(). * * Revision 1.21  2003/02/04 16:04:12  dicuccio * Changed postfix to prefix operator in op++() - marginally faster * * Revision 1.20  2003/02/04 15:15:11  grichenk * Overrided Assign() for CSeq_loc and CSeq_id * * Revision 1.19  2003/01/22 20:13:57  vasilche * Use more effective COpenRange<> methods. * * Revision 1.18  2002/12/30 19:37:02  vasilche * Rewrote CSeq_loc::GetTotalRange() to avoid using CSeq_loc_CI - * it's too expensive. * * Revision 1.17  2002/12/26 12:43:42  dicuccio * Added Win32 export specifiers * * Revision 1.16  2002/12/23 17:19:26  grichenk * Added GetSeq_loc() to CSeq_loc_CI * * Revision 1.15  2002/12/19 20:21:10  dicuccio * Remove post-increment operator * * Revision 1.14  2002/12/19 20:11:20  grichenk * Fixed error message * * Revision 1.13  2002/10/03 18:49:05  clausen * Removed extra whitespace * * Revision 1.12  2002/10/03 16:37:39  clausen * Added GetLabel() * * Revision 1.11  2002/09/12 21:16:14  kans * added IsPartialLeft and IsPartialRight * * Revision 1.10  2002/06/07 11:54:34  clausen * Added related functions comment * * Revision 1.9  2002/06/06 20:40:51  clausen * Moved methods using object manager to objects/util * * Revision 1.8  2002/05/03 21:28:04  ucko * Introduce T(Signed)SeqPos. * * Revision 1.7  2002/04/17 15:39:06  grichenk * Moved CSeq_loc_CI to the seq-loc library * * Revision 1.6  2002/01/10 18:20:48  clausen * Added IsOneBioseq, GetStart, and GetId * * Revision 1.5  2001/10/22 11:39:49  clausen * Added Compare() * * Revision 1.4  2001/06/25 18:52:02  grichenk * Prohibited copy constructor and assignment operator * * Revision 1.3  2001/01/05 20:11:41  vasilche * CRange, CRangeMap were moved to util. * * Revision 1.2  2001/01/03 16:38:58  vasilche * Added CAbstractObjectManager - stub for object manager. * CRange extracted to separate file. * * Revision 1.1  2000/11/17 21:35:02  vasilche * Added GetLength() method to CSeq_loc class. * * * ===========================================================================*/#endif // OBJECTS_SEQLOC_SEQ_LOC_HPP

⌨️ 快捷键说明

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