9 #ifndef CPPCOMMON_THREADS_NAMED_EVENT_MANUAL_RESET_H
10 #define CPPCOMMON_THREADS_NAMED_EVENT_MANUAL_RESET_H
45 const std::string&
name()
const;
99 Impl& impl() noexcept {
return reinterpret_cast<Impl&
>(_storage); }
100 const Impl& impl() const noexcept {
return reinterpret_cast<Impl const&
>(_storage); }
102 static const size_t StorageSize = 136;
103 static const size_t StorageAlign = 8;
104 alignas(StorageAlign) std::byte _storage[StorageSize];
Named manual-reset event synchronization primitive.
void Signal()
Signal one of waiting thread about event occurred.
NamedEventManualReset & operator=(const NamedEventManualReset &)=delete
bool TryWaitUntil(const UtcTimestamp ×tamp)
Try to wait the event until the given timestamp.
const std::string & name() const
Get the event name.
NamedEventManualReset & operator=(NamedEventManualReset &&event)=delete
void Wait()
Try to wait the event with block.
NamedEventManualReset(const std::string &name, bool signaled=false)
Default class constructor.
bool TryWait()
Try to wait the event without block.
NamedEventManualReset(const NamedEventManualReset &)=delete
NamedEventManualReset(NamedEventManualReset &&event)=delete
void Reset()
Reset the event.
bool TryWaitFor(const Timespan ×pan)
Try to wait the event for the given timespan.
C++ Common project definitions.