SessionGuardBase Class Reference

Inheritance diagram for SessionGuardBase:

Inheritance graph
[legend]
Collaboration diagram for SessionGuardBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

Synchronize access to the database: base class.

Definition at line 53 of file contractadmin-server.h.

Public Member Functions

Protected Member Functions

Private Member Functions

Private Attributes

Static Private Attributes

Friends


Constructor & Destructor Documentation

SessionGuardBase::SessionGuardBase ( bool  noWait  ) 

virtual SessionGuardBase::~SessionGuardBase (  )  [pure virtual]

SessionGuardBase::SessionGuardBase ( const SessionGuardBase  )  [private]

SessionGuardBase::SessionGuardBase (  )  [protected]

Default contructor.

Attention:
Clients must call lock() before using get().

SessionGuardBase::SessionGuardBase ( bool  noWait  )  [protected]

Constructor: locks the mutex.

Parameters:
noWait Don't wait for database locks?
Exceptions:
OsbException from lock().

virtual SessionGuardBase::~SessionGuardBase (  )  [protected, pure virtual]

Destructor: unlock the mutex.

SessionGuardBase::SessionGuardBase ( const SessionGuardBase  )  [private]

Prevent copying: not implemented.


Member Function Documentation

OSB_DB::Session& SessionGuardBase::get (  )  [protected]

Get the database session.

Exceptions:
OsbException if locked_ is false.

Reimplemented in ReadSession, WriteSession, ReadSession, and WriteSession.

OSB_DB::Session& SessionGuardBase::get (  )  [protected]

Reimplemented in ReadSession, WriteSession, ReadSession, and WriteSession.

Referenced by WriteSession::get(), ReadSession::get(), and WriteSession::getConst().

void SessionGuardBase::lock ( bool  noWait  )  [protected]

Constructor: locks the mutex.

Parameters:
noWait Don't wait for database locks?
Exceptions:
OsbException if the lock can not be aquired.
OsbException if pSession_ is 0.

Reimplemented in ReadSession, and WriteSession.

bool SessionGuardBase::locked (  )  const [protected]

Guard locked?

Reimplemented in ReadSession, and WriteSession.

SessionGuardBase& SessionGuardBase::operator= ( const SessionGuardBase  )  [private]

Prevent assignment: not implemented.

SessionGuardBase& SessionGuardBase::operator= ( const SessionGuardBase  )  [private]


Friends And Related Function Documentation

int main ( int  ,
char **   
) [friend]

Allow to set pSession_.


Member Data Documentation

bool SessionGuardBase::locked_ [private]

Flag the mutex was locked.

Definition at line 182 of file rqsglobal.h.

static OSB_LIB::Mutex SessionGuardBase::mutex_ [static, private]

Mutex used to synchronize.

Definition at line 54 of file contractadmin-server.h.

OSB_DB::Session* SessionGuardBase::pSession_ [static, private]

Pointer to the database session: set by main.

Definition at line 138 of file rqsglobal.h.

OSB_DB::Session* SessionGuardBase::pSession_ [private]

Definition at line 67 of file contractadmin-server.h.


The documentation for this class was generated from the following files:
Generated on Sat Sep 2 14:26:50 2006 for OSB Library by  doxygen 1.4.7