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 | Static Protected Member Functions | Protected Attributes | Friends | List of all members
hds::db::ProjectQSql Class Reference

#include <project_qsql.hpp>

Inheritance diagram for hds::db::ProjectQSql:
hds::db::Project hds::db::QSqlImpl hds::db::Object

Public Member Functions

 ProjectQSql (const ContextQSql &dbc)
 
virtual ~ProjectQSql ()
 
virtual ErrCode open (const std::string &name, OpenMode mode)
 
virtual ErrCode close ()
 
virtual ErrCode flush ()
 
virtual std::string name (ErrCode *rc=NULL) const
 
virtual ErrCode setName (const std::string &name_str)
 
virtual ErrCode remove (const std::string &name)
 
virtual ErrCode getList (Names &list) const
 
virtual size_t dataSize (const std::string &name, ErrCode *rc=NULL) const
 
virtual time_t creationTime (const std::string &name, ErrCode *rc=NULL) const
 
virtual time_t modificationTime (const std::string &name, ErrCode *rc=NULL) const
 
virtual ErrCode setCreator (const std::string &creator_str)
 
virtual std::string creator (ErrCode *rc=NULL) const
 
virtual ErrCode setDescription (const std::string &descr_str)
 
virtual std::string description (ErrCode *rc=NULL) const
 
- Public Member Functions inherited from hds::db::Project
 Project ()
 
virtual ~Project ()
 
- 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 Member Functions

size_t get_seis_data_size (const std::string &name, ErrCode *rc) const
 
ErrCode clear_seismics (const ContextQSql &dbc, const std::string &project_name)
 
- 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
 

Static Protected Member Functions

static ErrCode name2id (QSqlDatabase &db, const std::string &name, DbIndex &id)
 
static ErrCode db_update_time_stamp (QSqlDatabase &db, const DbIndex &id)
 

Protected Attributes

DbIndex m_cur_project_id
 
- 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 SeismicQSql
 

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
 

Detailed Description

Project data access using qt sql technology.

Constructor & Destructor Documentation

hds::db::ProjectQSql::ProjectQSql ( const ContextQSql dbc)

Constructor with data base context provided.

virtual hds::db::ProjectQSql::~ProjectQSql ( )
virtual

Close opened data and destruct object.

Member Function Documentation

ErrCode hds::db::ProjectQSql::clear_seismics ( const ContextQSql dbc,
const std::string &  project_name 
)
protected
Clear all seismic in the project with provided name. 
Parameters
dbcDatabase context.
project_nameName of the project.
Returns
EC_NO_ERROR on success, correspondent error code otherwise.
virtual ErrCode hds::db::ProjectQSql::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::ProjectQSql::creationTime ( const std::string &  name,
ErrCode rc = NULL 
) const
virtual
Get creation time of the object with provided name.

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

Implements hds::db::Object.

virtual std::string hds::db::ProjectQSql::creator ( ErrCode rc = NULL) const
virtual
Get creator of the project. 

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

Implements hds::db::Project.

virtual size_t hds::db::ProjectQSql::dataSize ( const std::string &  name,
ErrCode rc = NULL 
) const
virtual
Get size of the object data in bytes. 
Parameters
nameName of the project.
prcResulted error code if provided.
Returns
Data size in bytes.

Implements hds::db::Object.

static ErrCode hds::db::ProjectQSql::db_update_time_stamp ( QSqlDatabase &  db,
const DbIndex id 
)
staticprotected
Update modification time for current time for project with provided id. 

Return EC_NO_ERROR if all good.

virtual std::string hds::db::ProjectQSql::description ( ErrCode rc = NULL) const
virtual
Get description of the project. 

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

Implements hds::db::Project.

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

Implements hds::db::Object.

size_t hds::db::ProjectQSql::get_seis_data_size ( const std::string &  name,
ErrCode rc 
) const
protected
Get size of seismics inside current project in bytes. 
Parameters
prcResulted error code if provided.
Returns
Data size in bytes.
virtual ErrCode hds::db::ProjectQSql::getList ( Names list) const
virtual
Get list of data base objects names for current context.

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

Implements hds::db::Object.

virtual time_t hds::db::ProjectQSql::modificationTime ( const std::string &  name,
ErrCode rc = NULL 
) const
virtual
Get modification time of the object with provided name.

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

Implements hds::db::Object.

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

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

Implements hds::db::Object.

static ErrCode hds::db::ProjectQSql::name2id ( QSqlDatabase &  db,
const std::string &  name,
DbIndex id 
)
staticprotected

Get id of project with provided name. Return EC_NO_ERROR if all good.

virtual ErrCode hds::db::ProjectQSql::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. Temporary projects (mode = OM_TMP) not supported now.

Implements hds::db::Object.

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

otherwise return correspondent error code.

Implements hds::db::Object.

virtual ErrCode hds::db::ProjectQSql::setCreator ( const std::string &  creator_str)
virtual
Set creator of the project. 

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

Implements hds::db::Project.

virtual ErrCode hds::db::ProjectQSql::setDescription ( const std::string &  descr_str)
virtual
Set description of the project. 

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

Implements hds::db::Project.

virtual ErrCode hds::db::ProjectQSql::setName ( const std::string &  name_str)
virtual
Set name of the project (rename). 

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

Implements hds::db::Object.

Member Data Documentation

DbIndex hds::db::ProjectQSql::m_cur_project_id
protected

< Current id of the project if opened.


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