NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
CAsnCacheStoreMany Class Reference

Search Toolkit Book for CAsnCacheStoreMany

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

+ Inheritance diagram for CAsnCacheStoreMany:
+ Collaboration diagram for CAsnCacheStoreMany:

Public Member Functions

 CAsnCacheStoreMany ()=delete
 
 CAsnCacheStoreMany (CAsnCacheStoreMany const &)=delete
 
CAsnCacheStoreManyoperator= (CAsnCacheStoreMany const &)=delete
 
 CAsnCacheStoreMany (vector< string > const &db_paths)
 
bool GetRaw (const objects::CSeq_id_Handle &id, vector< unsigned char > &buffer)
 Return the raw blob in an unformatted buffer. More...
 
bool GetMultipleRaw (const objects::CSeq_id_Handle &id, vector< vector< unsigned char >> &buffer)
 
bool GetBlob (const objects::CSeq_id_Handle &id, objects::CCache_blob &blob)
 Return the cache blob, packed and uninterpreted. More...
 
bool GetMultipleBlobs (const objects::CSeq_id_Handle &id, vector< CRef< objects::CCache_blob > > &blob)
 
bool GetSeqIds (const objects::CSeq_id_Handle &id, vector< objects::CSeq_id_Handle > &all_ids, bool cheap_only)
 Return the set of seq-ids associated with a given ID. More...
 
CRef< objects::CSeq_entry > GetEntry (const objects::CSeq_id_Handle &id)
 Check if the SeqId cache, for efficient retrieval of SeqIds, is available. More...
 
vector< CRef< objects::CSeq_entry > > GetMultipleEntries (const objects::CSeq_id_Handle &id)
 
bool GetIdInfo (const objects::CSeq_id_Handle &id, CAsnIndex::TGi &gi, time_t &timestamp)
 Return the GI and timestamp for a given seq_id. More...
 
bool GetIdInfo (const objects::CSeq_id_Handle &id, objects::CSeq_id_Handle &accession, CAsnIndex::TGi &gi, time_t &timestamp, Uint4 &sequence_length, Uint4 &tax_id)
 Return the GI and timestamp for a given seq_id. More...
 
bool GetIndexEntry (const objects::CSeq_id_Handle &id, CAsnIndex::SIndexInfo &info)
 Get the full ASN cache index entry. More...
 
bool GetMultipleIndexEntries (const objects::CSeq_id_Handle &id, vector< CAsnIndex::SIndexInfo > &info)
 
size_t GetGiCount () const
 
void EnumSeqIds (IAsnCacheStore::TEnumSeqidCallback cb) const
 
void EnumIndex (IAsnCacheStore::TEnumIndexCallback cb) const
 
- Public Member Functions inherited from IAsnCacheStore
virtual ~IAsnCacheStore ()
 

Private Attributes

std::vector< std::unique_ptr< IAsnCacheStore > > m_Stores
 
std::vector< intm_Index
 

Additional Inherited Members

- Public Types inherited from IAsnCacheStore
using TEnumSeqidCallback = std::function< void(string, uint32_t, uint64_t, uint32_t)>
 
using TEnumIndexCallback = std::function< void(string, uint32_t, uint64_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)>
 

Detailed Description

Definition at line 129 of file asn_cache_store.hpp.

Constructor & Destructor Documentation

◆ CAsnCacheStoreMany() [1/3]

CAsnCacheStoreMany::CAsnCacheStoreMany ( )
delete

◆ CAsnCacheStoreMany() [2/3]

CAsnCacheStoreMany::CAsnCacheStoreMany ( CAsnCacheStoreMany const )
delete

◆ CAsnCacheStoreMany() [3/3]

CAsnCacheStoreMany::CAsnCacheStoreMany ( vector< string > const db_paths)
explicit

Definition at line 454 of file asn_cache_store.cpp.

References m_Index, and m_Stores.

Member Function Documentation

◆ EnumIndex()

void CAsnCacheStoreMany::EnumIndex ( IAsnCacheStore::TEnumIndexCallback  cb) const
virtual

Implements IAsnCacheStore.

Definition at line 659 of file asn_cache_store.cpp.

References m_Stores.

◆ EnumSeqIds()

void CAsnCacheStoreMany::EnumSeqIds ( IAsnCacheStore::TEnumSeqidCallback  cb) const
virtual

Implements IAsnCacheStore.

Definition at line 652 of file asn_cache_store.cpp.

References m_Stores.

◆ GetBlob()

bool CAsnCacheStoreMany::GetBlob ( const objects::CSeq_id_Handle &  id,
objects::CCache_blob &  blob 
)
virtual

Return the cache blob, packed and uninterpreted.

Implements IAsnCacheStore.

Definition at line 492 of file asn_cache_store.cpp.

References i, m_Index, and m_Stores.

◆ GetEntry()

CRef< objects::CSeq_entry > CAsnCacheStoreMany::GetEntry ( const objects::CSeq_id_Handle &  id)
virtual

Check if the SeqId cache, for efficient retrieval of SeqIds, is available.

Return a blob as a CSeq_entry object.

Implements IAsnCacheStore.

Definition at line 549 of file asn_cache_store.cpp.

References i, m_Index, and m_Stores.

◆ GetGiCount()

size_t CAsnCacheStoreMany::GetGiCount ( ) const
virtual

Implements IAsnCacheStore.

Definition at line 642 of file asn_cache_store.cpp.

References m_Stores.

◆ GetIdInfo() [1/2]

bool CAsnCacheStoreMany::GetIdInfo ( const objects::CSeq_id_Handle &  id,
CAsnIndex::TGi gi,
time_t &  timestamp 
)
virtual

Return the GI and timestamp for a given seq_id.

This can be a very fast way to look up the GI for an accession.version because only the index is queried – the blob is not retrieved.

Implements IAsnCacheStore.

Definition at line 580 of file asn_cache_store.cpp.

References i, m_Index, and m_Stores.

Referenced by GetIdInfo().

◆ GetIdInfo() [2/2]

bool CAsnCacheStoreMany::GetIdInfo ( const objects::CSeq_id_Handle &  id,
objects::CSeq_id_Handle &  accession,
CAsnIndex::TGi gi,
time_t &  timestamp,
Uint4 sequence_length,
Uint4 tax_id 
)
virtual

Return the GI and timestamp for a given seq_id.

This can be a very fast way to look up the GI for an accession.version because only the index is queried – the blob is not retrieved.

Implements IAsnCacheStore.

Definition at line 597 of file asn_cache_store.cpp.

References GetIdInfo(), i, m_Index, and m_Stores.

◆ GetIndexEntry()

bool CAsnCacheStoreMany::GetIndexEntry ( const objects::CSeq_id_Handle &  id,
CAsnIndex::SIndexInfo info 
)
virtual

Get the full ASN cache index entry.

This does not retrieve the full blob and is very fast.

Implements IAsnCacheStore.

Definition at line 614 of file asn_cache_store.cpp.

References i, info, m_Index, and m_Stores.

◆ GetMultipleBlobs()

bool CAsnCacheStoreMany::GetMultipleBlobs ( const objects::CSeq_id_Handle &  id,
vector< CRef< objects::CCache_blob > > &  blob 
)
virtual

Implements IAsnCacheStore.

Definition at line 504 of file asn_cache_store.cpp.

References i, m_Index, and m_Stores.

◆ GetMultipleEntries()

vector< CRef< objects::CSeq_entry > > CAsnCacheStoreMany::GetMultipleEntries ( const objects::CSeq_id_Handle &  id)
virtual

Implements IAsnCacheStore.

Definition at line 563 of file asn_cache_store.cpp.

References entries, i, m_Index, and m_Stores.

◆ GetMultipleIndexEntries()

bool CAsnCacheStoreMany::GetMultipleIndexEntries ( const objects::CSeq_id_Handle &  id,
vector< CAsnIndex::SIndexInfo > &  info 
)
virtual

Implements IAsnCacheStore.

Definition at line 627 of file asn_cache_store.cpp.

References i, info, m_Index, and m_Stores.

◆ GetMultipleRaw()

bool CAsnCacheStoreMany::GetMultipleRaw ( const objects::CSeq_id_Handle &  id,
vector< vector< unsigned char >> &  buffer 
)
virtual

Implements IAsnCacheStore.

Definition at line 479 of file asn_cache_store.cpp.

References buffer, i, m_Index, and m_Stores.

◆ GetRaw()

bool CAsnCacheStoreMany::GetRaw ( const objects::CSeq_id_Handle &  id,
vector< unsigned char > &  buffer 
)
virtual

Return the raw blob in an unformatted buffer.

Implements IAsnCacheStore.

Definition at line 466 of file asn_cache_store.cpp.

References buffer, i, m_Index, and m_Stores.

◆ GetSeqIds()

bool CAsnCacheStoreMany::GetSeqIds ( const objects::CSeq_id_Handle &  id,
vector< objects::CSeq_id_Handle > &  all_ids,
bool  cheap_only 
)
virtual

Return the set of seq-ids associated with a given ID.

By default, if the SeqId index is not available, and the SeqIds can't be retrieved cheaply, does nothing and return false. If cheap_only is set to false, will always retrieve the SeqIds, by retrieving the full blob if that is the only available way.

Implements IAsnCacheStore.

Definition at line 524 of file asn_cache_store.cpp.

References i, m_Index, and m_Stores.

◆ operator=()

CAsnCacheStoreMany& CAsnCacheStoreMany::operator= ( CAsnCacheStoreMany const )
delete

Member Data Documentation

◆ m_Index

std::vector<int> CAsnCacheStoreMany::m_Index
private

◆ m_Stores

std::vector<std::unique_ptr<IAsnCacheStore> > CAsnCacheStoreMany::m_Stores
private

The documentation for this class was generated from the following files:
Modified on Mon May 20 05:04:41 2024 by modify_doxy.py rev. 669887