sl@0
|
1 |
//------------------------------------------------------------------------------
|
sl@0
|
2 |
#include "Event.h"
|
sl@0
|
3 |
//------------------------------------------------------------------------------
|
sl@0
|
4 |
Event::Event()
|
sl@0
|
5 |
{
|
sl@0
|
6 |
m_hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
|
sl@0
|
7 |
}
|
sl@0
|
8 |
//------------------------------------------------------------------------------
|
sl@0
|
9 |
Event::~Event()
|
sl@0
|
10 |
{
|
sl@0
|
11 |
if (m_hEvent)
|
sl@0
|
12 |
CloseHandle(m_hEvent);
|
sl@0
|
13 |
}
|
sl@0
|
14 |
//------------------------------------------------------------------------------
|
sl@0
|
15 |
void Event::Signal() const
|
sl@0
|
16 |
{
|
sl@0
|
17 |
SetEvent(m_hEvent);
|
sl@0
|
18 |
}
|
sl@0
|
19 |
//------------------------------------------------------------------------------
|
sl@0
|
20 |
void Event::Reset() const
|
sl@0
|
21 |
{
|
sl@0
|
22 |
ResetEvent(m_hEvent);
|
sl@0
|
23 |
}
|
sl@0
|
24 |
//------------------------------------------------------------------------------
|
sl@0
|
25 |
void Event::Await() const
|
sl@0
|
26 |
{
|
sl@0
|
27 |
WaitForSingleObject(m_hEvent, INFINITE);
|
sl@0
|
28 |
}
|
sl@0
|
29 |
//------------------------------------------------------------------------------
|
sl@1
|
30 |
|
sl@1
|
31 |
|
sl@1
|
32 |
//
|
sl@1
|
33 |
//
|
sl@1
|
34 |
//
|
sl@1
|
35 |
|
sl@1
|
36 |
LRESULT WindowEvent::Execute(UINT aMsg)
|
sl@1
|
37 |
{
|
sl@1
|
38 |
//Typically only execute if the given message is for us
|
sl@1
|
39 |
if (aMsg==iMsg)
|
sl@1
|
40 |
{
|
sl@1
|
41 |
return DoExecute();
|
sl@1
|
42 |
}
|
sl@1
|
43 |
} |