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