EventHandler Class Reference

#include <WinTools.h>

List of all members.

Public Member Functions

 EventHandler (void)
 EventHandler (BOOL manual, BOOL initial=FALSE, LPCTSTR hname=NULL, LPSECURITY_ATTRIBUTES sec=NULL)
virtual ~EventHandler (void)
HANDLE create (BOOL manual=TRUE, BOOL initial=FALSE, LPCTSTR hname=NULL, LPSECURITY_ATTRIBUTES sec=NULL)
void clear (void)
BOOL set (void)
BOOL wait (DWORD msec=INFINITE)
BOOL wait (HANDLE handle, DWORD msec=INFINITE)

Public Attributes

HANDLE m_handle
DWORD m_wait_err

Detailed Description

Definition at line 169 of file WinTools.h.


Constructor & Destructor Documentation

EventHandler ( void   ) 

Definition at line 721 of file WinTools.cpp.

References EventHandler::m_handle, and EventHandler::m_wait_err.

00722 {
00723     m_handle   = NULL;
00724     m_wait_err = 0;
00725 }

EventHandler ( BOOL  manual,
BOOL  initial = FALSE,
LPCTSTR  hname = NULL,
LPSECURITY_ATTRIBUTES  sec = NULL 
)

Definition at line 728 of file WinTools.cpp.

References EventHandler::create(), EventHandler::m_handle, and EventHandler::m_wait_err.

00729 {
00730     m_handle   = NULL;  
00731     m_wait_err = 0;
00732     create(manual, initial, hname, sec);
00733 }

Here is the call graph for this function:

virtual ~EventHandler ( void   )  [inline, virtual]

Definition at line 175 of file WinTools.h.

References EventHandler::clear().

00175 { clear();}

Here is the call graph for this function:


Member Function Documentation

void clear ( void   ) 

Definition at line 737 of file WinTools.cpp.

References EventHandler::m_handle, and EventHandler::m_wait_err.

Referenced by EventHandler::~EventHandler().

00738 {
00739     if (m_handle!=NULL) {
00740         CloseHandle(m_handle);
00741         m_handle = NULL;
00742     }
00743     m_wait_err = 0;
00744 
00745     return;
00746 }

Here is the caller graph for this function:

HANDLE create ( BOOL  manual = TRUE,
BOOL  initial = FALSE,
LPCTSTR  hname = NULL,
LPSECURITY_ATTRIBUTES  sec = NULL 
)

Definition at line 750 of file WinTools.cpp.

References EventHandler::m_handle.

Referenced by EventHandler::EventHandler().

00751 {
00752     if (m_handle!=NULL) return NULL;
00753 
00754     m_handle = CreateEvent(secu, manual, initial, hname);
00755     return m_handle;
00756 }

Here is the caller graph for this function:

BOOL set ( void   )  [inline]

Definition at line 184 of file WinTools.h.

References EventHandler::m_handle.

00184 { return SetEvent(m_handle);}

BOOL wait ( HANDLE  handle,
DWORD  msec = INFINITE 
)

Definition at line 782 of file WinTools.cpp.

References EventHandler::m_wait_err.

00783 {
00784     m_wait_err = WAIT_FAILED;
00785     if (handle==NULL) return FALSE;
00786 
00787     m_wait_err = WaitForSingleObject(handle, msec);
00788     
00789     if (m_wait_err!=WAIT_OBJECT_0) return FALSE;
00790     return TRUE;
00791 }

BOOL wait ( DWORD  msec = INFINITE  ) 

BOOL EventHandler::wait(DWORD msec=INFINITE)

m_wait_err: WAIT_OBJECT_0 WAIT_TIMEOUT WAIT_FAILED WAIT_ABANDONED

Definition at line 769 of file WinTools.cpp.

References EventHandler::m_handle, and EventHandler::m_wait_err.

00770 {
00771     m_wait_err = WAIT_FAILED;
00772     if (m_handle==NULL) return FALSE;
00773 
00774     m_wait_err = WaitForSingleObject(m_handle, msec);
00775     
00776     if (m_wait_err!=WAIT_OBJECT_0) return FALSE;
00777     return TRUE;
00778 }


Member Data Documentation

HANDLE m_handle
DWORD m_wait_err

Definition at line 178 of file WinTools.h.

Referenced by EventHandler::clear(), EventHandler::EventHandler(), and EventHandler::wait().


The documentation for this class was generated from the following files:

Generated on 15 Nov 2023 for JunkBox_Win_Lib by  doxygen 1.6.1