mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
add flatbuffer definitions
This commit is contained in:
@@ -0,0 +1,267 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_MOVEMENT_MOVEMENT_H_
|
||||
#define FLATBUFFERS_GENERATED_MOVEMENT_MOVEMENT_H_
|
||||
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
// Ensure the included flatbuffers.h is the same version as when this file was
|
||||
// generated, otherwise it may not be compatible.
|
||||
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
||||
FLATBUFFERS_VERSION_MINOR == 12 &&
|
||||
FLATBUFFERS_VERSION_REVISION == 19,
|
||||
"Non-compatible flatbuffers version included");
|
||||
|
||||
namespace movement {
|
||||
|
||||
struct ConditionBlob;
|
||||
|
||||
struct MovementEntry;
|
||||
struct MovementEntryBuilder;
|
||||
|
||||
struct MovementSet;
|
||||
struct MovementSetBuilder;
|
||||
|
||||
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(2) ConditionBlob FLATBUFFERS_FINAL_CLASS {
|
||||
private:
|
||||
uint16_t value_;
|
||||
uint8_t cond_;
|
||||
uint8_t module_type_;
|
||||
uint8_t in_use_;
|
||||
int8_t padding0__;
|
||||
|
||||
public:
|
||||
ConditionBlob()
|
||||
: value_(0),
|
||||
cond_(0),
|
||||
module_type_(0),
|
||||
in_use_(0),
|
||||
padding0__(0) {
|
||||
(void)padding0__;
|
||||
}
|
||||
ConditionBlob(uint16_t _value, uint8_t _cond, uint8_t _module_type, uint8_t _in_use)
|
||||
: value_(::flatbuffers::EndianScalar(_value)),
|
||||
cond_(::flatbuffers::EndianScalar(_cond)),
|
||||
module_type_(::flatbuffers::EndianScalar(_module_type)),
|
||||
in_use_(::flatbuffers::EndianScalar(_in_use)),
|
||||
padding0__(0) {
|
||||
(void)padding0__;
|
||||
}
|
||||
uint16_t value() const {
|
||||
return ::flatbuffers::EndianScalar(value_);
|
||||
}
|
||||
uint8_t cond() const {
|
||||
return ::flatbuffers::EndianScalar(cond_);
|
||||
}
|
||||
uint8_t module_type() const {
|
||||
return ::flatbuffers::EndianScalar(module_type_);
|
||||
}
|
||||
uint8_t in_use() const {
|
||||
return ::flatbuffers::EndianScalar(in_use_);
|
||||
}
|
||||
};
|
||||
FLATBUFFERS_STRUCT_END(ConditionBlob, 6);
|
||||
|
||||
struct MovementEntry FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef MovementEntryBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_BOARD_ID = 4,
|
||||
VT_MODULE_TYPE = 6,
|
||||
VT_VALUE_ACTION = 8,
|
||||
VT_CONDITION = 10,
|
||||
VT_ACK = 12,
|
||||
VT_ACK_TTL_MS = 14,
|
||||
VT_POST_DELAY_MS = 16
|
||||
};
|
||||
uint16_t board_id() const {
|
||||
return GetField<uint16_t>(VT_BOARD_ID, 0);
|
||||
}
|
||||
uint8_t module_type() const {
|
||||
return GetField<uint8_t>(VT_MODULE_TYPE, 0);
|
||||
}
|
||||
uint16_t value_action() const {
|
||||
return GetField<uint16_t>(VT_VALUE_ACTION, 0);
|
||||
}
|
||||
const movement::ConditionBlob *condition() const {
|
||||
return GetStruct<const movement::ConditionBlob *>(VT_CONDITION);
|
||||
}
|
||||
uint8_t ack() const {
|
||||
return GetField<uint8_t>(VT_ACK, 0);
|
||||
}
|
||||
uint16_t ack_ttl_ms() const {
|
||||
return GetField<uint16_t>(VT_ACK_TTL_MS, 0);
|
||||
}
|
||||
uint16_t post_delay_ms() const {
|
||||
return GetField<uint16_t>(VT_POST_DELAY_MS, 0);
|
||||
}
|
||||
template <bool B = false>
|
||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<uint16_t>(verifier, VT_BOARD_ID, 2) &&
|
||||
VerifyField<uint8_t>(verifier, VT_MODULE_TYPE, 1) &&
|
||||
VerifyField<uint16_t>(verifier, VT_VALUE_ACTION, 2) &&
|
||||
VerifyField<movement::ConditionBlob>(verifier, VT_CONDITION, 2) &&
|
||||
VerifyField<uint8_t>(verifier, VT_ACK, 1) &&
|
||||
VerifyField<uint16_t>(verifier, VT_ACK_TTL_MS, 2) &&
|
||||
VerifyField<uint16_t>(verifier, VT_POST_DELAY_MS, 2) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct MovementEntryBuilder {
|
||||
typedef MovementEntry Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_board_id(uint16_t board_id) {
|
||||
fbb_.AddElement<uint16_t>(MovementEntry::VT_BOARD_ID, board_id, 0);
|
||||
}
|
||||
void add_module_type(uint8_t module_type) {
|
||||
fbb_.AddElement<uint8_t>(MovementEntry::VT_MODULE_TYPE, module_type, 0);
|
||||
}
|
||||
void add_value_action(uint16_t value_action) {
|
||||
fbb_.AddElement<uint16_t>(MovementEntry::VT_VALUE_ACTION, value_action, 0);
|
||||
}
|
||||
void add_condition(const movement::ConditionBlob *condition) {
|
||||
fbb_.AddStruct(MovementEntry::VT_CONDITION, condition);
|
||||
}
|
||||
void add_ack(uint8_t ack) {
|
||||
fbb_.AddElement<uint8_t>(MovementEntry::VT_ACK, ack, 0);
|
||||
}
|
||||
void add_ack_ttl_ms(uint16_t ack_ttl_ms) {
|
||||
fbb_.AddElement<uint16_t>(MovementEntry::VT_ACK_TTL_MS, ack_ttl_ms, 0);
|
||||
}
|
||||
void add_post_delay_ms(uint16_t post_delay_ms) {
|
||||
fbb_.AddElement<uint16_t>(MovementEntry::VT_POST_DELAY_MS, post_delay_ms, 0);
|
||||
}
|
||||
explicit MovementEntryBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<MovementEntry> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<MovementEntry>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<MovementEntry> CreateMovementEntry(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint16_t board_id = 0,
|
||||
uint8_t module_type = 0,
|
||||
uint16_t value_action = 0,
|
||||
const movement::ConditionBlob *condition = nullptr,
|
||||
uint8_t ack = 0,
|
||||
uint16_t ack_ttl_ms = 0,
|
||||
uint16_t post_delay_ms = 0) {
|
||||
MovementEntryBuilder builder_(_fbb);
|
||||
builder_.add_condition(condition);
|
||||
builder_.add_post_delay_ms(post_delay_ms);
|
||||
builder_.add_ack_ttl_ms(ack_ttl_ms);
|
||||
builder_.add_value_action(value_action);
|
||||
builder_.add_board_id(board_id);
|
||||
builder_.add_ack(ack);
|
||||
builder_.add_module_type(module_type);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct MovementSet FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef MovementSetBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_NUM_MOVEMENTS = 4,
|
||||
VT_MOVEMENTS = 6
|
||||
};
|
||||
uint8_t num_movements() const {
|
||||
return GetField<uint8_t>(VT_NUM_MOVEMENTS, 0);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>> *movements() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>> *>(VT_MOVEMENTS);
|
||||
}
|
||||
template <bool B = false>
|
||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||
return VerifyTableStart(verifier) &&
|
||||
VerifyField<uint8_t>(verifier, VT_NUM_MOVEMENTS, 1) &&
|
||||
VerifyOffset(verifier, VT_MOVEMENTS) &&
|
||||
verifier.VerifyVector(movements()) &&
|
||||
verifier.VerifyVectorOfTables(movements()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct MovementSetBuilder {
|
||||
typedef MovementSet Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_num_movements(uint8_t num_movements) {
|
||||
fbb_.AddElement<uint8_t>(MovementSet::VT_NUM_MOVEMENTS, num_movements, 0);
|
||||
}
|
||||
void add_movements(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>>> movements) {
|
||||
fbb_.AddOffset(MovementSet::VT_MOVEMENTS, movements);
|
||||
}
|
||||
explicit MovementSetBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||
: fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<MovementSet> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<MovementSet>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<MovementSet> CreateMovementSet(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint8_t num_movements = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>>> movements = 0) {
|
||||
MovementSetBuilder builder_(_fbb);
|
||||
builder_.add_movements(movements);
|
||||
builder_.add_num_movements(num_movements);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline ::flatbuffers::Offset<MovementSet> CreateMovementSetDirect(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
uint8_t num_movements = 0,
|
||||
const std::vector<::flatbuffers::Offset<movement::MovementEntry>> *movements = nullptr) {
|
||||
auto movements__ = movements ? _fbb.CreateVector<::flatbuffers::Offset<movement::MovementEntry>>(*movements) : 0;
|
||||
return movement::CreateMovementSet(
|
||||
_fbb,
|
||||
num_movements,
|
||||
movements__);
|
||||
}
|
||||
|
||||
inline const movement::MovementSet *GetMovementSet(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<movement::MovementSet>(buf);
|
||||
}
|
||||
|
||||
inline const movement::MovementSet *GetSizePrefixedMovementSet(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<movement::MovementSet>(buf);
|
||||
}
|
||||
|
||||
template <bool B = false>
|
||||
inline bool VerifyMovementSetBuffer(
|
||||
::flatbuffers::VerifierTemplate<B> &verifier) {
|
||||
return verifier.template VerifyBuffer<movement::MovementSet>(nullptr);
|
||||
}
|
||||
|
||||
template <bool B = false>
|
||||
inline bool VerifySizePrefixedMovementSetBuffer(
|
||||
::flatbuffers::VerifierTemplate<B> &verifier) {
|
||||
return verifier.template VerifySizePrefixedBuffer<movement::MovementSet>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishMovementSetBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<movement::MovementSet> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedMovementSetBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<movement::MovementSet> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace movement
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_MOVEMENT_MOVEMENT_H_
|
||||
Reference in New Issue
Block a user