xtd 0.2.0
Loading...
Searching...
No Matches
event_wait_handle.hpp
Go to the documentation of this file.
1
4#pragma once
6#include "wait_handle.hpp"
7#include "../icomparable.hpp"
8#include "../iequatable.hpp"
9
11namespace xtd {
13 namespace threading {
37 class core_export_ event_wait_handle : public wait_handle, public icomparable<event_wait_handle>, public iequatable<event_wait_handle> {
38 class event_wait_handle_base;
39 class named_event_wait_handle;
40 class unnamed_event_wait_handle;
41 struct data;
42
43 public:
45
51 explicit event_wait_handle(bool initial_state);
55 explicit event_wait_handle(const string& name);
59 event_wait_handle(const string& name, bool& created_new);
63 event_wait_handle(bool initial_state, const string& name);
68 event_wait_handle(bool initial_state, const string& name, bool& created_new);
74 event_wait_handle(bool initial_state, event_reset_mode mode);
87 event_wait_handle(bool initial_state, event_reset_mode mode, const string& name);
101 event_wait_handle(bool initial_state, event_reset_mode mode, const string& name, bool& created_new);
103
105 template <typename char_t>
106 explicit event_wait_handle(const char_t* name) : event_wait_handle(string(name)) {}
109
111
113 intptr handle() const noexcept override;
114 void handle(intptr value) override;
116
118
120 void close() override;
121
122 int32 compare_to(const event_wait_handle& value) const noexcept override;
123
124 using object::equals;
125 bool equals(const event_wait_handle& value) const noexcept override;
126
130 bool reset();
131
138 bool set();
140
142
155 static event_wait_handle open_existing(const string& name);
156
169 static bool try_open_existing(const string& name, event_wait_handle& result) noexcept;
171
172 protected:
174
176 bool signal() override;
177
178 bool wait(int32 milliseconds_timeout) override;
180
181 private:
182 void create(bool initial_state, bool& created_new);
183
184 xtd::sptr<data> data_;
185 };
186 }
187}
Represents text as a sequence of character units.
Definition basic_string.hpp:79
Defines a generalized comparison method that a value type or class implements to create a type-specif...
Definition icomparable.hpp:21
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Represents a thread synchronization event.
Definition event_wait_handle.hpp:37
event_wait_handle(bool initial_state, const string &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 string &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 string &name)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(const string &name, bool &created_new)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying whether the wai...
event_wait_handle(const string &name)
Initializes a new instance of the xtd::threading::event_wait_handle class, specifying the name.
event_wait_handle(bool initial_state, event_reset_mode mode, const string &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)
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.hpp:52
Contains xtd::threading::event_reset_mode enumeration.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
event_reset_mode
Indicates whether an xtd::threading::event_wait_handle is reset automatically or manually after recei...
Definition event_reset_mode.hpp:24
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
intmax_t intptr
Represent a pointer or a handle.
Definition intptr.hpp:23
std::shared_ptr< type_t > sptr
The xtd::sptr object is a shared pointer.
Definition sptr.hpp:25
signal
Specifies signals that can interrupt the current process.
Definition signal.hpp:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::threading::wait_handle exception.