NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
CAsnCache_DataLoader Class Reference

Search Toolkit Book for CAsnCache_DataLoader

#include <objtools/data_loaders/asn_cache/asn_cache_loader.hpp>

+ Inheritance diagram for CAsnCache_DataLoader:
+ Collaboration diagram for CAsnCache_DataLoader:

Classes

struct  SCacheInfo
 

Public Types

typedef SRegisterLoaderInfo< CAsnCache_DataLoaderTRegisterLoaderInfo
 
typedef CSimpleLoaderMaker< CAsnCache_DataLoaderTSimpleMaker
 
typedef CParamLoaderMaker< CAsnCache_DataLoader, stringTDbMaker
 
- Public Types inherited from CDataLoader
enum  EChoice {
  eBlob , eBioseq , eCore , eBioseqCore ,
  eSequence , eFeatures , eGraph , eAlign ,
  eAnnot , eExtFeatures , eExtGraph , eExtAlign ,
  eExtAnnot , eOrphanAnnot , eAll
}
 main blob is blob with sequence all other blobs are external and contain external annotations More...
 
typedef CTSE_Lock TTSE_Lock
 
typedef set< TTSE_LockTTSE_LockSet
 
typedef CRef< CTSE_Chunk_InfoTChunk
 
typedef vector< TChunkTChunkSet
 
typedef set< stringTProcessedNAs
 
typedef set< CSeq_id_HandleTSeq_idSet
 
typedef vector< CSeq_id_HandleTIds
 
typedef vector< boolTLoaded
 Bulk loading interface for a small pieces of information per id. More...
 
typedef vector< TIdsTBulkIds
 
typedef vector< TGiTGis
 
typedef vector< stringTLabels
 
typedef vector< TTaxIdTTaxIds
 
typedef vector< TSeqPosTSequenceLengths
 
typedef vector< CSeq_inst::TMolTSequenceTypes
 
typedef vector< intTSequenceStates
 
typedef vector< intTSequenceHashes
 
typedef vector< boolTHashKnown
 
typedef map< CSeq_id_Handle, TTSE_LockSetTTSE_LockSets
 
typedef vector< vector< CSeq_id_Handle > > TSeqIdSets
 
typedef vector< CTSE_LockTCDD_Locks
 
typedef CBlobIdKey TBlobId
 
typedef int TBlobVersion
 
typedef CRef< IEditSaverTEditSaver
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CAsnCache_DataLoader (void)
 
virtual ~CAsnCache_DataLoader (void)
 
CDataLoader interface methods
virtual TTSE_LockSet GetRecords (const CSeq_id_Handle &idh, EChoice choice)
 Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call will be added to the tse_set. More...
 
virtual void GetIds (const CSeq_id_Handle &idh, TIds &ids)
 
virtual TSeqPos GetSequenceLength (const CSeq_id_Handle &idh)
 Request for a length of a sequence. More...
 
virtual TGi GetGi (const CSeq_id_Handle &idh)
 Request for a gi of a sequence. More...
 
virtual TTaxId GetTaxId (const CSeq_id_Handle &idh)
 Request for a taxonomy id of a sequence. More...
 
virtual bool CanGetBlobById () const
 
virtual TBlobId GetBlobId (const CSeq_id_Handle &idh)
 
virtual TTSE_Lock GetBlobById (const TBlobId &blob_id)
 
- Public Member Functions inherited from CDataLoader
virtual ~CDataLoader (void)
 
TTSE_LockSet GetRecordsNoBlobState (const CSeq_id_Handle &idh, EChoice choice)
 The same as GetRecords() but always returns empty TSE lock set instead of throwing CBlobStateException. More...
 
virtual TTSE_LockSet GetDetailedRecords (const CSeq_id_Handle &idh, const SRequestDetails &details)
 Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call will be added to the tse_set. More...
 
virtual TTSE_LockSet GetExternalRecords (const CBioseq_Info &bioseq)
 Request from a datasource set of blobs with external annotations. More...
 
virtual TTSE_LockSet GetOrphanAnnotRecords (const CSeq_id_Handle &idh, const SAnnotSelector *sel)
 old Get*AnnotRecords() methods More...
 
virtual TTSE_LockSet GetExternalAnnotRecords (const CSeq_id_Handle &idh, const SAnnotSelector *sel)
 
virtual TTSE_LockSet GetExternalAnnotRecords (const CBioseq_Info &bioseq, const SAnnotSelector *sel)
 
virtual TTSE_LockSet GetOrphanAnnotRecordsNA (const CSeq_id_Handle &idh, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
 new Get*AnnotRecords() methods More...
 
virtual TTSE_LockSet GetOrphanAnnotRecordsNA (const TSeq_idSet &ids, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
 
virtual TTSE_LockSet GetExternalAnnotRecordsNA (const CSeq_id_Handle &idh, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
 
virtual TTSE_LockSet GetExternalAnnotRecordsNA (const CBioseq_Info &bioseq, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
 
virtual void GetIds (const CSeq_id_Handle &idh, TIds &ids)
 Request for a list of all Seq-ids of a sequence. More...
 
bool SequenceExists (const CSeq_id_Handle &idh)
 helper function to check if sequence exists, uses GetIds() More...
 
virtual CSeq_id_Handle GetAccVer (const CSeq_id_Handle &idh)
 Request for a accession.version Seq-id of a sequence. More...
 
virtual SAccVerFound GetAccVerFound (const CSeq_id_Handle &idh)
 
virtual SGiFound GetGiFound (const CSeq_id_Handle &idh)
 
virtual string GetLabel (const CSeq_id_Handle &idh)
 Request for a label string of a sequence. More...
 
virtual CSeq_inst::TMol GetSequenceType (const CSeq_id_Handle &idh)
 Request for a type of a sequence Returns CSeq_inst::eMol_not_set if sequence is not known. More...
 
virtual STypeFound GetSequenceTypeFound (const CSeq_id_Handle &idh)
 
virtual int GetSequenceState (const CSeq_id_Handle &idh)
 Request for a state of a sequence. More...
 
virtual int GetSequenceHash (const CSeq_id_Handle &idh)
 Request for a sequence hash. More...
 
virtual SHashFound GetSequenceHashFound (const CSeq_id_Handle &idh)
 
virtual void GetBulkIds (const TIds &ids, TLoaded &loaded, TBulkIds &ret)
 Bulk request for all Seq-ids of a set of sequences. More...
 
virtual void GetAccVers (const TIds &ids, TLoaded &loaded, TIds &ret)
 Bulk request for accession.version Seq-ids of a set of sequences. More...
 
virtual void GetGis (const TIds &ids, TLoaded &loaded, TGis &ret)
 Bulk request for gis of a set of sequences. More...
 
virtual void GetLabels (const TIds &ids, TLoaded &loaded, TLabels &ret)
 Bulk request for label strings of a set of sequences. More...
 
virtual void GetTaxIds (const TIds &ids, TLoaded &loaded, TTaxIds &ret)
 Bulk request for taxonomy ids of a set of sequences. More...
 
virtual void GetSequenceLengths (const TIds &ids, TLoaded &loaded, TSequenceLengths &ret)
 Bulk request for lengths of a set of sequences. More...
 
virtual void GetSequenceTypes (const TIds &ids, TLoaded &loaded, TSequenceTypes &ret)
 Bulk request for types of a set of sequences. More...
 
virtual void GetSequenceStates (const TIds &ids, TLoaded &loaded, TSequenceStates &ret)
 Bulk request for states of a set of sequences. More...
 
virtual void GetSequenceHashes (const TIds &ids, TLoaded &loaded, TSequenceHashes &ret, THashKnown &known)
 Bulk request for hashes of a set of sequences. More...
 
virtual void GetCDDAnnots (const TSeqIdSets &id_sets, TLoaded &loaded, TCDD_Locks &ret)
 
virtual void GetBlobs (TTSE_LockSets &tse_sets)
 
virtual TBlobId GetBlobIdFromString (const string &str) const
 
virtual TBlobVersion GetBlobVersion (const TBlobId &id)
 
virtual SRequestDetails ChoiceToDetails (EChoice choice) const
 
virtual EChoice DetailsToChoice (const SRequestDetails::TAnnotSet &annots) const
 
virtual EChoice DetailsToChoice (const SRequestDetails &details) const
 
virtual void GetChunk (TChunk chunk_info)
 
virtual void GetChunks (const TChunkSet &chunks)
 
virtual void DropTSE (CRef< CTSE_Info > tse_info)
 
void SetTargetDataSource (CDataSource &data_source)
 Specify datasource to send loaded data to. More...
 
string GetName (void) const
 
virtual TTSE_Lock ResolveConflict (const CSeq_id_Handle &id, const TTSE_LockSet &tse_set)
 Resolve TSE conflict *select the best TSE from the set of dead TSEs. More...
 
virtual void GC (void)
 
virtual TEditSaver GetEditSaver () const
 
virtual CObjectManager::TPriority GetDefaultPriority (void) const
 
virtual Uint4 EstimateLoadBytes (const CTSE_Chunk_Info &chunk) const
 
virtual double EstimateLoadSeconds (const CTSE_Chunk_Info &chunk, Uint4 bytes) const
 
virtual unsigned GetDefaultBlobCacheSizeLimit () const
 
virtual bool GetTrackSplitSeq () const
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Static Public Member Functions

static TRegisterLoaderInfo RegisterInObjectManager (CObjectManager &om, const string &db_path, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
 
static string GetLoaderNameFromArgs (void)
 
static string GetLoaderNameFromArgs (const string &db_path)
 
- Static Public Member Functions inherited from CDataLoader
static bool IsRequestedAnyNA (const SAnnotSelector *sel)
 
static bool IsRequestedNA (const string &na, const SAnnotSelector *sel)
 
static bool IsProcessedNA (const string &na, const TProcessedNAs *processed_nas)
 
static void SetProcessedNA (const string &na, TProcessedNAs *processed_nas)
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 

Private Types

typedef vector< AutoPtr< SCacheInfo > > TIndexMap
 

Private Member Functions

 CAsnCache_DataLoader (const string &dl_name)
 
 CAsnCache_DataLoader (const string &dl_name, const string &db_path)
 
SCacheInfox_GetIndex ()
 

Private Attributes

CFastMutex m_Mutex
 
TIndexMap m_IndexMap
 
string m_DbPath
 

Friends

class CSimpleLoaderMaker< CAsnCache_DataLoader >
 
class CParamLoaderMaker< CAsnCache_DataLoader, string >
 

Additional Inherited Members

- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CDataLoader
 CDataLoader (void)
 
 CDataLoader (const string &loader_name)
 
void SetName (const string &loader_name)
 
CDataSourceGetDataSource (void) const
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 
- Static Protected Member Functions inherited from CDataLoader
static void RegisterInObjectManager (CObjectManager &om, CLoaderMaker_Base &loader_maker, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
 Register the loader only if the name is not yet registered in the object manager. More...
 

Detailed Description

Definition at line 53 of file asn_cache_loader.hpp.

Member Typedef Documentation

◆ TDbMaker

Definition at line 91 of file asn_cache_loader.hpp.

◆ TIndexMap

Definition at line 114 of file asn_cache_loader.hpp.

◆ TRegisterLoaderInfo

Definition at line 56 of file asn_cache_loader.hpp.

◆ TSimpleMaker

Definition at line 90 of file asn_cache_loader.hpp.

Constructor & Destructor Documentation

◆ CAsnCache_DataLoader() [1/3]

CAsnCache_DataLoader::CAsnCache_DataLoader ( void  )

Definition at line 92 of file asn_cache_loader.cpp.

References m_IndexMap.

◆ ~CAsnCache_DataLoader()

CAsnCache_DataLoader::~CAsnCache_DataLoader ( void  )
virtual

Definition at line 114 of file asn_cache_loader.cpp.

◆ CAsnCache_DataLoader() [2/3]

CAsnCache_DataLoader::CAsnCache_DataLoader ( const string dl_name)
private

Definition at line 99 of file asn_cache_loader.cpp.

References m_IndexMap.

◆ CAsnCache_DataLoader() [3/3]

CAsnCache_DataLoader::CAsnCache_DataLoader ( const string dl_name,
const string db_path 
)
private

Definition at line 105 of file asn_cache_loader.cpp.

References m_IndexMap.

Member Function Documentation

◆ CanGetBlobById()

bool CAsnCache_DataLoader::CanGetBlobById ( void  ) const
virtual

Reimplemented from CDataLoader.

Definition at line 148 of file asn_cache_loader.cpp.

◆ GetBlobById()

CAsnCache_DataLoader::TTSE_Lock CAsnCache_DataLoader::GetBlobById ( const TBlobId blob_id)
virtual

◆ GetBlobId()

CAsnCache_DataLoader::TBlobId CAsnCache_DataLoader::GetBlobId ( const CSeq_id_Handle idh)
virtual

◆ GetGi()

TGi CAsnCache_DataLoader::GetGi ( const CSeq_id_Handle idh)
virtual

Request for a gi of a sequence.

Returns zero gi if sequence with requested id is not known, or if existing sequence doesn't have a gi

See also
GetGiFound()

Reimplemented from CDataLoader.

Definition at line 154 of file asn_cache_loader.cpp.

References CAsnCache_DataLoader::SCacheInfo::cache, CAsnCache_DataLoader::SCacheInfo::cache_mtx, CAsnCache::GetIdInfo(), GI_FROM, x_GetIndex(), and ZERO_GI.

◆ GetIds()

void CAsnCache_DataLoader::GetIds ( const CSeq_id_Handle idh,
TIds ids 
)
virtual

◆ GetLoaderNameFromArgs() [1/2]

string CAsnCache_DataLoader::GetLoaderNameFromArgs ( const string db_path)
static

Definition at line 86 of file asn_cache_loader.cpp.

References string.

◆ GetLoaderNameFromArgs() [2/2]

string CAsnCache_DataLoader::GetLoaderNameFromArgs ( void  )
static

Definition at line 80 of file asn_cache_loader.cpp.

Referenced by CAsnCacheTestApplication::Run().

◆ GetRecords()

CDataLoader::TTSE_LockSet CAsnCache_DataLoader::GetRecords ( const CSeq_id_Handle idh,
EChoice  choice 
)
virtual

Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call will be added to the tse_set.

The GetRecords() may throw CBlobStateException if the sequence is not available (not known or disabled), and blob state is different from minimal fState_no_data. The actual blob state can be read from the exception in this case.

Reimplemented from CDataLoader.

Definition at line 281 of file asn_cache_loader.cpp.

References CDataLoader::eAll, CDataLoader::eBioseq, CDataLoader::eBioseqCore, CDataLoader::eBlob, CDataLoader::eCore, CDataLoader::eSequence, GetBlobById(), GetBlobId(), and set< Key, Compare >::insert().

◆ GetSequenceLength()

TSeqPos CAsnCache_DataLoader::GetSequenceLength ( const CSeq_id_Handle idh)
virtual

Request for a length of a sequence.

Returns kInvalidSeqPos if sequence with requested id is not known. The result must not be kInvalidSeqPos for existing sequences

Reimplemented from CDataLoader.

Definition at line 169 of file asn_cache_loader.cpp.

References CAsnCache_DataLoader::SCacheInfo::cache, CAsnCache_DataLoader::SCacheInfo::cache_mtx, CAsnCache::GetIdInfo(), kInvalidSeqPos, and x_GetIndex().

◆ GetTaxId()

TTaxId CAsnCache_DataLoader::GetTaxId ( const CSeq_id_Handle idh)
virtual

Request for a taxonomy id of a sequence.

Returns -1 if sequence with requested id is not known. Returns 0 if existing sequence doesn't have TaxID

Reimplemented from CDataLoader.

Definition at line 211 of file asn_cache_loader.cpp.

References CAsnCache_DataLoader::SCacheInfo::cache, CAsnCache_DataLoader::SCacheInfo::cache_mtx, CAsnCache::GetIdInfo(), INVALID_TAX_ID, TAX_ID_FROM, and x_GetIndex().

◆ RegisterInObjectManager()

CAsnCache_DataLoader::TRegisterLoaderInfo CAsnCache_DataLoader::RegisterInObjectManager ( CObjectManager om,
const string db_path,
CObjectManager::EIsDefault  is_default = CObjectManager::eNonDefault,
CObjectManager::TPriority  priority = CObjectManager::kPriority_NotSet 
)
static

◆ x_GetIndex()

CAsnCache_DataLoader::SCacheInfo & CAsnCache_DataLoader::x_GetIndex ( void  )
private

Friends And Related Function Documentation

◆ CParamLoaderMaker< CAsnCache_DataLoader, string >

Definition at line 91 of file asn_cache_loader.hpp.

◆ CSimpleLoaderMaker< CAsnCache_DataLoader >

friend class CSimpleLoaderMaker< CAsnCache_DataLoader >
friend

Definition at line 91 of file asn_cache_loader.hpp.

Member Data Documentation

◆ m_DbPath

string CAsnCache_DataLoader::m_DbPath
private

Definition at line 117 of file asn_cache_loader.hpp.

Referenced by x_GetIndex().

◆ m_IndexMap

TIndexMap CAsnCache_DataLoader::m_IndexMap
private

Definition at line 116 of file asn_cache_loader.hpp.

Referenced by CAsnCache_DataLoader(), and x_GetIndex().

◆ m_Mutex

CFastMutex CAsnCache_DataLoader::m_Mutex
private

Definition at line 115 of file asn_cache_loader.hpp.

Referenced by x_GetIndex().


The documentation for this class was generated from the following files:
Modified on Tue Feb 27 05:56:57 2024 by modify_doxy.py rev. 669887