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