ESA JPIP server  0.1
ipc::RdWrLock Class Reference

IPC object that offers the functionality of a read/write lock, implemented by means of the pthread rwlock API. More...

#include <rdwr_lock.h>

Inheritance diagram for ipc::RdWrLock:
Collaboration diagram for ipc::RdWrLock:

Public Types

typedef SHARED_PTR< RdWrLockPtr
 Pointer to a RdWrLock object. More...
 
- Public Types inherited from ipc::IPCObject
typedef SHARED_PTR< IPCObjectPtr
 Pointer to an IPC object. More...
 

Public Member Functions

virtual bool Init ()
 Initializes the object. More...
 
virtual WaitResult Wait (int time_out=-1)
 Performs a wait operation with the object to get it for reading. More...
 
WaitResult WaitForWriting (int time_out=-1)
 Performs a wait operation with the object to get it for writing. More...
 
virtual bool Dispose ()
 Release the resources associated to the IPC object and sets the internal status to false. More...
 
bool Release ()
 Releases the lock. More...
 
- Public Member Functions inherited from ipc::IPCObject
 IPCObject ()
 Initializes the internal status to false. More...
 
bool IsValid ()
 Returns true if the object is valid, that is, the internal status value is true. More...
 
virtual ~IPCObject ()
 The desctructor calls the method Dispose. More...
 

Private Attributes

pthread_rwlock_t rwlock
 Read/write lock information. More...
 

Detailed Description

IPC object that offers the functionality of a read/write lock, implemented by means of the pthread rwlock API.

See also
IPCObject

Member Typedef Documentation

Pointer to a RdWrLock object.

Member Function Documentation

bool ipc::RdWrLock::Dispose ( )
virtual

Release the resources associated to the IPC object and sets the internal status to false.

Returns
true if successful.

Reimplemented from ipc::IPCObject.

bool ipc::RdWrLock::Init ( )
virtual

Initializes the object.

Returns
true if successful.

Reimplemented from ipc::IPCObject.

bool ipc::RdWrLock::Release ( )

Releases the lock.

Returns
true if successful.
WaitResult ipc::RdWrLock::Wait ( int  time_out = -1)
virtual

Performs a wait operation with the object to get it for reading.

Parameters
time_outTime out (infinite by default).
Returns
WAIT_OBJECT if successful, WAIT_TIMEOUT if time out or WAIT_ERROR is error.

Reimplemented from ipc::IPCObject.

WaitResult ipc::RdWrLock::WaitForWriting ( int  time_out = -1)

Performs a wait operation with the object to get it for writing.

Parameters
time_outTime out (infinite by default).
Returns
WAIT_OBJECT if successful, WAIT_TIMEOUT if time out or WAIT_ERROR is error.

Member Data Documentation

pthread_rwlock_t ipc::RdWrLock::rwlock
private

Read/write lock information.


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