IPC object that offers the functionality of an event (Windows IPC object), implemented by means of a combination of the pthread mutex and conditional variables API.
More...
#include <event.h>
|
virtual bool | Init () |
| Initializes the object desactivated and with automatic reset. More...
|
|
bool | Init (bool manual_reset, bool initial_state=false) |
| Initializes the object. More...
|
|
virtual WaitResult | Wait (int time_out=-1) |
| Performs a wait operation with the object to get it. More...
|
|
virtual bool | Dispose () |
| Release the resources associated to the IPC object and sets the internal status to false . More...
|
|
bool | Set (bool new_state=true) |
| Sets the state of the object. More...
|
|
bool | Get () const |
| Returns the current activation state of the object. More...
|
|
bool | Pulse () |
| Generates the same result as if the event has automatic reset and the Set method is called with true , independently of the real reset type. More...
|
|
bool | Reset () |
| Desactivates the object. More...
|
|
| 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...
|
|
IPC object that offers the functionality of an event (Windows IPC object), implemented by means of a combination of the pthread mutex and conditional variables API.
- See Also
- IPCObject
Pointer to a Event object.
bool ipc::Event::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::Event::Get |
( |
| ) |
const |
|
inline |
Returns the current activation state of the object.
virtual bool ipc::Event::Init |
( |
| ) |
|
|
inlinevirtual |
Initializes the object desactivated and with automatic reset.
- Returns
true
if successful.
Reimplemented from ipc::IPCObject.
bool ipc::Event::Init |
( |
bool |
manual_reset, |
|
|
bool |
initial_state = false |
|
) |
| |
Initializes the object.
- Parameters
-
manual_reset | true if the reset is manual. |
initial_state | true if the initial state is activated. |
- Returns
true
if successful.
bool ipc::Event::Pulse |
( |
| ) |
|
Generates the same result as if the event has automatic reset and the Set
method is called with true
, independently of the real reset type.
- Returns
true
if successful.
bool ipc::Event::Reset |
( |
| ) |
|
|
inline |
Desactivates the object.
- Returns
true
if successful.
bool ipc::Event::Set |
( |
bool |
new_state = true | ) |
|
Sets the state of the object.
If it is activated (with true
) and the reset is manual, all the threads waiting for the object will be resumed. If the reset is not manual (automatic), only one thread will be resumed and the state will be set to false
again.
- Parameters
-
new_state | New state of the object. |
- Returns
true
if successful.
Performs a wait operation with the object to get it.
- Parameters
-
time_out | Time out (infinite by default). |
- Returns
WAIT_OBJECT
if successful, WAIT_TIMEOUT
if time out or WAIT_ERROR
is error.
Reimplemented from ipc::IPCObject.
pthread_cond_t ipc::Event::condv |
|
private |
Conditional variable information.
bool ipc::Event::manual_reset |
|
private |
Indicates if the event reset is manual.
pthread_mutex_t ipc::Event::mutex |
|
private |
Current activation state of the event.
The documentation for this class was generated from the following files: