exchange
Low-latency exchange in C++
Loading...
Searching...
No Matches
event_mpsc_queue.hpp
Go to the documentation of this file.
1#pragma once
2#include "shared_memory.hpp"
4#include <type_traits>
5
6extern "C"
7{
8#include "concurrent/aeron_mpsc_rb.h"
9}
10
11namespace exchange::server
12{
13
15{
16 static constexpr int32_t messageTypeId{1};
17
18 aeron_mpsc_rb_t ringBufferWrapper{};
19
20 static void onEvent(std::int32_t msgTypeId, const void *data, std::size_t length, void *clientd) noexcept;
21
22 public:
23 explicit EventMpscQueue(SharedMemory &sharedMemory);
24
30 [[nodiscard]] Event pop() noexcept; // blocking
31
37 void push(const Event &event) noexcept;
38};
39
40} // namespace exchange::server
void push(const Event &event) noexcept
Definition event_mpsc_queue.cpp:15
Event pop() noexcept
Definition event_mpsc_queue.cpp:26
EventMpscQueue(SharedMemory &sharedMemory)
Definition event_mpsc_queue.cpp:8
Definition shared_memory.hpp:15
Definition main.hpp:4
Definition event.hpp:17