RPC calls

This commit is contained in:
Johnathon Slightham
2026-02-10 23:08:41 -05:00
committed by Johnathon Slightham
parent 52ff24e649
commit 649669d598
12 changed files with 466 additions and 37 deletions

View File

@@ -0,0 +1,23 @@
#include "CallBuilder.h"
#include "SerializedMessage.h"
namespace Flatbuffers {
SerializedMessage CallBuilder::build_return_call(uint8_t unique_id, const std::vector<uint8_t> &return_value) {
builder_.Clear();
const auto return_vector = builder_.CreateVector(return_value);
const auto message = Messaging::CreateReturnCall(
builder_, unique_id, static_cast<int>(return_value.size()),
return_vector);
builder_.Finish(message);
return {builder_.GetBufferPointer(), builder_.GetSize()};
}
const Messaging::SendCall *CallBuilder::parse_send_call(const uint8_t *buffer) {
return flatbuffers::GetRoot<Messaging::SendCall>(buffer);
}
} // namespace Flatbuffers