#>cpp
#pragma once

#include "database/single_node_ha/serialization.hpp"
#include "durability/single_node_ha/state_delta.hpp"
#include "raft/log_entry.capnp.h"
cpp<#

(lcp:namespace raft)

(lcp:capnp-namespace "raft")

(lcp:capnp-import 'database "/database/single_node_ha/serialization.capnp")

(lcp:define-struct log-entry ()
  ((term :uint64_t)
   (deltas "std::vector<database::StateDelta>" :capnp-type "List(Database.StateDelta)"))
   (:public #>cpp
   LogEntry() = default;
   LogEntry(uint64_t _term, std::vector<database::StateDelta> _deltas): term(_term), deltas(_deltas) {}
   cpp<#)
  (:serialize (:slk) (:capnp)))

(lcp:pop-namespace) ;; raft
