// Common, group WinWrap
// see CW Events
// Copyright Alexander Liss

#ifndef __EVENT_H__
#define __EVENT_H__


#include "kernel.h"

	// check status after constructor, when name is specified

class Event : public Kernel
{
	Event(const Event&);
	Event& operator=(const Event&);
public:
    // creates an event object or opens en existing one
    Event( BOOL bManualReset = FALSE, BOOL bStartSignaled = FALSE, LPCTSTR lpName = NULL, LPSECURITY_ATTRIBUTES lpEventAttributes = NULL);
    
    // opens an existing named event
    Event( LPCTSTR lpName, BOOL bInheritHandle = FALSE, DWORD dwDesiredAccess = EVENT_ALL_ACCESS);

    BOOL set();
    BOOL reset();
    BOOL pulse();
	BOOL creator(){return attributes & 1;}
	BOOL manual(){return attributes & 2;}
private:
	DWORD attributes;
};


#endif