CppCommon
1.0.4.1
C++ Common Library
|
Named manual-reset event synchronization primitive. More...
#include <named_event_manual_reset.h>
Public Member Functions | |
NamedEventManualReset (const std::string &name, bool signaled=false) | |
Default class constructor. More... | |
NamedEventManualReset (const NamedEventManualReset &)=delete | |
NamedEventManualReset (NamedEventManualReset &&event)=delete | |
~NamedEventManualReset () | |
NamedEventManualReset & | operator= (const NamedEventManualReset &)=delete |
NamedEventManualReset & | operator= (NamedEventManualReset &&event)=delete |
const std::string & | name () const |
Get the event name. More... | |
void | Reset () |
Reset the event. More... | |
void | Signal () |
Signal one of waiting thread about event occurred. More... | |
bool | TryWait () |
Try to wait the event without block. More... | |
bool | TryWaitFor (const Timespan ×pan) |
Try to wait the event for the given timespan. More... | |
bool | TryWaitUntil (const UtcTimestamp ×tamp) |
Try to wait the event until the given timestamp. More... | |
void | Wait () |
Try to wait the event with block. More... | |
Named manual-reset event synchronization primitive.
Named manual-reset event behaves as a simple manual-reset event but could be shared between processes on the same machine.
Thread-safe.
Definition at line 28 of file named_event_manual_reset.h.
|
explicit |
Default class constructor.
name | - Event name |
signaled | - Signaled event initial state (default is false) |
Definition at line 244 of file named_event_manual_reset.cpp.
|
delete |
|
delete |
CppCommon::NamedEventManualReset::~NamedEventManualReset | ( | ) |
Definition at line 255 of file named_event_manual_reset.cpp.
const std::string & CppCommon::NamedEventManualReset::name | ( | ) | const |
Get the event name.
Definition at line 261 of file named_event_manual_reset.cpp.
|
delete |
|
delete |
void CppCommon::NamedEventManualReset::Reset | ( | ) |
Reset the event.
If the event is in the signaled state then it will be reset to non signaled state. As the result other threads that wait for the event will be blocked.
Will not block.
Definition at line 263 of file named_event_manual_reset.cpp.
void CppCommon::NamedEventManualReset::Signal | ( | ) |
Signal one of waiting thread about event occurred.
If some threads are waiting for the event all of them will be signaled and continued.
Will not block.
Definition at line 264 of file named_event_manual_reset.cpp.
bool CppCommon::NamedEventManualReset::TryWait | ( | ) |
Try to wait the event without block.
Will not block.
Definition at line 266 of file named_event_manual_reset.cpp.
bool CppCommon::NamedEventManualReset::TryWaitFor | ( | const Timespan & | timespan | ) |
Try to wait the event for the given timespan.
Will block for the given timespan in the worst case.
timespan | - Timespan to wait for the event |
Definition at line 267 of file named_event_manual_reset.cpp.
|
inline |
Try to wait the event until the given timestamp.
Will block until the given timestamp in the worst case.
timestamp | - Timestamp to stop wait for the event |
Definition at line 87 of file named_event_manual_reset.h.
void CppCommon::NamedEventManualReset::Wait | ( | ) |
Try to wait the event with block.
Will block.
Definition at line 269 of file named_event_manual_reset.cpp.