mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
flatbuffer wrapper for movement sets
This commit is contained in:
45
components/flatbuffers/MovementSetBuilder.cpp
Normal file
45
components/flatbuffers/MovementSetBuilder.cpp
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
// Justin Chow created file >:)
|
||||||
|
|
||||||
|
#include "MovementSetBuilder.h"
|
||||||
|
#include "SerializedMessage.h"
|
||||||
|
|
||||||
|
#ifdef MOVEMENTSETBUILDER
|
||||||
|
|
||||||
|
namespace Flatbuffers {
|
||||||
|
SerializedMessage MovementSetBuilder::build_movement_set(const std::vector<flatbuffers::Offset<Movement::MovementEntry>>& set){
|
||||||
|
|
||||||
|
builder_.Clear();
|
||||||
|
|
||||||
|
const auto set_vector = builder_.CreateVector(set);
|
||||||
|
|
||||||
|
const auto message = Movement::CreateMovementSet(
|
||||||
|
builder_,
|
||||||
|
static_cast<uint8_t>(set.size()),
|
||||||
|
set_vector
|
||||||
|
);
|
||||||
|
|
||||||
|
builder_.Finish(message);
|
||||||
|
|
||||||
|
return {builder_.GetBufferPointer(), builder_.GetSize()};
|
||||||
|
}
|
||||||
|
|
||||||
|
flatbuffers::Offset<Movement::MovementEntry> MovementSetBuilder::build_movement_entry(uint16_t board_id, uint8_t module_type, uint16_t value_action,
|
||||||
|
const Movement::ConditionBlob& condition, uint8_t ack, uint16_t ack_ttl_ms, uint16_t post_delay_ms){
|
||||||
|
return Movement::CreateMovementEntry(
|
||||||
|
builder_,
|
||||||
|
board_id,
|
||||||
|
module_type,
|
||||||
|
value_action,
|
||||||
|
&condition,
|
||||||
|
ack,
|
||||||
|
ack_ttl_ms,
|
||||||
|
post_delay_ms
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Movement::ConditionBlob MovementSetBuilder::build_condition_blob(uint16_t value, uint8_t cond, uint8_t module_type, uint8_t in_use){
|
||||||
|
return Movement::ConditionBlob(value, cond, module_type, in_use);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //MOVEMENTSETBUILDER
|
||||||
29
components/flatbuffers/include/MovementSetBuilder.h
Normal file
29
components/flatbuffers/include/MovementSetBuilder.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// Justin Chow created file >:)
|
||||||
|
|
||||||
|
#ifndef MOVEMENTSETBUILDER
|
||||||
|
#define MOVEMENTSETBUILDER
|
||||||
|
|
||||||
|
#define MAX_MOVEMENTS_IN_SET 255 //max number movements in `MovementEntry.num_movements` can hold
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "SerializedMessage.h"
|
||||||
|
#include "flatbuffers_generated/Movement_generated.h"
|
||||||
|
#include "flatbuffers/flatbuffers.h"
|
||||||
|
|
||||||
|
namespace Flatbuffers {
|
||||||
|
class MovementSetBuilder {
|
||||||
|
public:
|
||||||
|
MovementSetBuilder() : builder_(MAX_MOVEMENTS_IN_SET*sizeof(Movement::MovementEntry)) {}
|
||||||
|
|
||||||
|
SerializedMessage build_movement_set(const std::vector<flatbuffers::Offset<Movement::MovementEntry>>& set);
|
||||||
|
flatbuffers::Offset<Movement::MovementEntry> build_movement_entry(uint16_t board_id, uint8_t module_type, uint16_t value_action,
|
||||||
|
const Movement::ConditionBlob& condition, uint8_t ack, uint16_t ack_ttl_ms, uint16_t post_delay_ms);
|
||||||
|
Movement::ConditionBlob build_condition_blob(uint16_t value, uint8_t cond, uint8_t module_type, uint8_t in_use);
|
||||||
|
|
||||||
|
private:
|
||||||
|
flatbuffers::FlatBufferBuilder builder_;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //MOVEMENTSETBUILDER
|
||||||
@@ -13,7 +13,7 @@ static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
|||||||
FLATBUFFERS_VERSION_REVISION == 19,
|
FLATBUFFERS_VERSION_REVISION == 19,
|
||||||
"Non-compatible flatbuffers version included");
|
"Non-compatible flatbuffers version included");
|
||||||
|
|
||||||
namespace movement {
|
namespace Movement {
|
||||||
|
|
||||||
struct ConditionBlob;
|
struct ConditionBlob;
|
||||||
|
|
||||||
@@ -83,8 +83,8 @@ struct MovementEntry FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
uint16_t value_action() const {
|
uint16_t value_action() const {
|
||||||
return GetField<uint16_t>(VT_VALUE_ACTION, 0);
|
return GetField<uint16_t>(VT_VALUE_ACTION, 0);
|
||||||
}
|
}
|
||||||
const movement::ConditionBlob *condition() const {
|
const Movement::ConditionBlob *condition() const {
|
||||||
return GetStruct<const movement::ConditionBlob *>(VT_CONDITION);
|
return GetStruct<const Movement::ConditionBlob *>(VT_CONDITION);
|
||||||
}
|
}
|
||||||
uint8_t ack() const {
|
uint8_t ack() const {
|
||||||
return GetField<uint8_t>(VT_ACK, 0);
|
return GetField<uint8_t>(VT_ACK, 0);
|
||||||
@@ -101,7 +101,7 @@ struct MovementEntry FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
VerifyField<uint16_t>(verifier, VT_BOARD_ID, 2) &&
|
VerifyField<uint16_t>(verifier, VT_BOARD_ID, 2) &&
|
||||||
VerifyField<uint8_t>(verifier, VT_MODULE_TYPE, 1) &&
|
VerifyField<uint8_t>(verifier, VT_MODULE_TYPE, 1) &&
|
||||||
VerifyField<uint16_t>(verifier, VT_VALUE_ACTION, 2) &&
|
VerifyField<uint16_t>(verifier, VT_VALUE_ACTION, 2) &&
|
||||||
VerifyField<movement::ConditionBlob>(verifier, VT_CONDITION, 2) &&
|
VerifyField<Movement::ConditionBlob>(verifier, VT_CONDITION, 2) &&
|
||||||
VerifyField<uint8_t>(verifier, VT_ACK, 1) &&
|
VerifyField<uint8_t>(verifier, VT_ACK, 1) &&
|
||||||
VerifyField<uint16_t>(verifier, VT_ACK_TTL_MS, 2) &&
|
VerifyField<uint16_t>(verifier, VT_ACK_TTL_MS, 2) &&
|
||||||
VerifyField<uint16_t>(verifier, VT_POST_DELAY_MS, 2) &&
|
VerifyField<uint16_t>(verifier, VT_POST_DELAY_MS, 2) &&
|
||||||
@@ -122,7 +122,7 @@ struct MovementEntryBuilder {
|
|||||||
void add_value_action(uint16_t value_action) {
|
void add_value_action(uint16_t value_action) {
|
||||||
fbb_.AddElement<uint16_t>(MovementEntry::VT_VALUE_ACTION, value_action, 0);
|
fbb_.AddElement<uint16_t>(MovementEntry::VT_VALUE_ACTION, value_action, 0);
|
||||||
}
|
}
|
||||||
void add_condition(const movement::ConditionBlob *condition) {
|
void add_condition(const Movement::ConditionBlob *condition) {
|
||||||
fbb_.AddStruct(MovementEntry::VT_CONDITION, condition);
|
fbb_.AddStruct(MovementEntry::VT_CONDITION, condition);
|
||||||
}
|
}
|
||||||
void add_ack(uint8_t ack) {
|
void add_ack(uint8_t ack) {
|
||||||
@@ -150,7 +150,7 @@ inline ::flatbuffers::Offset<MovementEntry> CreateMovementEntry(
|
|||||||
uint16_t board_id = 0,
|
uint16_t board_id = 0,
|
||||||
uint8_t module_type = 0,
|
uint8_t module_type = 0,
|
||||||
uint16_t value_action = 0,
|
uint16_t value_action = 0,
|
||||||
const movement::ConditionBlob *condition = nullptr,
|
const Movement::ConditionBlob *condition = nullptr,
|
||||||
uint8_t ack = 0,
|
uint8_t ack = 0,
|
||||||
uint16_t ack_ttl_ms = 0,
|
uint16_t ack_ttl_ms = 0,
|
||||||
uint16_t post_delay_ms = 0) {
|
uint16_t post_delay_ms = 0) {
|
||||||
@@ -174,8 +174,8 @@ struct MovementSet FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
uint8_t num_movements() const {
|
uint8_t num_movements() const {
|
||||||
return GetField<uint8_t>(VT_NUM_MOVEMENTS, 0);
|
return GetField<uint8_t>(VT_NUM_MOVEMENTS, 0);
|
||||||
}
|
}
|
||||||
const ::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>> *movements() const {
|
const ::flatbuffers::Vector<::flatbuffers::Offset<Movement::MovementEntry>> *movements() const {
|
||||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>> *>(VT_MOVEMENTS);
|
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<Movement::MovementEntry>> *>(VT_MOVEMENTS);
|
||||||
}
|
}
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||||
@@ -195,7 +195,7 @@ struct MovementSetBuilder {
|
|||||||
void add_num_movements(uint8_t num_movements) {
|
void add_num_movements(uint8_t num_movements) {
|
||||||
fbb_.AddElement<uint8_t>(MovementSet::VT_NUM_MOVEMENTS, num_movements, 0);
|
fbb_.AddElement<uint8_t>(MovementSet::VT_NUM_MOVEMENTS, num_movements, 0);
|
||||||
}
|
}
|
||||||
void add_movements(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>>> movements) {
|
void add_movements(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Movement::MovementEntry>>> movements) {
|
||||||
fbb_.AddOffset(MovementSet::VT_MOVEMENTS, movements);
|
fbb_.AddOffset(MovementSet::VT_MOVEMENTS, movements);
|
||||||
}
|
}
|
||||||
explicit MovementSetBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
explicit MovementSetBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||||
@@ -212,7 +212,7 @@ struct MovementSetBuilder {
|
|||||||
inline ::flatbuffers::Offset<MovementSet> CreateMovementSet(
|
inline ::flatbuffers::Offset<MovementSet> CreateMovementSet(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
uint8_t num_movements = 0,
|
uint8_t num_movements = 0,
|
||||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<movement::MovementEntry>>> movements = 0) {
|
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Movement::MovementEntry>>> movements = 0) {
|
||||||
MovementSetBuilder builder_(_fbb);
|
MovementSetBuilder builder_(_fbb);
|
||||||
builder_.add_movements(movements);
|
builder_.add_movements(movements);
|
||||||
builder_.add_num_movements(num_movements);
|
builder_.add_num_movements(num_movements);
|
||||||
@@ -222,46 +222,46 @@ inline ::flatbuffers::Offset<MovementSet> CreateMovementSet(
|
|||||||
inline ::flatbuffers::Offset<MovementSet> CreateMovementSetDirect(
|
inline ::flatbuffers::Offset<MovementSet> CreateMovementSetDirect(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
uint8_t num_movements = 0,
|
uint8_t num_movements = 0,
|
||||||
const std::vector<::flatbuffers::Offset<movement::MovementEntry>> *movements = nullptr) {
|
const std::vector<::flatbuffers::Offset<Movement::MovementEntry>> *movements = nullptr) {
|
||||||
auto movements__ = movements ? _fbb.CreateVector<::flatbuffers::Offset<movement::MovementEntry>>(*movements) : 0;
|
auto movements__ = movements ? _fbb.CreateVector<::flatbuffers::Offset<Movement::MovementEntry>>(*movements) : 0;
|
||||||
return movement::CreateMovementSet(
|
return Movement::CreateMovementSet(
|
||||||
_fbb,
|
_fbb,
|
||||||
num_movements,
|
num_movements,
|
||||||
movements__);
|
movements__);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const movement::MovementSet *GetMovementSet(const void *buf) {
|
inline const Movement::MovementSet *GetMovementSet(const void *buf) {
|
||||||
return ::flatbuffers::GetRoot<movement::MovementSet>(buf);
|
return ::flatbuffers::GetRoot<Movement::MovementSet>(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const movement::MovementSet *GetSizePrefixedMovementSet(const void *buf) {
|
inline const Movement::MovementSet *GetSizePrefixedMovementSet(const void *buf) {
|
||||||
return ::flatbuffers::GetSizePrefixedRoot<movement::MovementSet>(buf);
|
return ::flatbuffers::GetSizePrefixedRoot<Movement::MovementSet>(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
inline bool VerifyMovementSetBuffer(
|
inline bool VerifyMovementSetBuffer(
|
||||||
::flatbuffers::VerifierTemplate<B> &verifier) {
|
::flatbuffers::VerifierTemplate<B> &verifier) {
|
||||||
return verifier.template VerifyBuffer<movement::MovementSet>(nullptr);
|
return verifier.template VerifyBuffer<Movement::MovementSet>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
inline bool VerifySizePrefixedMovementSetBuffer(
|
inline bool VerifySizePrefixedMovementSetBuffer(
|
||||||
::flatbuffers::VerifierTemplate<B> &verifier) {
|
::flatbuffers::VerifierTemplate<B> &verifier) {
|
||||||
return verifier.template VerifySizePrefixedBuffer<movement::MovementSet>(nullptr);
|
return verifier.template VerifySizePrefixedBuffer<Movement::MovementSet>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void FinishMovementSetBuffer(
|
inline void FinishMovementSetBuffer(
|
||||||
::flatbuffers::FlatBufferBuilder &fbb,
|
::flatbuffers::FlatBufferBuilder &fbb,
|
||||||
::flatbuffers::Offset<movement::MovementSet> root) {
|
::flatbuffers::Offset<Movement::MovementSet> root) {
|
||||||
fbb.Finish(root);
|
fbb.Finish(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void FinishSizePrefixedMovementSetBuffer(
|
inline void FinishSizePrefixedMovementSetBuffer(
|
||||||
::flatbuffers::FlatBufferBuilder &fbb,
|
::flatbuffers::FlatBufferBuilder &fbb,
|
||||||
::flatbuffers::Offset<movement::MovementSet> root) {
|
::flatbuffers::Offset<Movement::MovementSet> root) {
|
||||||
fbb.FinishSizePrefixed(root);
|
fbb.FinishSizePrefixed(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace movement
|
} // namespace Movement
|
||||||
|
|
||||||
#endif // FLATBUFFERS_GENERATED_MOVEMENT_MOVEMENT_H_
|
#endif // FLATBUFFERS_GENERATED_MOVEMENT_MOVEMENT_H_
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
|
|||||||
FLATBUFFERS_VERSION_REVISION == 19,
|
FLATBUFFERS_VERSION_REVISION == 19,
|
||||||
"Non-compatible flatbuffers version included");
|
"Non-compatible flatbuffers version included");
|
||||||
|
|
||||||
namespace topology {
|
namespace Topology {
|
||||||
|
|
||||||
struct ChannelBoardConn;
|
struct ChannelBoardConn;
|
||||||
|
|
||||||
@@ -64,8 +64,8 @@ struct NeighbourBlob FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
uint8_t num_connections() const {
|
uint8_t num_connections() const {
|
||||||
return GetField<uint8_t>(VT_NUM_CONNECTIONS, 0);
|
return GetField<uint8_t>(VT_NUM_CONNECTIONS, 0);
|
||||||
}
|
}
|
||||||
const ::flatbuffers::Vector<const topology::ChannelBoardConn *> *neighbour_connections() const {
|
const ::flatbuffers::Vector<const Topology::ChannelBoardConn *> *neighbour_connections() const {
|
||||||
return GetPointer<const ::flatbuffers::Vector<const topology::ChannelBoardConn *> *>(VT_NEIGHBOUR_CONNECTIONS);
|
return GetPointer<const ::flatbuffers::Vector<const Topology::ChannelBoardConn *> *>(VT_NEIGHBOUR_CONNECTIONS);
|
||||||
}
|
}
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||||
@@ -88,7 +88,7 @@ struct NeighbourBlobBuilder {
|
|||||||
void add_num_connections(uint8_t num_connections) {
|
void add_num_connections(uint8_t num_connections) {
|
||||||
fbb_.AddElement<uint8_t>(NeighbourBlob::VT_NUM_CONNECTIONS, num_connections, 0);
|
fbb_.AddElement<uint8_t>(NeighbourBlob::VT_NUM_CONNECTIONS, num_connections, 0);
|
||||||
}
|
}
|
||||||
void add_neighbour_connections(::flatbuffers::Offset<::flatbuffers::Vector<const topology::ChannelBoardConn *>> neighbour_connections) {
|
void add_neighbour_connections(::flatbuffers::Offset<::flatbuffers::Vector<const Topology::ChannelBoardConn *>> neighbour_connections) {
|
||||||
fbb_.AddOffset(NeighbourBlob::VT_NEIGHBOUR_CONNECTIONS, neighbour_connections);
|
fbb_.AddOffset(NeighbourBlob::VT_NEIGHBOUR_CONNECTIONS, neighbour_connections);
|
||||||
}
|
}
|
||||||
explicit NeighbourBlobBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
explicit NeighbourBlobBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||||
@@ -106,7 +106,7 @@ inline ::flatbuffers::Offset<NeighbourBlob> CreateNeighbourBlob(
|
|||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
uint16_t curr_board_id = 0,
|
uint16_t curr_board_id = 0,
|
||||||
uint8_t num_connections = 0,
|
uint8_t num_connections = 0,
|
||||||
::flatbuffers::Offset<::flatbuffers::Vector<const topology::ChannelBoardConn *>> neighbour_connections = 0) {
|
::flatbuffers::Offset<::flatbuffers::Vector<const Topology::ChannelBoardConn *>> neighbour_connections = 0) {
|
||||||
NeighbourBlobBuilder builder_(_fbb);
|
NeighbourBlobBuilder builder_(_fbb);
|
||||||
builder_.add_neighbour_connections(neighbour_connections);
|
builder_.add_neighbour_connections(neighbour_connections);
|
||||||
builder_.add_curr_board_id(curr_board_id);
|
builder_.add_curr_board_id(curr_board_id);
|
||||||
@@ -118,9 +118,9 @@ inline ::flatbuffers::Offset<NeighbourBlob> CreateNeighbourBlobDirect(
|
|||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
uint16_t curr_board_id = 0,
|
uint16_t curr_board_id = 0,
|
||||||
uint8_t num_connections = 0,
|
uint8_t num_connections = 0,
|
||||||
const std::vector<topology::ChannelBoardConn> *neighbour_connections = nullptr) {
|
const std::vector<Topology::ChannelBoardConn> *neighbour_connections = nullptr) {
|
||||||
auto neighbour_connections__ = neighbour_connections ? _fbb.CreateVectorOfStructs<topology::ChannelBoardConn>(*neighbour_connections) : 0;
|
auto neighbour_connections__ = neighbour_connections ? _fbb.CreateVectorOfStructs<Topology::ChannelBoardConn>(*neighbour_connections) : 0;
|
||||||
return topology::CreateNeighbourBlob(
|
return Topology::CreateNeighbourBlob(
|
||||||
_fbb,
|
_fbb,
|
||||||
curr_board_id,
|
curr_board_id,
|
||||||
num_connections,
|
num_connections,
|
||||||
@@ -136,8 +136,8 @@ struct Topology FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
|||||||
uint16_t num_boards() const {
|
uint16_t num_boards() const {
|
||||||
return GetField<uint16_t>(VT_NUM_BOARDS, 0);
|
return GetField<uint16_t>(VT_NUM_BOARDS, 0);
|
||||||
}
|
}
|
||||||
const ::flatbuffers::Vector<::flatbuffers::Offset<topology::NeighbourBlob>> *boards() const {
|
const ::flatbuffers::Vector<::flatbuffers::Offset<Topology::NeighbourBlob>> *boards() const {
|
||||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<topology::NeighbourBlob>> *>(VT_BOARDS);
|
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<Topology::NeighbourBlob>> *>(VT_BOARDS);
|
||||||
}
|
}
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
bool Verify(::flatbuffers::VerifierTemplate<B> &verifier) const {
|
||||||
@@ -157,7 +157,7 @@ struct TopologyBuilder {
|
|||||||
void add_num_boards(uint16_t num_boards) {
|
void add_num_boards(uint16_t num_boards) {
|
||||||
fbb_.AddElement<uint16_t>(Topology::VT_NUM_BOARDS, num_boards, 0);
|
fbb_.AddElement<uint16_t>(Topology::VT_NUM_BOARDS, num_boards, 0);
|
||||||
}
|
}
|
||||||
void add_boards(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<topology::NeighbourBlob>>> boards) {
|
void add_boards(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Topology::NeighbourBlob>>> boards) {
|
||||||
fbb_.AddOffset(Topology::VT_BOARDS, boards);
|
fbb_.AddOffset(Topology::VT_BOARDS, boards);
|
||||||
}
|
}
|
||||||
explicit TopologyBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
explicit TopologyBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
|
||||||
@@ -174,7 +174,7 @@ struct TopologyBuilder {
|
|||||||
inline ::flatbuffers::Offset<Topology> CreateTopology(
|
inline ::flatbuffers::Offset<Topology> CreateTopology(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
uint16_t num_boards = 0,
|
uint16_t num_boards = 0,
|
||||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<topology::NeighbourBlob>>> boards = 0) {
|
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Topology::NeighbourBlob>>> boards = 0) {
|
||||||
TopologyBuilder builder_(_fbb);
|
TopologyBuilder builder_(_fbb);
|
||||||
builder_.add_boards(boards);
|
builder_.add_boards(boards);
|
||||||
builder_.add_num_boards(num_boards);
|
builder_.add_num_boards(num_boards);
|
||||||
@@ -184,46 +184,46 @@ inline ::flatbuffers::Offset<Topology> CreateTopology(
|
|||||||
inline ::flatbuffers::Offset<Topology> CreateTopologyDirect(
|
inline ::flatbuffers::Offset<Topology> CreateTopologyDirect(
|
||||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||||
uint16_t num_boards = 0,
|
uint16_t num_boards = 0,
|
||||||
const std::vector<::flatbuffers::Offset<topology::NeighbourBlob>> *boards = nullptr) {
|
const std::vector<::flatbuffers::Offset<Topology::NeighbourBlob>> *boards = nullptr) {
|
||||||
auto boards__ = boards ? _fbb.CreateVector<::flatbuffers::Offset<topology::NeighbourBlob>>(*boards) : 0;
|
auto boards__ = boards ? _fbb.CreateVector<::flatbuffers::Offset<Topology::NeighbourBlob>>(*boards) : 0;
|
||||||
return topology::CreateTopology(
|
return Topology::CreateTopology(
|
||||||
_fbb,
|
_fbb,
|
||||||
num_boards,
|
num_boards,
|
||||||
boards__);
|
boards__);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const topology::Topology *GetTopology(const void *buf) {
|
inline const Topology::Topology *GetTopology(const void *buf) {
|
||||||
return ::flatbuffers::GetRoot<topology::Topology>(buf);
|
return ::flatbuffers::GetRoot<Topology::Topology>(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const topology::Topology *GetSizePrefixedTopology(const void *buf) {
|
inline const Topology::Topology *GetSizePrefixedTopology(const void *buf) {
|
||||||
return ::flatbuffers::GetSizePrefixedRoot<topology::Topology>(buf);
|
return ::flatbuffers::GetSizePrefixedRoot<Topology::Topology>(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
inline bool VerifyTopologyBuffer(
|
inline bool VerifyTopologyBuffer(
|
||||||
::flatbuffers::VerifierTemplate<B> &verifier) {
|
::flatbuffers::VerifierTemplate<B> &verifier) {
|
||||||
return verifier.template VerifyBuffer<topology::Topology>(nullptr);
|
return verifier.template VerifyBuffer<Topology::Topology>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool B = false>
|
template <bool B = false>
|
||||||
inline bool VerifySizePrefixedTopologyBuffer(
|
inline bool VerifySizePrefixedTopologyBuffer(
|
||||||
::flatbuffers::VerifierTemplate<B> &verifier) {
|
::flatbuffers::VerifierTemplate<B> &verifier) {
|
||||||
return verifier.template VerifySizePrefixedBuffer<topology::Topology>(nullptr);
|
return verifier.template VerifySizePrefixedBuffer<Topology::Topology>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void FinishTopologyBuffer(
|
inline void FinishTopologyBuffer(
|
||||||
::flatbuffers::FlatBufferBuilder &fbb,
|
::flatbuffers::FlatBufferBuilder &fbb,
|
||||||
::flatbuffers::Offset<topology::Topology> root) {
|
::flatbuffers::Offset<Topology::Topology> root) {
|
||||||
fbb.Finish(root);
|
fbb.Finish(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void FinishSizePrefixedTopologyBuffer(
|
inline void FinishSizePrefixedTopologyBuffer(
|
||||||
::flatbuffers::FlatBufferBuilder &fbb,
|
::flatbuffers::FlatBufferBuilder &fbb,
|
||||||
::flatbuffers::Offset<topology::Topology> root) {
|
::flatbuffers::Offset<Topology::Topology> root) {
|
||||||
fbb.FinishSizePrefixed(root);
|
fbb.FinishSizePrefixed(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace topology
|
} // namespace Topology
|
||||||
|
|
||||||
#endif // FLATBUFFERS_GENERATED_TOPOLOGY_TOPOLOGY_H_
|
#endif // FLATBUFFERS_GENERATED_TOPOLOGY_TOPOLOGY_H_
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class MovementSetManager {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<TopologyManager> topology_manager;
|
std::unique_ptr<TopologyManager> topology_manager;
|
||||||
std::vector<struct MovementEntry> movements;
|
// std::vector<struct MovementEntry> movements;
|
||||||
nvs_handle_t handle;
|
nvs_handle_t handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user