8#include <unordered_map>
57 [[nodiscard]]
bool after(
const Source& other)
const noexcept {
58 if (
epoch != other.epoch) {
59 return epoch > other.epoch;
61 return seq != other.seq ?
seq > other.seq :
index > other.index;
76 const auto it = last_.find(source.session);
77 return it != last_.end() && !source.after(it->second);
81 [[nodiscard]] std::vector<OrderFillEvent>
fills()
const;
83 [[nodiscard]]
size_t size() const noexcept {
return size_; }
84 [[nodiscard]]
size_t capacity() const noexcept {
return capacity_; }
85 [[nodiscard]] uint64_t
next_seq() const noexcept {
return next_seq_; }
86 [[nodiscard]]
const std::string&
path() const noexcept {
return path_; }
92 [[nodiscard]] FileHeader& header() noexcept;
93 [[nodiscard]] Entry& entry(
size_t index) noexcept;
94 [[nodiscard]] const Entry& entry(
size_t index) const noexcept;
100 uint64_t next_seq_ = 0;
102 std::unordered_map<uint64_t, Source> last_;
std::vector< OrderFillEvent > fills() const
size_t size() const noexcept
bool journaled(const Source &source) const noexcept
uint64_t next_seq() const noexcept
size_t capacity() const noexcept
FillJournal(const std::string &path, const Format &format, size_t capacity, uint64_t first_seq)
static constexpr size_t DEFAULT_CAPACITY
bool record(OrderFillEvent &fill, const Source &source)
const std::string & path() const noexcept
bool after(const Source &other) const noexcept