UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hds::db::TrBodiesCacheQSql Class Reference

#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 TrBodyget (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
 
SeismicQSqlmp_seis
 
ErrCode m_last_error
 
QSqlQuery m_get_body_query
 
QSqlQuery m_update_body_query
 
QSqlQuery m_append_body_query
 

Detailed Description

Cached access to traces bodies.

Constructor & Destructor Documentation

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.

Member Function Documentation

DbIndex hds::db::TrBodiesCacheQSql::append ( const TrBody body)
Append new body. lastError() gets correpondent error code.
Returns
index of trace for header appended.
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.

const TrBody& hds::db::TrBodiesCacheQSql::get ( const DbIndex id)
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.

ErrCode hds::db::TrBodiesCacheQSql::lastError ( ) const
inline
Get current error code. 
Returns
EC_NO_ERROR if the last interaction with object is correct. Otherwise return correspondent error code.
void hds::db::TrBodiesCacheQSql::update ( const DbIndex id,
const TrBody body 
)
Update body with provided id. On error return default header 

and lastError() gets correpondent error code.

Member Data Documentation

LRUCache<DbIndex, hds::db::TrBody> hds::db::TrBodiesCacheQSql::m_cache
protected

< Cache storage. Current seismic object.

SeismicQSql* hds::db::TrBodiesCacheQSql::mp_seis
protected

Current last error.


The documentation for this class was generated from the following file: