C12Adapter Opensource C++ Interface
MEvent Class Reference

Class that supports event paradigm, synchronizer kind. More...

Inheritance diagram for MEvent:

Public Member Functions

 MEvent (bool setInitially=false, bool manualClear=false)
 Constructor that creates the event. More...
 
virtual ~MEvent ()
 Destructor.
 
void Set ()
 Set the event into signaled state. More...
 
void Clear ()
 Clear the event from signaled state. More...
 
virtual void Unlock ()
 The implementation of this virtual clears the event. More...
 
- Public Member Functions inherited from MSynchronizer
void Lock ()
 Lock without timeout. More...
 
bool LockWithTimeout (long timeout)
 

Additional Inherited Members

- Static Public Member Functions inherited from MSynchronizer
static void WaitForAll (MSynchronizer *p0, MSynchronizer *p1, MSynchronizer *p2=0, MSynchronizer *p3=NULL, MSynchronizer *p4=NULL)
 Wait until all the objects in the list are set to nonsignaled state. More...
 
static bool WaitWithTimeoutForAll (long timeout, MSynchronizer *p0, MSynchronizer *p1, MSynchronizer *p2=0, MSynchronizer *p3=NULL, MSynchronizer *p4=NULL)
 Wait until all the objects in the list are set to nonsignaled state, or timeout expires. More...
 
static unsigned WaitForAny (MSynchronizer *p0, MSynchronizer *p1, MSynchronizer *p2=NULL, MSynchronizer *p3=NULL, MSynchronizer *p4=NULL)
 Wait until any of the objects in the list are set to nonsignaled state. More...
 
static bool WaitWithTimeoutForAny (long timeout, unsigned *which, MSynchronizer *p0, MSynchronizer *p1, MSynchronizer *p2=0, MSynchronizer *p3=NULL, MSynchronizer *p4=NULL)
 Wait until any of the objects in the list are set to nonsignaled state, or timeout expires. More...
 
- Protected Member Functions inherited from MSynchronizer
 MSynchronizer ()
 Constructor that creates synchronizer. More...
 
virtual ~MSynchronizer ()
 Destructor.
 

Detailed Description

Class that supports event paradigm, synchronizer kind.

The implementation of the class is system dependent.

Constructor & Destructor Documentation

MEvent::MEvent ( bool  setInitially = false,
bool  manualClear = false 
)

Constructor that creates the event.

The event can be set to signaled state initially, starting from its creation. Also, if the event is with manual clearing, the only way to clear the event is with Clear service, otherwise the event will be cleared as soon as someone has waited till the event.

Note that the name for the event is a system dependent parameter.

Precondition
Resources should allow creating the event.

Member Function Documentation

void MEvent::Clear ( )

Clear the event from signaled state.

Precondition
The event shall be successfully created, or a system exception takes place.
void MEvent::Set ( )

Set the event into signaled state.

Precondition
The event shall be successfully created, or a system exception takes place.
virtual void MEvent::Unlock ( )
virtual

The implementation of this virtual clears the event.

Precondition
The event shall be successfully created, or a system exception takes place. The count has to be one, the other value will raise an exception.

Implements MSynchronizer.