UNIVERS
15.3
UNIVERS base processing software API
|
#include <tr_bodies_cache_qsql.hpp>
Public Member Functions | |
TrBodiesCacheQSql () | |
TrBodiesCacheQSql (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 TrBody & | get (const DbIndex &id) |
void | update (const DbIndex &id, const TrBody &body) |
DbIndex | append (const TrBody &body) |
void | clear () |
void | flush () |
ErrCode | lastError () const |
Protected Member Functions | |
ErrCode | db_get_body (const DbIndex &trace_id, TrBody &body) |
ErrCode | db_update_body (const DbIndex &trace_id, const TrBody &body) |
ErrCode | db_append_body (const TrBody &body, DbIndex &trace_id) |
Protected Attributes | |
LRUCache< DbIndex, hds::db::TrBody > | m_cache |
SeismicQSql * | mp_seis |
ErrCode | m_last_error |
QSqlQuery | m_get_body_query |
QSqlQuery | m_update_body_query |
QSqlQuery | m_append_body_query |
Cached access to traces bodies.
hds::db::TrBodiesCacheQSql::TrBodiesCacheQSql | ( | ) |
Default empty cache constructur.
hds::db::TrBodiesCacheQSql::TrBodiesCacheQSql | ( | 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 body. lastError() gets correpondent error code.
void hds::db::TrBodiesCacheQSql::clear | ( | ) |
Clear cache data. Can't generate any error.
void hds::db::TrBodiesCacheQSql::flush | ( | ) |
Flush all unsaved data into database. lastError() gets correpondent error code.
Get body with provided id. On error return empty body
and lastError() gets correpondent error code.
void hds::db::TrBodiesCacheQSql::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 body with provided id. On error return default header
and lastError() gets correpondent error code.
|
protected |
< Cache storage. Current seismic object.
|
protected |
Current last error.