void CSeqMap_CI::x_Select(const CConstRef<CSeqMap>& seqMap, const SSeqMapSelector& selector, TSeqPos pos) { m_Selector = selector; if ( m_Selector.m_Length == kInvalidSeqPos ) { TSeqPos len = seqMap->GetLength(GetScope()); len -= min(len, m_Selector.m_Position); m_Selector.m_Length = len; } if ( pos < m_Selector.m_Position ) { pos = m_Selector.m_Position; } else if ( pos > m_Selector.m_Position + m_Selector.m_Length ) { pos = m_Selector.m_Position + m_Selector.m_Length; } x_Push(seqMap, m_Selector.m_TopTSE, m_Selector.m_Position, m_Selector.m_Length, m_Selector.m_MinusStrand, pos - m_Selector.m_Position); while ( !x_Found() && GetPosition() < m_SearchEnd ) { if ( !x_Push(pos - m_Selector.m_Position) ) { x_SettleNext(); break; } } }
bool CSeqMap_CI::x_SettlePrev(void) { while ( !x_Found() ) { if ( !x_Prev() ) return false; } return true; }
bool CSeqMap_CI::x_SettleNext(void) { while ( !x_Found() && GetPosition() < m_SearchEnd ) { if ( !x_Next() ) return false; } return true; }
const CObject* CLocalHookSetBase::GetHook(const THookData* key) const { THooks::const_iterator it = x_Find(key); return x_Found(it, key)? it->second.GetPointer(): 0; }
void CLocalHookSetBase::ResetHook(THookData* key) { THooks::iterator it = x_Find(key); _ASSERT(x_Found(it, key)); m_Hooks.erase(it); }
void CLocalHookSetBase::SetHook(THookData* key, THook* hook) { THooks::iterator it = x_Find(key); _ASSERT(!x_Found(it, key)); m_Hooks.insert(it, TValue(key, CRef<CObject>(hook))); }