1 #ifndef SCOPE_INFO__HPP
2 #define SCOPE_INFO__HPP
92 template<
typename Key,
typename Value>
118 ret = iter->second->second;
152 *unlock_ptr =
m_Queue.front().second;
174 unlock_set->push_back(
m_Queue.front().second);
185 unlock_set->push_back(it->second);
223 void DetachScope(
void);
226 void ResetHistory(
int action_if_locked);
238 void RemoveFromHistory(
CTSE_ScopeInfo& tse,
bool drop_from_ds =
false);
241 void RemoveTSE_Lock(
const CTSE_Lock& lock);
251 bool CanBeEdited(
void)
const;
253 bool IsConst(
void)
const;
257 void SetCanRemoveOnResetHistory(
void);
258 bool CanRemoveOnResetHistory(
void)
const;
286 bool TSEIsReplaced(
const TBlobId& blob_id)
const;
360 bool can_be_unloaded);
366 bool IsAttached(
void)
const;
368 int action_if_locked,
369 bool drop_from_ds =
false);
370 static void RemoveFromHistory(
const CTSE_Handle& tseh,
371 int action_if_locked,
372 bool drop_from_ds =
false);
376 bool CanBeUnloaded(
void)
const;
377 bool CanBeEdited(
void)
const;
380 bool IsUserLocked(
void)
const;
382 pair<bool, CScopeInfo_Base*> GetUserLockState(
const CTSE_Handle* tseh)
const;
388 bool x_SameTSE(
const CTSE_Info& tse)
const;
390 int GetLoadIndex(
void)
const;
393 const TSeqIds& GetBioseqsIds(
void)
const;
396 void ReleaseUsedTSEs(
void);
399 void SetEditTSE(
const CTSE_Lock& new_tse_lock,
401 void ReplaceTSE(
const CTSE_Info& old_tse);
402 void RestoreReplacedTSE(
void);
437 friend class CTSE_ScopeInfo_Base;
439 void ForgetTSE_Lock(
void);
441 const CTSE_Lock& GetTSE_Lock(
void)
const;
443 void ResetTSE_Lock(
void);
444 void DropTSE_Lock(
void);
449 template<
class TScopeInfo>
451 const typename TScopeInfo::TObjectInfo&
info);
452 void x_SetTSE_Lock(
const CTSE_Lock& lock);
453 void x_ResetTSE_Lock(
void);
454 void x_DetachDS(
void);
460 int x_GetDSLocksCount(
void)
const;
462 void x_InternalLockTSE(
void);
463 void x_InternalUnlockTSE(
void);
464 void x_UserLockTSE(
void);
465 void x_UserUnlockTSE(
void);
533 if (adjust != other.
adjust)
return adjust < other.
adjust;
555 return reinterpret_cast<const CBioseq_Info&
>(GetObjectInfo_Base());
566 const TIndexIds* GetIndexIds(
void)
const;
568 bool HasBioseq(
void)
const;
571 return !HasBioseq() && m_UnresolvedTimestamp != timestamp;
574 string IdString(
void)
const;
592 friend class CSeq_id_ScopeInfo;
599 m_BioseqAnnotRef_Info.Reset();
600 m_NABioseqAnnotRef_Info.clear();
CInitMutex< SAnnotSetCache > TAnnotRefInfo
CRef< CTSE_ScopeInfo > TTSE_ScopeInfo
TBlobStateFlags GetBlobState(void) const
TAnnotRefInfo m_BioseqAnnotRef_Info
TBlobStateFlags m_BlobState
const CBioseq_Info & GetObjectInfo(void) const
CBioseq_Info & GetNCObjectInfo(void)
CInitMutex< CSynonymsSet > m_SynCache
bool NeedsReResolve(int timestamp) const
CBioseq_ScopeInfo(const CBioseq_ScopeInfo &info)
atomic< int > m_UnresolvedTimestamp
const TIds & GetIds(void) const
CScopeInfo_Ref< CBioseq_ScopeInfo > TBioseq_Lock
set< CSeq_id_Handle > TSeq_idSet
vector< pair< TTSE_ScopeInfo, CSeq_id_Handle > > TTSE_MatchSet
const CBioseq_ScopeInfo & operator=(const CBioseq_ScopeInfo &info)
void x_ResetAnnotRef_Info()
map< TNASetKey, TAnnotRefInfo > TNAAnnotRefInfo
TNAAnnotRefInfo m_NABioseqAnnotRef_Info
TTSE_InfoMapMutex m_TSE_InfoMapMutex
TTSE_LockSetMutex & GetTSE_LockSetMutex(void) const
CRef< CDataSource > TDataSourceLock
const CDataSource_ScopeInfo & operator=(const CDataSource_ScopeInfo &)
pair< TSeq_annot_Lock, int > TSeq_feat_Lock
TTSE_UnlockQueue m_TSE_UnlockQueue
void UnlockedTSEsSave(void)
CDataSource_ScopeInfo(const CDataSource_ScopeInfo &)
TTSE_LockSet m_TSE_LockSet
CTSE_ScopeUserLock TTSE_Lock
TTSE_BySeqId m_TSE_BySeqId
CTSE_LockSet TTSE_LockSet
TTSE_InfoMapMutex & GetTSE_InfoMapMutex(void) const
CScope_Impl & GetScopeImpl(void) const
set< TBlobId > m_ReplacedTSEs
multimap< CSeq_id_Handle, TTSE_ScopeInfo > TTSE_BySeqId
bool CanRemoveOnResetHistory(void) const
CDataSource & GetDataSource(void)
CScopeInfo_Ref< CBioseq_ScopeInfo > TBioseq_Lock
TTSE_LockSetMutex m_TSE_LockSetMutex
pair< CConstRef< CSeq_entry_Info >, TTSE_Lock > TSeq_entry_Lock
TDataSourceLock m_DataSource
CRef< CDataSource_ScopeInfo > m_EditDS
TTSE_InfoMap m_TSE_InfoMap
void UnlockedTSEsRelease(void)
CRef< CTSE_ScopeInfo > TTSE_ScopeInfo
pair< CConstRef< CBioseq_set_Info >, TTSE_Lock > TBioseq_set_Lock
pair< CConstRef< CSeq_annot_Info >, TTSE_Lock > TSeq_annot_Lock
TTSE_LockSetMutex m_TSE_UnlockQueueMutex
map< CSeq_id_Handle, SSeqMatch_Scope > TSeqMatchMap
bool m_CanRemoveOnResetHistory
map< TBlobId, TTSE_ScopeInfo > TTSE_InfoMap
bool CanBeEdited(void) const
CDeleteQueue< const CTSE_ScopeInfo *, CTSE_ScopeInternalLock > TTSE_UnlockQueue
TQueue::iterator TQueueIter
vector< value_type > TUnlockSet
list< TQueueValue > TQueue
value_type Get(const key_type &key)
void Put(const key_type &key, const value_type &value, TUnlockSet *unlock_set=0)
void Erase(const key_type &key)
map< key_type, TQueueIter > TIndex
pair< key_type, value_type > TQueueValue
void Clear(TUnlockSet *unlock_set=0)
CDeleteQueue(size_t max_size=0)
TIndex::iterator TIndexIter
void Put(const key_type &key, const value_type &value, value_type *unlock_ptr)
TIndex::value_type TIndexValue
bool Contains(const key_type &key) const
vector< TIndexId > TIndexIds
namespace ncbi::objects::
CConstRef< CTSE_Info_Object > TScopeInfoMapKey
CDataSource_ScopeInfo & GetDSInfo(void) const
CTSE_ScopeInfo(const CTSE_ScopeInfo &)
pair< int, int > TBlobOrder
CScopeInfo_Ref< CSeq_entry_ScopeInfo > TSeq_entry_Lock
CTSE_ScopeInfo & operator=(const CTSE_ScopeInfo &)
CScopeInfo_Ref< CBioseq_set_ScopeInfo > TBioseq_set_Lock
const CTSE_Lock & GetTSE_Lock(void) const
AutoPtr< SUnloadedInfo > m_UnloadedInfo
bool CanBeUnloaded(void) const
CScopeInfo_Ref< CBioseq_ScopeInfo > TBioseq_Lock
map< TScopeInfoMapKey, TScopeInfoMapValue > TScopeInfoMap
atomic< bool > m_TSE_LockAssigned
int GetLoadIndex(void) const
atomic< Int8 > m_TSE_LockCounter
CRef< CScopeInfo_Base > TScopeInfoMapValue
CMutex m_ScopeInfoMapMutex
vector< CSeq_id_Handle > TSeqIds
bool IsUserLocked(void) const
atomic< Int8 > m_UserLockCounter
const CTSE_ScopeInfo * m_UsedByTSE
bool CanBeEdited(void) const
multimap< CSeq_id_Handle, CRef< CBioseq_ScopeInfo > > TBioseqById
CScope_Impl & GetScopeImpl(void) const
TUsedTSE_LockSet m_UsedTSE_Set
map< CConstRef< CObject >, CRef< CObject > > TEditInfoMap
CDataSource_ScopeInfo * m_DS_Info
bool IsAttached(void) const
CConstRef< CTSE_ScopeInfo > TUsedTSE_LockKey
map< TUsedTSE_LockKey, CTSE_ScopeInternalLock > TUsedTSE_LockSet
TScopeInfoMap m_ScopeInfoMap
CScopeInfo_Ref< CSeq_annot_ScopeInfo > TSeq_annot_Lock
TUnlockedTSEsLock m_UnlockedTSEsLock
vector< CTSE_ScopeInternalLock > TUnlockedTSEsInternal
vector< CConstRef< CTSE_Info > > TUnlockedTSEsLock
static void SaveInternal(const CTSE_ScopeInternalLock &lock)
TUnlockedTSEsInternal m_UnlockedTSEsInternal
static void SaveLock(const CTSE_Lock &lock)
~CUnlockedTSEsGuard(void)
container_type::iterator iterator
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
const_iterator find(const key_type &key) const
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
#define NCBI_XOBJMGR_EXPORT
const struct ncbi::grid::netcache::search::fields::KEY key
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Multi-threading – mutexes; rw-locks; semaphore.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
static int match(register const pcre_uchar *eptr, register const pcre_uchar *ecode, const pcre_uchar *mstart, int offset_top, match_data *md, eptrblock *eptrb, unsigned int rdepth)
@ Resolve
Try to resolve provided seq-ids.
atomic< int > m_SearchTimestamp
SAnnotSelector::TNamedAnnotAccessions accessions
bool operator<(const SNASetKey &other) const
CRef< CDataSource > m_Source
CInitMutex< CBioseq_ScopeInfo > m_Bioseq_Info
void x_ResetAnnotRef_Info()
CBioseq_ScopeInfo::TAnnotRefInfo m_AllAnnotRef_Info
CBioseq_ScopeInfo::TNAAnnotRefInfo m_NAAllAnnotRef_Info