xtd 0.2.0
Loading...
Searching...
No Matches
event_wait_handle.h
Go to the documentation of this file.
1
4#pragma once
5#include "event_reset_mode.h"
6#include "wait_handle.h"
7#include "../icomparable.h"
8#include "../iequatable.h"
9
11namespace xtd {
13 namespace threading {
35 class core_export_ event_wait_handle : public wait_handle, public icomparable<event_wait_handle>, public iequatable<event_wait_handle> {
36 class event_wait_handle_base;
37 class named_event_wait_handle;
38 class unnamed_event_wait_handle;
39 struct data;
40
41 public:
43
49 explicit event_wait_handle(bool initial_state);
53 explicit event_wait_handle(const ustring& name);
57 event_wait_handle(const ustring& name, bool& created_new);
61 event_wait_handle(bool initial_state, const ustring& name);
66 event_wait_handle(bool initial_state, const ustring& name, bool& created_new);
72 event_wait_handle(bool initial_state, event_reset_mode mode);
85 event_wait_handle(bool initial_state, event_reset_mode mode, const ustring& name);
99 event_wait_handle(bool initial_state, event_reset_mode mode, const ustring& name, bool& created_new);
101
103 template <typename char_t>
104 explicit event_wait_handle(const char_t* name) : event_wait_handle(ustring(name)) {}
107
109
111 intptr handle() const noexcept override;
112 void handle(intptr value) override;
114
116
118 void close() override;
119
120 int32 compare_to(const event_wait_handle& value) const noexcept override;
121
122 bool equals(const event_wait_handle& value) const noexcept override;
123
127 bool reset();
128
135 bool set();
137
139
152 static event_wait_handle open_existing(const ustring& name);
153
166 static bool try_open_existing(const ustring& name, event_wait_handle& result) noexcept;
168
169 protected:
171
173 bool signal() override;
174
175 bool wait(int32 milliseconds_timeout) override;
177
178 private:
179 void create(bool initial_state, bool& created_new);
180
181 std::shared_ptr<data> data_;
182 };
183 }
184}
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.h:17
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.h:18
Represents a thread synchronization event.
Definition event_wait_handle.h:35
event_wait_handle(const ustring &name, bool &created_new)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(const ustring &name)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying the name.
event_wait_handle(bool initial_state, const ustring &name)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(bool initial_state, event_reset_mode mode, const ustring &name, bool &created_new)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(bool initial_state, const ustring &name, bool &created_new)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(bool initial_state)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
intptr handle() const noexcept override
Gets the native operating system handle.
event_wait_handle(bool initial_state, event_reset_mode mode, const ustring &name)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(bool initial_state, event_reset_mode mode)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
Encapsulates operating system specific objects that wait for exclusive access to shared resources.
Definition wait_handle.h:50
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::threading::event_reset_mode enumeration.
#define core_export_
Define shared library export.
Definition core_export.h:13
event_reset_mode
Indicates whether an xtd::threading::event_wait_handle is reset automatically or manually after recei...
Definition event_reset_mode.h:22
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
intmax_t intptr
Represent a pointer or a handle.
Definition types.h:153
signal
Specifies signals that can interrupt the current process.
Definition signal.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::threading::wait_handle exception.