Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

keylocker Class Reference

class supports the locking on demand functionality More...

#include <keymaker.h>

List of all members.

Public Member Functions

 keylocker (size_t capacity=os_def_size)
 constructor
bool enter (size_t timeout) const
 read-only lock
void leave () const
 read-only unlock
bool lock (size_t timeout) const
 writes lock
void unlock () const
 writes unlock

Private Attributes

const size_t _capacity
 max read-onlyy clients allowed
bool _opened
 flag if read-only door is open
size_t _clients
 number read-only clients entered
event _ev_open
 signal to client that locker is open
event _ev_close
 signal to server that all clients left locker
event _ev_client
 signal to client that any client left locker
event _ev_server
 signal to server that one server unlock locker
mutex _access_mtx
 access to resources
mutex _server_mtx
 multiple server exclusion


Detailed Description

class supports the locking on demand functionality

Definition at line 38 of file keymaker.h.


Constructor & Destructor Documentation

BEGIN_TERIMBER_NAMESPACE keylocker::keylocker ( size_t  capacity = os_def_size  )  [inline]

constructor

Parameters:
capacity  max locker capacity for read-only locks

Definition at line 38 of file keymaker.hpp.


Member Function Documentation

bool keylocker::enter ( size_t  timeout  )  const [inline]

bool keylocker::lock ( size_t  timeout  )  const [inline]

void keylocker::unlock (  )  const [inline]


Member Data Documentation

const size_t keylocker::_capacity [private]

max read-onlyy clients allowed

Definition at line 66 of file keymaker.h.

Referenced by enter().

bool keylocker::_opened [mutable, private]

flag if read-only door is open

Definition at line 67 of file keymaker.h.

Referenced by enter(), leave(), lock(), and unlock().

size_t keylocker::_clients [mutable, private]

number read-only clients entered

Definition at line 68 of file keymaker.h.

Referenced by enter(), leave(), and lock().

signal to client that locker is open

Definition at line 69 of file keymaker.h.

Referenced by enter(), lock(), and unlock().

signal to server that all clients left locker

Definition at line 70 of file keymaker.h.

Referenced by leave(), and lock().

signal to client that any client left locker

Definition at line 71 of file keymaker.h.

Referenced by enter(), and leave().

signal to server that one server unlock locker

Definition at line 72 of file keymaker.h.

Referenced by lock(), and unlock().

access to resources

Definition at line 73 of file keymaker.h.

Referenced by enter(), leave(), lock(), and unlock().

multiple server exclusion

Definition at line 74 of file keymaker.h.

Referenced by lock(), and unlock().


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


© Copyright Terimber 2003-.