|
ITCH 5.0 Market Data Handler 1.0.0
NASDAQ ITCH 5.0 Market Data Feed Handler
|
Generic synchronization event. More...
Generic synchronization event.
A thread synchronization primitive that allows threads to signal and wait for events. The event can be in either signaled or non-signaled state.
Behavior depends on the Auto template parameter:
The event provides:
| Auto | If true, event auto-resets after waking one thread; if false, event stays signaled until manual reset |
#include <core/src/Event.h>
Public Member Functions | |
| Event (bool signaled=false) | |
| Construct an event. | |
| void | reset () |
| Reset event to non-signaled state. | |
| void | set () |
| Set event to signaled state. | |
| template<typename D> | |
| bool | wait (D duration=D(typename D::rep(-1))) |
| Wait for event with duration-based timeout. | |
| bool | wait (unsigned ms=unsigned(-1)) |
| Wait for event with millisecond timeout. | |
|
inline |
Construct an event.
Creates an event in either signaled or non-signaled state.
| signaled | Initial state (default: false = non-signaled) |
|
inline |
Reset event to non-signaled state.
For manual-reset events, this must be called explicitly to clear the signal. For auto-reset events, this happens automatically but can be called to force a reset.
|
inline |
Set event to signaled state.
Signals the event, waking waiting threads:
If no threads are waiting, the event remains signaled until a thread calls wait() or reset() is called.
|
inline |
Wait for event with duration-based timeout.
Blocks the calling thread until the event is signaled or the specified duration elapses. Supports any std::chrono::duration type.
| D | Duration type (e.g., std::chrono::seconds, std::chrono::milliseconds) |
| duration | Maximum time to wait (default: infinite = -1) |
Referenced by b2bits::Event< true >::wait().
|
inline |
Wait for event with millisecond timeout.
Blocks the calling thread until the event is signaled or the specified timeout (in milliseconds) elapses.
The implementation handles spurious wakeups by re-checking the signaled state and adjusting the remaining timeout accordingly.
| ms | Timeout in milliseconds (default: infinite = -1) |