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

Search Toolkit Book for CLDS2_Database

#include <objtools/lds2/lds2_db.hpp>

+ Inheritance diagram for CLDS2_Database:
+ Collaboration diagram for CLDS2_Database:

Classes

struct  SLDS2_DbConnection
 

Public Types

enum  EAccessMode { eRead , eWrite , eMemory }
 Database access mode flags. More...
 
enum  EAnnotChoice { fAnnot_Internal = 1 , fAnnot_External = 2 , fAnnot_All = fAnnot_Internal | fAnnot_External }
 Annotation type flags. More...
 
typedef set< stringTStringSet
 
typedef set< CSeq_id_HandleTSeqIdSet
 
typedef set< Int8TLdsIdSet
 List of ids (blob_id, bioseq_id, lds_id etc.) More...
 
typedef vector< CSeq_id_HandleTSeqIds
 List of seq-ids. More...
 
typedef vector< SLDS2_BlobTBlobSet
 A set of ids (file_id, blob_id etc.). More...
 
typedef int TAnnotChoice
 
typedef vector< AutoPtr< SLDS2_Annot > > TLDS2Annots
 
- 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

 CLDS2_Database (const string &db_file, EAccessMode mode=eWrite)
 
 ~CLDS2_Database (void)
 
void Create (void)
 Create the database. More...
 
void Open (EAccessMode mode=eWrite)
 Open LDS2 database. If the database does not exist, throws exception. More...
 
const stringGetDbFile (void) const
 Get database file name. More...
 
int GetSQLiteFlags (void) const
 Get SQLite flags, see CSQLITE_Connection::TOperationFlags. More...
 
void SetSQLiteFlags (int flags)
 Set SQLite flags. This funtion resets the db connection. More...
 
EAccessMode GetAccessMode (void) const
 Get current access mode. More...
 
void SetAccessMode (EAccessMode mode)
 Set new access mode, re-open the database. More...
 
void GetFileNames (TStringSet &files) const
 Get all known file names. More...
 
SLDS2_File GetFileInfo (const string &file_name) const
 Get complete file info. More...
 
void AddFile (SLDS2_File &info)
 Add new file record. On success file_info.id is not zero. More...
 
void UpdateFile (SLDS2_File &info)
 Update info for the known file. The 'id' of the info will change. More...
 
void DeleteFile (const string &file_name)
 Delete file and all related entries from the database. More...
 
void DeleteFile (Int8 file_id)
 
Int8 AddBlob (Int8 file_id, SLDS2_Blob::EBlobType blob_type, Int8 file_pos)
 Add blob, return the new blob id. More...
 
Int8 AddBioseq (Int8 blob_id, const TSeqIdSet &ids)
 Add bioseq, return the new bioseq id. More...
 
Int8 AddAnnot (SLDS2_Annot &annot)
 Add annotation, return the new annot id. More...
 
Int8 GetBioseqId (const CSeq_id_Handle &idh) const
 Check if the db contains a bioseq with the given id. More...
 
void GetSynonyms (const CSeq_id_Handle &idh, TLdsIdSet &ids)
 Get all lds-id synonyms for the seq-id (including lds-id for the seq-id itself). More...
 
void GetSynonyms (const CSeq_id_Handle &idh, TSeqIds &ids)
 Get all synonyms for the seq-id (including the original seq-id). More...
 
SLDS2_Blob GetBlobInfo (const CSeq_id_Handle &idh)
 Find blob containing the requested bioseq. More...
 
SLDS2_Blob GetBlobInfo (Int8 blob_id)
 Get blob info by blob id. More...
 
SLDS2_File GetFileInfo (Int8 file_id)
 Get file info. More...
 
void GetBioseqBlobs (const CSeq_id_Handle &idh, TBlobSet &blobs)
 Get all blobs, containing bioseqs with the seq-id. More...
 
void GetAnnotBlobs (const CSeq_id_Handle &idh, TAnnotChoice choice, TBlobSet &blobs)
 Get all blobs, containing annotations for the seq-id. More...
 
Int8 GetAnnotCountForBlob (Int8 blob_id)
 Get number of annotations grouped into a single blob. More...
 
void GetAnnots (Int8 blob_id, TLDS2Annots &infos)
 Get details about all annotations from a blob. More...
 
void AddChunk (const SLDS2_File &file_info, const SLDS2_Chunk &chunk_info)
 Store the chunk info in the database. More...
 
bool FindChunk (const SLDS2_File &file_info, SLDS2_Chunk &chunk_info, Int8 stream_pos)
 Load chunk containing the required stream position. More...
 
CRef< CSeq_idGetSeq_idForLdsSeqId (int lds_id)
 Get seq-id for the given lds-id. More...
 
void PrepareUpdate (void)
 Prepare to update the DB. More...
 
void BeginUpdate (void)
 Start update transaction. More...
 
void EndUpdate (void)
 End update transaction, commit the changes. More...
 
void CancelUpdate (void)
 Cancel the update, rollback the changes. More...
 
void BeginRead (void)
 Start reading transaction, lock the db. More...
 
void EndRead (void)
 End reading transaction, release the lock. More...
 
void Analyze (void)
 Analyze the DB. More...
 
void Dump (const string &table, CNcbiOstream &out)
 Dump the selected table (use empty string to dump table names or * to dump all tables. More...
 
- 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
 

Private Types

enum  EIdType { eIdOriginal , eIdMatch }
 
enum  EStatement {
  eSt_GetFileNames = 0 , eSt_GetFileInfoByName , eSt_GetFileInfoById , eSt_GetLdsSeqIdForIntId ,
  eSt_GetLdsSeqIdForTxtId , eSt_GetBioseqIdForIntId , eSt_GetBioseqIdForTxtId , eSt_GetSynonyms ,
  eSt_GetBlobInfo , eSt_GetBioseqForIntId , eSt_GetBioseqForTxtId , eSt_GetAnnotBlobsByIntId ,
  eSt_GetAnnotBlobsAllByIntId , eSt_GetAnnotBlobsByTxtId , eSt_GetAnnotBlobsAllByTxtId , eSt_GetAnnotCountForBlob ,
  eSt_GetAnnotInfosForBlob , eSt_AddFile , eSt_AddLdsSeqId , eSt_AddBlob ,
  eSt_AddBioseqToBlob , eSt_AddBioseqIds , eSt_AddAnnotToBlob , eSt_AddAnnotIds ,
  eSt_DeleteFileByName , eSt_DeleteFileById , eSt_AddChunk , eSt_FindChunk ,
  eSt_GetSeq_idForLdsSeqId , eSt_GetSeq_idSynonyms , eSt_StatementsCount
}
 
typedef vector< AutoPtr< CSQLITE_Statement > > TStatements
 
typedef CTls< SLDS2_DbConnectionTDbConnectionsTls
 

Private Member Functions

 CLDS2_Database (const CLDS2_Database &)
 
CLDS2_Databaseoperator= (const CLDS2_Database &)
 
void x_ExecuteSqls (const char *sqls[], size_t len)
 
CSQLITE_Statementx_InitGetBioseqsSql (const CSeq_id_Handle &idh) const
 
Int8 x_GetLdsSeqId (const CSeq_id_Handle &id, EIdType id_type)
 
CRef< CSeq_idx_BlobToSeq_id (CSQLITE_Statement &st, int size_idx, int data_idx) const
 
SLDS2_DbConnectionx_GetDbConnection (void) const
 
CSQLITE_Connectionx_GetConn (void) const
 
void x_ResetDbConnection (void)
 
CSQLITE_Statementx_GetStatement (EStatement st) const
 

Private Attributes

string m_DbFile
 
int m_DbFlags
 
CFastMutex m_DbInitMutex
 
CRef< TDbConnectionsTlsm_DbConn
 
EAccessMode m_Mode
 

Additional Inherited Members

- 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)
 
- 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 CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Definition at line 240 of file lds2_db.hpp.

Member Typedef Documentation

◆ TAnnotChoice

Definition at line 344 of file lds2_db.hpp.

◆ TBlobSet

A set of ids (file_id, blob_id etc.).

Definition at line 332 of file lds2_db.hpp.

◆ TDbConnectionsTls

Definition at line 462 of file lds2_db.hpp.

◆ TLDS2Annots

Definition at line 354 of file lds2_db.hpp.

◆ TLdsIdSet

List of ids (blob_id, bioseq_id, lds_id etc.)

Definition at line 308 of file lds2_db.hpp.

◆ TSeqIds

List of seq-ids.

Definition at line 310 of file lds2_db.hpp.

◆ TSeqIdSet

Definition at line 295 of file lds2_db.hpp.

◆ TStatements

Definition at line 453 of file lds2_db.hpp.

◆ TStringSet

Definition at line 276 of file lds2_db.hpp.

Member Enumeration Documentation

◆ EAccessMode

Database access mode flags.

Enumerator
eRead 

Read-only access.

eWrite 

Read/write access.

eMemory 

Copy db to memory and open read-only.

Definition at line 244 of file lds2_db.hpp.

◆ EAnnotChoice

Annotation type flags.

Enumerator
fAnnot_Internal 

Annots from the blob with the bioseq.

fAnnot_External 

Annots from blobs not containing the bioseq.

fAnnot_All 

Definition at line 338 of file lds2_db.hpp.

◆ EIdType

Enumerator
eIdOriginal 
eIdMatch 

Definition at line 407 of file lds2_db.hpp.

◆ EStatement

Enumerator
eSt_GetFileNames 
eSt_GetFileInfoByName 
eSt_GetFileInfoById 
eSt_GetLdsSeqIdForIntId 
eSt_GetLdsSeqIdForTxtId 
eSt_GetBioseqIdForIntId 
eSt_GetBioseqIdForTxtId 
eSt_GetSynonyms 
eSt_GetBlobInfo 
eSt_GetBioseqForIntId 
eSt_GetBioseqForTxtId 
eSt_GetAnnotBlobsByIntId 
eSt_GetAnnotBlobsAllByIntId 
eSt_GetAnnotBlobsByTxtId 
eSt_GetAnnotBlobsAllByTxtId 
eSt_GetAnnotCountForBlob 
eSt_GetAnnotInfosForBlob 
eSt_AddFile 
eSt_AddLdsSeqId 
eSt_AddBlob 
eSt_AddBioseqToBlob 
eSt_AddBioseqIds 
eSt_AddAnnotToBlob 
eSt_AddAnnotIds 
eSt_DeleteFileByName 
eSt_DeleteFileById 
eSt_AddChunk 
eSt_FindChunk 
eSt_GetSeq_idForLdsSeqId 
eSt_GetSeq_idSynonyms 
eSt_StatementsCount 

Definition at line 420 of file lds2_db.hpp.

Constructor & Destructor Documentation

◆ CLDS2_Database() [1/2]

CLDS2_Database::CLDS2_Database ( const string db_file,
EAccessMode  mode = eWrite 
)

Definition at line 59 of file lds2_db.cpp.

◆ ~CLDS2_Database()

CLDS2_Database::~CLDS2_Database ( void  )

Definition at line 67 of file lds2_db.cpp.

◆ CLDS2_Database() [2/2]

CLDS2_Database::CLDS2_Database ( const CLDS2_Database )
private

Member Function Documentation

◆ AddAnnot()

Int8 CLDS2_Database::AddAnnot ( SLDS2_Annot annot)

◆ AddBioseq()

Int8 CLDS2_Database::AddBioseq ( Int8  blob_id,
const TSeqIdSet ids 
)

◆ AddBlob()

Int8 CLDS2_Database::AddBlob ( Int8  file_id,
SLDS2_Blob::EBlobType  blob_type,
Int8  file_pos 
)

◆ AddChunk()

void CLDS2_Database::AddChunk ( const SLDS2_File file_info,
const SLDS2_Chunk chunk_info 
)

◆ AddFile()

void CLDS2_Database::AddFile ( SLDS2_File info)

◆ Analyze()

void CLDS2_Database::Analyze ( void  )

Analyze the DB.

Definition at line 1029 of file lds2_db.cpp.

References conn, and x_GetConn().

Referenced by EndUpdate().

◆ BeginRead()

void CLDS2_Database::BeginRead ( void  )

Start reading transaction, lock the db.

Definition at line 1039 of file lds2_db.cpp.

References eWrite, CSQLITE_Connection::ExecuteSql(), m_Mode, and x_GetConn().

Referenced by CLDS2_DataLoader::CLDS2_DataLoader().

◆ BeginUpdate()

void CLDS2_Database::BeginUpdate ( void  )

Start update transaction.

Definition at line 1010 of file lds2_db.cpp.

References conn, kLDS2_DropDBIdx, x_ExecuteSqls(), and x_GetConn().

Referenced by CLDS2_Manager::UpdateData().

◆ CancelUpdate()

void CLDS2_Database::CancelUpdate ( void  )

Cancel the update, rollback the changes.

◆ Create()

void CLDS2_Database::Create ( void  )

Create the database.

If the LDS2 database already exists all data will be cleaned up. Access mode is automatically set to read/write. NOTE: The function may fail if the db has been accessed from other threads and some of the threads are still alive.

Definition at line 428 of file lds2_db.cpp.

References eWrite, CFile::Exists(), Info(), kLDS2_CreateDB, LOG_POST_X, m_DbFile, CDirEntry::Remove(), SetAccessMode(), x_ExecuteSqls(), and x_ResetDbConnection().

Referenced by CLDS2_Manager::ResetData(), and CLDS2_Manager::UpdateData().

◆ DeleteFile() [1/2]

void CLDS2_Database::DeleteFile ( const string file_name)

◆ DeleteFile() [2/2]

void CLDS2_Database::DeleteFile ( Int8  file_id)

◆ Dump()

void CLDS2_Database::Dump ( const string table,
CNcbiOstream out 
)

Dump the selected table (use empty string to dump table names or * to dump all tables.

Definition at line 1060 of file lds2_db.cpp.

References CSQLITE_Statement::GetColumnName(), CSQLITE_Statement::GetColumnsCount(), CSQLITE_Statement::GetString(), i, ITERATE, kLDS2_DumpTable, kLDS2_ListTables, out(), NStr::PrintableString(), CSQLITE_Statement::Step(), table, tables(), and x_GetConn().

Referenced by CLDS2IndexerApplication::Run().

◆ EndRead()

void CLDS2_Database::EndRead ( void  )

End reading transaction, release the lock.

Definition at line 1047 of file lds2_db.cpp.

References eWrite, CSQLITE_Connection::ExecuteSql(), m_Mode, and x_GetConn().

Referenced by CLDS2_DataLoader::~CLDS2_DataLoader().

◆ EndUpdate()

void CLDS2_Database::EndUpdate ( void  )

End update transaction, commit the changes.

Definition at line 1019 of file lds2_db.cpp.

References Analyze(), conn, kLDS2_CreateDBIdx, x_ExecuteSqls(), and x_GetConn().

Referenced by CLDS2_Manager::UpdateData().

◆ FindChunk()

bool CLDS2_Database::FindChunk ( const SLDS2_File file_info,
SLDS2_Chunk chunk_info,
Int8  stream_pos 
)

◆ GetAccessMode()

EAccessMode CLDS2_Database::GetAccessMode ( void  ) const
inline

Get current access mode.

Definition at line 272 of file lds2_db.hpp.

References m_Mode.

◆ GetAnnotBlobs()

void CLDS2_Database::GetAnnotBlobs ( const CSeq_id_Handle idh,
TAnnotChoice  choice,
TBlobSet blobs 
)

◆ GetAnnotCountForBlob()

Int8 CLDS2_Database::GetAnnotCountForBlob ( Int8  blob_id)

Get number of annotations grouped into a single blob.

Definition at line 868 of file lds2_db.cpp.

References CSQLITE_Statement::Bind(), eSt_GetAnnotCountForBlob, CSQLITE_Statement::GetInt8(), CSQLITE_Statement::Reset(), CSQLITE_Statement::Step(), and x_GetStatement().

Referenced by CLDS2_DataLoader::GetChunk().

◆ GetAnnots()

void CLDS2_Database::GetAnnots ( Int8  blob_id,
TLDS2Annots infos 
)

◆ GetBioseqBlobs()

void CLDS2_Database::GetBioseqBlobs ( const CSeq_id_Handle idh,
TBlobSet blobs 
)

Get all blobs, containing bioseqs with the seq-id.

Definition at line 820 of file lds2_db.cpp.

References CSQLITE_Statement::GetInt(), CSQLITE_Statement::GetInt8(), info, CSQLITE_Statement::Reset(), CSQLITE_Statement::Step(), and x_InitGetBioseqsSql().

Referenced by CLDS2_DataLoader::GetRecords().

◆ GetBioseqId()

Int8 CLDS2_Database::GetBioseqId ( const CSeq_id_Handle idh) const

◆ GetBlobInfo() [1/2]

SLDS2_Blob CLDS2_Database::GetBlobInfo ( const CSeq_id_Handle idh)

Find blob containing the requested bioseq.

Return empty info if the seq-id is unknown or there are multiple bioseqs with the same id.

Definition at line 736 of file lds2_db.cpp.

References CSQLITE_Statement::GetInt(), CSQLITE_Statement::GetInt8(), info, CSQLITE_Statement::Reset(), CSQLITE_Statement::Step(), and x_InitGetBioseqsSql().

Referenced by CLDS2_DataLoader::GetBlobById(), CLDS2_DataLoader::GetBlobId(), and CLDS2_DataLoader::GetChunk().

◆ GetBlobInfo() [2/2]

SLDS2_Blob CLDS2_Database::GetBlobInfo ( Int8  blob_id)

◆ GetDbFile()

const string& CLDS2_Database::GetDbFile ( void  ) const
inline

Get database file name.

Definition at line 264 of file lds2_db.hpp.

References m_DbFile.

Referenced by CLDS2_Manager::GetDbFile(), CLDS2_DataLoader::GetLoaderNameFromArgs(), and CLDS2_Manager::UpdateData().

◆ GetFileInfo() [1/2]

SLDS2_File CLDS2_Database::GetFileInfo ( const string file_name) const

◆ GetFileInfo() [2/2]

SLDS2_File CLDS2_Database::GetFileInfo ( Int8  file_id)

◆ GetFileNames()

void CLDS2_Database::GetFileNames ( TStringSet files) const

◆ GetSeq_idForLdsSeqId()

CRef< CSeq_id > CLDS2_Database::GetSeq_idForLdsSeqId ( int  lds_id)

◆ GetSQLiteFlags()

int CLDS2_Database::GetSQLiteFlags ( void  ) const
inline

Get SQLite flags, see CSQLITE_Connection::TOperationFlags.

Definition at line 267 of file lds2_db.hpp.

References m_DbFlags.

◆ GetSynonyms() [1/2]

void CLDS2_Database::GetSynonyms ( const CSeq_id_Handle idh,
TLdsIdSet ids 
)

Get all lds-id synonyms for the seq-id (including lds-id for the seq-id itself).

Return empty set if there is a conflict.

Definition at line 683 of file lds2_db.cpp.

References CSQLITE_Statement::Bind(), eSt_GetSynonyms, GetBioseqId(), CSQLITE_Statement::GetInt8(), set< Key, Compare >::insert(), CSQLITE_Statement::Reset(), CSQLITE_Statement::Step(), and x_GetStatement().

Referenced by CLDS2_DataLoader::GetIds().

◆ GetSynonyms() [2/2]

void CLDS2_Database::GetSynonyms ( const CSeq_id_Handle idh,
TSeqIds ids 
)

Get all synonyms for the seq-id (including the original seq-id).

Return empty set on conflict.

Definition at line 699 of file lds2_db.cpp.

References CSQLITE_Statement::Bind(), eSt_GetSeq_idSynonyms, GetBioseqId(), CSeq_id_Handle::GetHandle(), CSQLITE_Statement::Reset(), CSQLITE_Statement::Step(), x_BlobToSeq_id(), and x_GetStatement().

◆ Open()

void CLDS2_Database::Open ( EAccessMode  mode = eWrite)

Open LDS2 database. If the database does not exist, throws exception.

Definition at line 465 of file lds2_db.cpp.

References SetAccessMode(), and x_GetConn().

Referenced by CLDS2_Manager::UpdateData().

◆ operator=()

CLDS2_Database& CLDS2_Database::operator= ( const CLDS2_Database )
private

◆ PrepareUpdate()

void CLDS2_Database::PrepareUpdate ( void  )

Prepare to update the DB.

Drop most indexes. To rebuild the indexes call Analyze.

◆ SetAccessMode()

void CLDS2_Database::SetAccessMode ( EAccessMode  mode)

Set new access mode, re-open the database.

Definition at line 456 of file lds2_db.cpp.

References m_Mode, and x_ResetDbConnection().

Referenced by Create(), and Open().

◆ SetSQLiteFlags()

void CLDS2_Database::SetSQLiteFlags ( int  flags)

Set SQLite flags. This funtion resets the db connection.

Definition at line 449 of file lds2_db.cpp.

References flags, m_DbFlags, and x_ResetDbConnection().

◆ UpdateFile()

void CLDS2_Database::UpdateFile ( SLDS2_File info)

Update info for the known file. The 'id' of the info will change.

Definition at line 498 of file lds2_db.cpp.

References AddFile(), DeleteFile(), Info(), info, and LOG_POST_X.

Referenced by CLDS2_Manager::UpdateData().

◆ x_BlobToSeq_id()

CRef< CSeq_id > CLDS2_Database::x_BlobToSeq_id ( CSQLITE_Statement st,
int  size_idx,
int  data_idx 
) const
private

◆ x_ExecuteSqls()

void CLDS2_Database::x_ExecuteSqls ( const char *  sqls[],
size_t  len 
)
private

Definition at line 419 of file lds2_db.cpp.

References conn, i, len, and x_GetConn().

Referenced by BeginUpdate(), Create(), and EndUpdate().

◆ x_GetConn()

CSQLITE_Connection & CLDS2_Database::x_GetConn ( void  ) const
private

◆ x_GetDbConnection()

CLDS2_Database::SLDS2_DbConnection & CLDS2_Database::x_GetDbConnection ( void  ) const
private

Definition at line 343 of file lds2_db.cpp.

References m_DbConn, and m_DbInitMutex.

Referenced by x_GetConn(), and x_GetStatement().

◆ x_GetLdsSeqId()

Int8 CLDS2_Database::x_GetLdsSeqId ( const CSeq_id_Handle id,
EIdType  id_type 
)
private

◆ x_GetStatement()

CSQLITE_Statement & CLDS2_Database::x_GetStatement ( EStatement  st) const
private

◆ x_InitGetBioseqsSql()

CSQLITE_Statement & CLDS2_Database::x_InitGetBioseqsSql ( const CSeq_id_Handle idh) const
private

◆ x_ResetDbConnection()

void CLDS2_Database::x_ResetDbConnection ( void  )
private

Definition at line 363 of file lds2_db.cpp.

References m_DbConn, and m_DbInitMutex.

Referenced by Create(), SetAccessMode(), and SetSQLiteFlags().

Member Data Documentation

◆ m_DbConn

CRef<TDbConnectionsTls> CLDS2_Database::m_DbConn
mutableprivate

Definition at line 478 of file lds2_db.hpp.

Referenced by x_GetDbConnection(), and x_ResetDbConnection().

◆ m_DbFile

string CLDS2_Database::m_DbFile
private

Definition at line 474 of file lds2_db.hpp.

Referenced by Create(), GetDbFile(), and x_GetConn().

◆ m_DbFlags

int CLDS2_Database::m_DbFlags
private

Definition at line 475 of file lds2_db.hpp.

Referenced by GetSQLiteFlags(), SetSQLiteFlags(), and x_GetConn().

◆ m_DbInitMutex

CFastMutex CLDS2_Database::m_DbInitMutex
mutableprivate

Definition at line 477 of file lds2_db.hpp.

Referenced by x_GetDbConnection(), and x_ResetDbConnection().

◆ m_Mode

EAccessMode CLDS2_Database::m_Mode
private

Definition at line 479 of file lds2_db.hpp.

Referenced by BeginRead(), EndRead(), GetAccessMode(), SetAccessMode(), and x_GetConn().


The documentation for this class was generated from the following files:
Modified on Thu Mar 28 17:08:35 2024 by modify_doxy.py rev. 669887