winss
event_wrapper.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2016-2017 Morgan Stanley
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef LIB_WINSS_EVENT_WRAPPER_HPP_
18 #define LIB_WINSS_EVENT_WRAPPER_HPP_
19 
20 #include <windows.h>
21 #include "handle_wrapper.hpp"
22 
23 namespace winss {
27 class EventWrapper {
28  private:
31  public:
35  EventWrapper();
36 
44  EventWrapper(const EventWrapper& e) = default;
45 
53  EventWrapper(EventWrapper&& e) = default;
54 
60  bool IsSet() const;
61 
69 
75  bool Set();
76 
82  bool Reset();
83 
92  EventWrapper& operator=(const EventWrapper& e) = default;
93 
102  EventWrapper& operator=(EventWrapper&& e) = default;
103 };
104 } // namespace winss
105 
106 #endif // LIB_WINSS_EVENT_WRAPPER_HPP_
A wrapper for a Windows HANDLE.
Definition: handle_wrapper.hpp:39
EventWrapper()
Creates the event wrapper.
Definition: event_wrapper.cpp:21
Wraps a windows event.
Definition: event_wrapper.hpp:27
bool IsSet() const
Gets if the event is set or not.
Definition: event_wrapper.cpp:24
Definition: case_ignore.hpp:23
bool Reset()
Resets the event.
Definition: event_wrapper.cpp:32
winss::HandleWrapper GetHandle() const
Gets a handle to the event.
Definition: event_wrapper.cpp:36
bool Set()
Trigger the event.
Definition: event_wrapper.cpp:28
EventWrapper & operator=(const EventWrapper &e)=default
Copies the event wrapper.
Definition: handle_wrapper.hpp:327