UNIVERS
15.3
UNIVERS base processing software API
|
#include <tr_hdrs_cache_qsql.hpp>
Public Member Functions | |
TrHdrsCacheQSql () | |
TrHdrsCacheQSql (SeismicQSql *pseis, const size_t read_cache_size, const size_t write_cache_size) | |
void | init (SeismicQSql *pseis, const size_t read_cache_size, const size_t write_cache_size) |
const TrHeader & | get (const DbIndex &id) |
void | update (const DbIndex &id, const TrHeader &hdr) |
DbIndex | append (const TrHeader &hdr) |
void | clear () |
void | flush () |
ErrCode | lastError () const |
Protected Member Functions | |
ErrCode | db_get_header (const DbIndex &trace_id, TrHeader &hdr) |
ErrCode | db_update_header (const DbIndex &trace_id, const TrHeader &hdr) |
ErrCode | db_append_header (const TrHeader &hdr, DbIndex &trace_id) |
ErrCode | db_cache_all_headers (LRUCache< DbIndex, TrHeader > &hdrs_cache) |
ErrCode | query2hdr (const QSqlQuery &query, TrHeader &hdr) const |
Protected Attributes | |
LRUCache< DbIndex, hds::db::TrHeader > | m_cache |
SeismicQSql * | mp_seis |
ErrCode | m_last_error |
QSqlQuery | m_get_hdr_query |
QSqlQuery | m_get_all_hdrs_query |
QSqlQuery | m_update_hdr_query |
QSqlQuery | m_append_hdr_query |
Cached access to headers.
hds::db::TrHdrsCacheQSql::TrHdrsCacheQSql | ( | ) |
Default empty cache constructur.
hds::db::TrHdrsCacheQSql::TrHdrsCacheQSql | ( | SeismicQSql * | pseis, |
const size_t | read_cache_size, | ||
const size_t | write_cache_size | ||
) |
Construct cache with seismic and sizes provided.
Seismic not copied, just store a pointer.
Append new header. lastError() gets correpondent error code.
void hds::db::TrHdrsCacheQSql::clear | ( | ) |
Clear cache data. Can't generate any error.
|
protected |
Get all headers from database and push them to cache provided.
void hds::db::TrHdrsCacheQSql::flush | ( | ) |
Flush all unsaved data into database. lastError() gets correpondent error code.
Get header with provided id. On error return default header
and lastError() gets correpondent error code.
void hds::db::TrHdrsCacheQSql::init | ( | SeismicQSql * | pseis, |
const size_t | read_cache_size, | ||
const size_t | write_cache_size | ||
) |
Initialize cache. lastError() gets correpondent error code.
|
inline |
Get current error code.
Update header with provided id. lastError() gets correpondent error code.
|
protected |
< Cache storage. Current seismic object.
|
protected |
Current last error.