Microsoft DirectX 8.0

CAMEvent Class

CAMEvent class hierarchy

Wrapper class for manual-reset and auto-reset events.

Declaration: Wxutil.h

This class provides a convenient way to manage events, rather than calling Microsoft® Win32® functions such as CreateEvent, WaitForSingleObject, and ResetEvent.

Protected Member Variables
m_hEventEvent handle.
Public Methods
CAMEventConstructor method.
~CAMEventDestructor method.
CheckChecks whether the event is set, without blocking.
ResetSets the state of the event to nonsignaled.
SetSignals the event.
WaitBlocks until the event is signaled, or until a time-out occurs.
Operators
HANDLERetrieves the event handle.

CAMEvent.m_hEvent

CAMEvent Class

Event handle.

Syntax

HANDLE m_hEvent;

CAMEvent::CAMEvent

CAMEvent Class

Constructor method.

Syntax

CAMEvent(
    BOOL fManualReset = FALSE
);

Parameters

fManualReset
Boolean value that specifies whether the object is a manual-reset event or an auto-reset event. If TRUE, the object is a manual-reset event. Otherwise, it is an auto-reset event.

Remarks

The event begins in a nonsignaled state.

With an auto-reset event, the CAMEvent::Wait method resets the event to nonsignaled when the method returns. With a manual-reset event, the event remains signaled until you call the CAMEvent::Reset method.

CAMEvent::~CAMEvent

CAMEvent Class

Destructor method.

Syntax

~CAMEvent(void);

CAMEvent::Check

CAMEvent Class

Checks whether the event is set, without blocking.

Syntax

BOOL Check(void);

Remarks

Returns TRUE if the event is set, or FALSE otherwise.

Remarks

This method calls the Wait method with a time-out of zero. If the object is an auto-reset event, this method resets the event.

CAMEvent::Reset

CAMEvent Class

Sets the state of the event to nonsignaled.

Syntax

void Reset(void);

CAMEvent::Set

CAMEvent Class

Signals the event.

Syntax

void Set(void);

Remarks

The behavior depends on whether the object is an auto-reset event or a manual-reset event:

CAMEvent::Wait

CAMEvent Class

Blocks until the event is signaled, or until a time-out occurs.

Syntax

BOOL Wait(
    DWORD dwTimeout = INFINITE
);

Parameters

dwTimeout
Optional time-out value, represented in milliseconds.

Return Value

Returns TRUE if the event is signaled. Otherwise, returns FALSE.

Remarks

For auto-reset events, the event is reset to a nonsignaled state when this method returns.

CAMEvent::operator HANDLE

CAMEvent Class

Retrieves the event handle. This operator is not supported as an L-value.

Syntax

operator HANDLE () const;

Return Value

Returns the m_hEvent member variable.