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

#include <seismic_qsql.hpp>

Inheritance diagram for hds::db::SeismicQSql:
hds::db::Seismic hds::db::QSqlImpl hds::db::Object

Public Member Functions

 SeismicQSql (const ContextQSql &dbc, const std::string &project_str, const size_t hdrs_cache_size=8192, const size_t bodies_cache_size=4096)
 
virtual ~SeismicQSql ()
 
virtual ErrCode open (const std::string &name, OpenMode mode)
 
virtual ErrCode close ()
 
virtual ErrCode flush ()
 
virtual ErrCode setName (const std::string &name_str)
 
virtual std::string name (ErrCode *rc=NULL) const
 
virtual ErrCode remove (const std::string &name)
 
virtual ErrCode getList (Names &list) const
 
virtual size_t dataSize (const std::string &name, ErrCode *prc=NULL) const
 
virtual time_t creationTime (const std::string &name, ErrCode *prc=NULL) const
 
virtual time_t modificationTime (const std::string &name, ErrCode *prc=NULL) const
 
virtual DbIndex rawDbIndex (size_t id, ErrCode *prc=NULL) const
 
virtual ErrCode getVolumeHeader (VolumeHeader &vol_header) const
 
virtual size_t tracesNum (ErrCode *rc=NULL) const
 
virtual const TrHeaderrawTrHeader (const DbIndex &id, ErrCode *rc=NULL) const
 
virtual const TrBodyrawTrBody (const DbIndex &id, ErrCode *rc=NULL) const
 
virtual ErrCode setVolumeHeader (const VolumeHeader &vol_header)
 
virtual ErrCode rawSetTrHeader (const DbIndex &id, const TrHeader &hdr)
 
virtual ErrCode rawSetTrBody (const DbIndex &id, const TrBody &body)
 
virtual ErrCode appendTr (const TrHeader &header, const TrBody &body)
 
virtual ErrCode eraseTr (size_t id)
 
virtual ErrCode select (const TrSelector &selector=TrSelector())
 
virtual const TrSelectorgetSelector () const
 
const DbIndexgetCurrentSeismicId () const
 
void setBufferAllHeadersFlag (bool flag=true)
 
bool getBufferAllHeadersFlag ()
 
- Public Member Functions inherited from hds::db::Seismic
 Seismic (const std::string &project_str)
 
virtual ~Seismic ()
 
const std::string & getProject () const
 
virtual const TrHeadertrHeader (size_t id, ErrCode *prc=NULL) const
 
virtual const TrBodytrBody (size_t id, ErrCode *prc=NULL) const
 
virtual ErrCode setTrHeader (size_t id, const TrHeader &hdr)
 
virtual ErrCode setTrBody (size_t id, const TrBody &body)
 
const TrHeadergetDefaultTrHeader () const
 
- Public Member Functions inherited from hds::db::Object
 Object ()
 
virtual ~Object ()
 
virtual OpenMode openMode () const
 
virtual bool exists (const std::string &name, ErrCode *rc=NULL) const
 
- Public Member Functions inherited from hds::db::QSqlImpl
 QSqlImpl ()
 
 QSqlImpl (const ContextQSql &dbc)
 
virtual ~QSqlImpl ()
 
const ContextQSqlgetDbContext () const
 
QSqlDatabase & getDb ()
 
bool supportTransactionsFlag () const
 
ErrCode dbConnect () const
 
QMutex & getDefaultMutex () const
 

Protected Attributes

DbIndex m_cur_seismic_id
 
TrSelector m_tr_selector
 
DbIndex m_db_lock_id
 
- Protected Attributes inherited from hds::db::Seismic
std::string m_project_str
 
- Protected Attributes inherited from hds::db::Object
OpenMode m_cur_open_mode
 
- Protected Attributes inherited from hds::db::QSqlImpl
QSqlDatabase m_db
 
ContextQSql m_dbc
 
bool m_is_transaction_started
 

Friends

class ProjectQSql
 

Additional Inherited Members

- Public Types inherited from hds::db::Object
typedef std::vector< std::string > Names
 
- Public Types inherited from hds::db::QSqlImpl
enum  TableLockType { TLT_READ = 0, TLT_WRITE }
 
typedef std::vector
< TableLockDescr
TLDVec
 
- Protected Member Functions inherited from hds::db::QSqlImpl
ErrCode db_init (const hds::db::ContextQSql &context)
 
ErrCode db_close (const hds::db::ContextQSql &context)
 
ErrCode db_lock_tables (const TLDVec &tld_vec)
 
ErrCode db_release_tables_locks ()
 
ErrCode db_get_lock (const std::string &lock_name, const size_t timeout=3) const
 
ErrCode db_release_lock (const std::string &lock_name) const
 
ErrCode db_set_item_value (const std::string &table_name, const std::string &field_name, const std::string &key_name, const DbIndex &key_id, const std::string &value)
 
ErrCode db_get_item_value (const std::string &table_name, const std::string &field_name, const std::string &key_name, const DbIndex &key_id, std::string &value) const
 
time_t db_table_creation_time (const std::string &table_name, ErrCode *prc=NULL) const
 
time_t db_table_modification_time (const std::string &table_name, ErrCode *prc=NULL) const
 
quint64 db_table_size (const std::string &table_name, ErrCode *prc=NULL) const
 
size_t db_table_rows_num (const std::string &table_name, ErrCode *prc=NULL) const
 
ErrCode db_transaction_begin () const
 
ErrCode db_transaction_commit ()
 
ErrCode db_transaction_rollback ()
 
QString get_db_name_hash (const hds::db::ContextQSql &context) const
 

Detailed Description

Seismic data access.

Constructor & Destructor Documentation

hds::db::SeismicQSql::SeismicQSql ( const ContextQSql dbc,
const std::string &  project_str,
const size_t  hdrs_cache_size = 8192,
const size_t  bodies_cache_size = 4096 
)
Constructor with data base context and project provided. 
Parameters
dbcSQL Data base context.
project_strName of the project. Not actual if seismic will be opened as temporary (OM_TMP open mode). Number of cached traces. 0 or 1 => no cache.
virtual hds::db::SeismicQSql::~SeismicQSql ( )
virtual

Close opened data and destruct object.

Member Function Documentation

virtual ErrCode hds::db::SeismicQSql::appendTr ( const TrHeader header,
const TrBody body 
)
virtual
Append new trace. Return EC_NO_ERROR if all correct, otherwise 

return correspondent error code.

Implements hds::db::Seismic.

virtual ErrCode hds::db::SeismicQSql::close ( )
virtual
Try to close opened or created data. Return EC_NO_ERROR if all correct, 

otherwise return correspondent error code.

Implements hds::db::Object.

virtual time_t hds::db::SeismicQSql::creationTime ( const std::string &  name,
ErrCode prc = NULL 
) const
virtual
Get creation time of the object with provided name.
Parameters
prcif provided will be EC_NO_ERROR if all correct, otherwise will be correspondent error code.

Implements hds::db::Object.

virtual size_t hds::db::SeismicQSql::dataSize ( const std::string &  name,
ErrCode prc = NULL 
) const
virtual
Get size of seismic data in bytes. Not supported for temporary seismic.
Parameters
nameName of the project.
prcResulted error code if provided.
Returns
Data size in bytes.

Implements hds::db::Object.

virtual ErrCode hds::db::SeismicQSql::eraseTr ( size_t  id)
virtual
Erase tr with provided id. Return EC_NO_ERROR if all correct, otherwise 

return correspondent error code.

Implements hds::db::Seismic.

virtual ErrCode hds::db::SeismicQSql::flush ( )
virtual
Synchronizes modified data with database. 
Returns
EC_NO_ERROR if all done, otherwise return error code.

Implements hds::db::Object.

bool hds::db::SeismicQSql::getBufferAllHeadersFlag ( )

Get buffer all headers flag.

const DbIndex& hds::db::SeismicQSql::getCurrentSeismicId ( ) const
inline

Get current seismic database id.

virtual ErrCode hds::db::SeismicQSql::getList ( Names list) const
virtual
Get list of data base objects names for current context.

If seismic is opened as temporary then it returns a list of temporary seismics, which are not connected to any project. Return EC_NO_ERROR if all correct, otherwise return correspondent error code.

Implements hds::db::Object.

virtual const TrSelector& hds::db::SeismicQSql::getSelector ( ) const
virtual

Access to current selector object.

Implements hds::db::Seismic.

virtual ErrCode hds::db::SeismicQSql::getVolumeHeader ( VolumeHeader vol_header) const
virtual
Get volume header of the seismic. Return EC_NO_ERROR if all correct, 

otherwise return correspondent error code.

Implements hds::db::Seismic.

virtual time_t hds::db::SeismicQSql::modificationTime ( const std::string &  name,
ErrCode prc = NULL 
) const
virtual
Get modification time of the object with provided name.
Parameters
prcif provided will be EC_NO_ERROR if all correct, otherwise will be correspondent error code.

Implements hds::db::Object.

virtual std::string hds::db::SeismicQSql::name ( ErrCode rc = NULL) const
virtual
Get name of the seismic. 

rc will be EC_NO_ERROR if all correct, otherwise correspondent error code.

Implements hds::db::Object.

virtual ErrCode hds::db::SeismicQSql::open ( const std::string &  name,
OpenMode  mode 
)
virtual
Try to open data with provided name. Return EC_NO_ERROR if all correct, 

otherwise return correspondent error code.

Implements hds::db::Object.

virtual DbIndex hds::db::SeismicQSql::rawDbIndex ( size_t  id,
ErrCode prc = NULL 
) const
virtual
Get raw database index for provided index of trace. 

rc will contain error code if provided. rc = EC_NO_ERROR if all correct.

Implements hds::db::Seismic.

virtual ErrCode hds::db::SeismicQSql::rawSetTrBody ( const DbIndex id,
const TrBody body 
)
virtual

Set body of the trace with provided database raw id.

Implements hds::db::Seismic.

virtual ErrCode hds::db::SeismicQSql::rawSetTrHeader ( const DbIndex id,
const TrHeader hdr 
)
virtual

Set header of the trace with provided database raw id.

Implements hds::db::Seismic.

virtual const TrBody& hds::db::SeismicQSql::rawTrBody ( const DbIndex id,
ErrCode rc = NULL 
) const
virtual
Access to the body of the trace for reading with raw database index provided. 

rc will contain error code if provided.

Implements hds::db::Seismic.

virtual const TrHeader& hds::db::SeismicQSql::rawTrHeader ( const DbIndex id,
ErrCode rc = NULL 
) const
virtual
Access to the header of the trace for reading with raw database index provided. 

rc will contain error code if provided.

Implements hds::db::Seismic.

virtual ErrCode hds::db::SeismicQSql::remove ( const std::string &  name)
virtual
Try to remove seismic with provided name. Return EC_NO_ERROR if all correct, 

otherwise return correspondent error code.

Implements hds::db::Object.

virtual ErrCode hds::db::SeismicQSql::select ( const TrSelector selector = TrSelector())
virtual
Makes a selection with provided selector. Seismic must be opened.
Parameters
selectorSelection rules object. Empty selector by default provides raw order of traces.
Returns
EC_NO_ERROR if all correct, otherwise return correspondent error code.

Implements hds::db::Seismic.

void hds::db::SeismicQSql::setBufferAllHeadersFlag ( bool  flag = true)
Set buffer all headers flag. 

All headers read in cache while seismic open if this mode is turned on.

virtual ErrCode hds::db::SeismicQSql::setName ( const std::string &  name_str)
virtual
Set name of the seismic. 

Return EC_NO_ERROR if all correct, otherwise return correspondent error code.

Implements hds::db::Object.

virtual ErrCode hds::db::SeismicQSql::setVolumeHeader ( const VolumeHeader vol_header)
virtual
Set new volume header. Return EC_NO_ERROR if all correct, 

otherwise return correspondent error code.

Implements hds::db::Seismic.

virtual size_t hds::db::SeismicQSql::tracesNum ( ErrCode rc = NULL) const
virtual

Number of traces. rc will contain error code if provided.

Implements hds::db::Seismic.

Friends And Related Function Documentation

friend class ProjectQSql
friend

All the friends.

Member Data Documentation

DbIndex hds::db::SeismicQSql::m_cur_seismic_id
protected

< Current id of the seismic if opened. Current traces selector.

TrSelector hds::db::SeismicQSql::m_tr_selector
protected

Current database lock id.


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