Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Event_WIN32.h
Go to the documentation of this file.
1//
2// Event_WIN32.h
3//
4// Library: Foundation
5// Package: Threading
6// Module: Event
7//
8// Definition of the EventImpl class for WIN32.
9//
10// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
11// and Contributors.
12//
13// SPDX-License-Identifier: BSL-1.0
14//
15
16
17#ifndef Foundation_Event_WIN32_INCLUDED
18#define Foundation_Event_WIN32_INCLUDED
19
20
21#include "Poco/Foundation.h"
22#include "Poco/Exception.h"
23#include "Poco/UnWindows.h"
24
25
26namespace Poco {
27
28
30{
31protected:
32 EventImpl(bool autoReset);
34 void setImpl();
35 void waitImpl();
36 bool waitImpl(long milliseconds);
37 void resetImpl();
38
39private:
40 HANDLE _event;
41};
42
43
44//
45// inlines
46//
47inline void EventImpl::setImpl()
48{
49 if (!SetEvent(_event))
50 {
51 throw SystemException("cannot signal event");
52 }
53}
54
55
56inline void EventImpl::resetImpl()
57{
58 if (!ResetEvent(_event))
59 {
60 throw SystemException("cannot reset event");
61 }
62}
63
64
65} // namespace Poco
66
67
68#endif // Foundation_Event_WIN32_INCLUDED
#define Foundation_API
Definition Foundation.h:60
EventImpl(bool autoReset)
bool waitImpl(long milliseconds)