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

#include <locker.hpp>

Inheritance diagram for hds::db::Locker:
hds::db::LockerQSql

Public Member Functions

 Locker ()
 
virtual ~Locker ()
 
virtual DbIndex lock (const LockDescription &ld)=0
 
virtual void release (const DbIndex &id)=0
 
virtual size_t releaseAll ()=0
 
virtual void list (LockDescriptionVec &locks)=0
 
virtual ErrCode lastError () const =0
 

Detailed Description

Qt SQL database locker.

Constructor & Destructor Documentation

hds::db::Locker::Locker ( )

Default constructor.

virtual hds::db::Locker::~Locker ( )
virtual

Destroy object.

Member Function Documentation

virtual ErrCode hds::db::Locker::lastError ( ) const
pure virtual

Get the last error occurred.

Implemented in hds::db::LockerQSql.

virtual void hds::db::Locker::list ( LockDescriptionVec locks)
pure virtual
Get list of database locks. lastError() should return: 

EC_UNDEFINED on internal error, EC_NO_ERROR on success.

Parameters
locksResulted list of locks.

Implemented in hds::db::LockerQSql.

virtual DbIndex hds::db::Locker::lock ( const LockDescription ld)
pure virtual
Try to obtain a lock with provided description. lastError() should return: 

EC_LOCKED_READ if can't obtain lock because provided name locked for reading, EC_LOCKED_WRITE if can't obtain lock because provided name locked for writing, EC_UNDEFINED on internal error, EC_NO_ERROR if lock is obtained successfully.

Parameters
lock_descrDescription of the lock.
Returns
Uniq index of lock obtained on success. Has no means on error.

Implemented in hds::db::LockerQSql.

virtual void hds::db::Locker::release ( const DbIndex id)
pure virtual
Tries to release lock with provided id. lastError() should return: 

EC_UNDEFINED on internal error, EC_NO_ERROR on success.

Parameters
idUniq index of lock to be released.

Implemented in hds::db::LockerQSql.

virtual size_t hds::db::Locker::releaseAll ( )
pure virtual
Tries to release all locks. lastError() may return: 

EC_UNDEFINED on internal error, EC_NO_ERROR on success.

Returns
number of locks released.

Implemented in hds::db::LockerQSql.


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