mirror of
https://github.com/BotChain-Robots/control.git
synced 2026-03-10 00:32:26 +01:00
Prepare files for public release
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_ANGLECONTROLMESSAGE_MESSAGING_H_
|
||||
#define FLATBUFFERS_GENERATED_ANGLECONTROLMESSAGE_MESSAGING_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 == 2 &&
|
||||
// FLATBUFFERS_VERSION_REVISION == 10,
|
||||
//"Non-compatible flatbuffers version included");
|
||||
|
||||
namespace Messaging {
|
||||
|
||||
struct AngleControlMessage;
|
||||
struct AngleControlMessageBuilder;
|
||||
|
||||
struct AngleControlMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef AngleControlMessageBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ANGLE = 4 };
|
||||
int16_t angle() const {
|
||||
return GetField<int16_t>(VT_ANGLE, 0);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<int16_t>(verifier, VT_ANGLE, 2) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct AngleControlMessageBuilder {
|
||||
typedef AngleControlMessage Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_angle(int16_t angle) {
|
||||
fbb_.AddElement<int16_t>(AngleControlMessage::VT_ANGLE, angle, 0);
|
||||
}
|
||||
explicit AngleControlMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<AngleControlMessage> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<AngleControlMessage>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<AngleControlMessage>
|
||||
CreateAngleControlMessage(::flatbuffers::FlatBufferBuilder &_fbb, int16_t angle = 0) {
|
||||
AngleControlMessageBuilder builder_(_fbb);
|
||||
builder_.add_angle(angle);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline const Messaging::AngleControlMessage *GetAngleControlMessage(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Messaging::AngleControlMessage>(buf);
|
||||
}
|
||||
|
||||
inline const Messaging::AngleControlMessage *GetSizePrefixedAngleControlMessage(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Messaging::AngleControlMessage>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyAngleControlMessageBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Messaging::AngleControlMessage>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedAngleControlMessageBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Messaging::AngleControlMessage>(nullptr);
|
||||
}
|
||||
|
||||
inline void
|
||||
FinishAngleControlMessageBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Messaging::AngleControlMessage> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedAngleControlMessageBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Messaging::AngleControlMessage> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Messaging
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_ANGLECONTROLMESSAGE_MESSAGING_H_
|
||||
201
include/flatbuffers_generated/RobotConfiguration_generated.h
Normal file
201
include/flatbuffers_generated/RobotConfiguration_generated.h
Normal file
@@ -0,0 +1,201 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_ROBOTCONFIGURATION_FRONTEND_H_
|
||||
#define FLATBUFFERS_GENERATED_ROBOTCONFIGURATION_FRONTEND_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 == 2 &&
|
||||
// FLATBUFFERS_VERSION_REVISION == 10,
|
||||
// "Non-compatible flatbuffers version included");
|
||||
|
||||
#include "RobotModule_generated.h"
|
||||
|
||||
namespace Frontend {
|
||||
|
||||
struct ModuleConnection;
|
||||
struct ModuleConnectionBuilder;
|
||||
|
||||
struct RobotConfiguration;
|
||||
struct RobotConfigurationBuilder;
|
||||
|
||||
struct ModuleConnection FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef ModuleConnectionBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_FROM_MODULE_ID = 4,
|
||||
VT_TO_MODULE_ID = 6,
|
||||
VT_FROM_SOCKET = 8,
|
||||
VT_TO_SOCKET = 10,
|
||||
VT_ORIENTATION = 12
|
||||
};
|
||||
uint8_t from_module_id() const {
|
||||
return GetField<uint8_t>(VT_FROM_MODULE_ID, 0);
|
||||
}
|
||||
uint8_t to_module_id() const {
|
||||
return GetField<uint8_t>(VT_TO_MODULE_ID, 0);
|
||||
}
|
||||
uint8_t from_socket() const {
|
||||
return GetField<uint8_t>(VT_FROM_SOCKET, 0);
|
||||
}
|
||||
uint8_t to_socket() const {
|
||||
return GetField<uint8_t>(VT_TO_SOCKET, 0);
|
||||
}
|
||||
Orientation orientation() const {
|
||||
return static_cast<Orientation>(GetField<int8_t>(VT_ORIENTATION, 0));
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<uint8_t>(verifier, VT_FROM_MODULE_ID, 1) &&
|
||||
VerifyField<uint8_t>(verifier, VT_TO_MODULE_ID, 1) &&
|
||||
VerifyField<uint8_t>(verifier, VT_FROM_SOCKET, 1) &&
|
||||
VerifyField<uint8_t>(verifier, VT_TO_SOCKET, 1) &&
|
||||
VerifyField<int8_t>(verifier, VT_ORIENTATION, 1) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct ModuleConnectionBuilder {
|
||||
typedef ModuleConnection Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_from_module_id(uint8_t from_module_id) {
|
||||
fbb_.AddElement<uint8_t>(ModuleConnection::VT_FROM_MODULE_ID, from_module_id, 0);
|
||||
}
|
||||
void add_to_module_id(uint8_t to_module_id) {
|
||||
fbb_.AddElement<uint8_t>(ModuleConnection::VT_TO_MODULE_ID, to_module_id, 0);
|
||||
}
|
||||
void add_from_socket(uint8_t from_socket) {
|
||||
fbb_.AddElement<uint8_t>(ModuleConnection::VT_FROM_SOCKET, from_socket, 0);
|
||||
}
|
||||
void add_to_socket(uint8_t to_socket) {
|
||||
fbb_.AddElement<uint8_t>(ModuleConnection::VT_TO_SOCKET, to_socket, 0);
|
||||
}
|
||||
void add_orientation(Orientation orientation) {
|
||||
fbb_.AddElement<int8_t>(ModuleConnection::VT_ORIENTATION, static_cast<int8_t>(orientation),
|
||||
0);
|
||||
}
|
||||
explicit ModuleConnectionBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<ModuleConnection> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<ModuleConnection>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<ModuleConnection>
|
||||
CreateModuleConnection(::flatbuffers::FlatBufferBuilder &_fbb, uint8_t from_module_id = 0,
|
||||
uint8_t to_module_id = 0, uint8_t from_socket = 0, uint8_t to_socket = 0,
|
||||
Orientation orientation = Orientation_Deg0) {
|
||||
ModuleConnectionBuilder builder_(_fbb);
|
||||
builder_.add_orientation(orientation);
|
||||
builder_.add_to_socket(to_socket);
|
||||
builder_.add_from_socket(from_socket);
|
||||
builder_.add_to_module_id(to_module_id);
|
||||
builder_.add_from_module_id(from_module_id);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct RobotConfiguration FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef RobotConfigurationBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_MODULES = 4,
|
||||
VT_CONNECTIONS = 6
|
||||
};
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<RobotModule>> *modules() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<RobotModule>> *>(
|
||||
VT_MODULES);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<Frontend::ModuleConnection>> *
|
||||
connections() const {
|
||||
return GetPointer<
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<Frontend::ModuleConnection>> *>(
|
||||
VT_CONNECTIONS);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_MODULES) &&
|
||||
verifier.VerifyVector(modules()) && verifier.VerifyVectorOfTables(modules()) &&
|
||||
VerifyOffset(verifier, VT_CONNECTIONS) && verifier.VerifyVector(connections()) &&
|
||||
verifier.VerifyVectorOfTables(connections()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct RobotConfigurationBuilder {
|
||||
typedef RobotConfiguration Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_modules(
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<RobotModule>>> modules) {
|
||||
fbb_.AddOffset(RobotConfiguration::VT_MODULES, modules);
|
||||
}
|
||||
void add_connections(::flatbuffers::Offset<
|
||||
::flatbuffers::Vector<::flatbuffers::Offset<Frontend::ModuleConnection>>>
|
||||
connections) {
|
||||
fbb_.AddOffset(RobotConfiguration::VT_CONNECTIONS, connections);
|
||||
}
|
||||
explicit RobotConfigurationBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<RobotConfiguration> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<RobotConfiguration>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<RobotConfiguration> CreateRobotConfiguration(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<RobotModule>>> modules = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<Frontend::ModuleConnection>>>
|
||||
connections = 0) {
|
||||
RobotConfigurationBuilder builder_(_fbb);
|
||||
builder_.add_connections(connections);
|
||||
builder_.add_modules(modules);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline ::flatbuffers::Offset<RobotConfiguration> CreateRobotConfigurationDirect(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const std::vector<::flatbuffers::Offset<RobotModule>> *modules = nullptr,
|
||||
const std::vector<::flatbuffers::Offset<Frontend::ModuleConnection>> *connections = nullptr) {
|
||||
auto modules__ = modules ? _fbb.CreateVector<::flatbuffers::Offset<RobotModule>>(*modules) : 0;
|
||||
auto connections__ =
|
||||
connections
|
||||
? _fbb.CreateVector<::flatbuffers::Offset<Frontend::ModuleConnection>>(*connections)
|
||||
: 0;
|
||||
return Frontend::CreateRobotConfiguration(_fbb, modules__, connections__);
|
||||
}
|
||||
|
||||
inline const Frontend::RobotConfiguration *GetRobotConfiguration(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Frontend::RobotConfiguration>(buf);
|
||||
}
|
||||
|
||||
inline const Frontend::RobotConfiguration *GetSizePrefixedRobotConfiguration(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Frontend::RobotConfiguration>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyRobotConfigurationBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Frontend::RobotConfiguration>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedRobotConfigurationBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Frontend::RobotConfiguration>(nullptr);
|
||||
}
|
||||
|
||||
inline void
|
||||
FinishRobotConfigurationBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Frontend::RobotConfiguration> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedRobotConfigurationBuffer(
|
||||
::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Frontend::RobotConfiguration> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Frontend
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_ROBOTCONFIGURATION_FRONTEND_H_
|
||||
288
include/flatbuffers_generated/RobotModule_generated.h
Normal file
288
include/flatbuffers_generated/RobotModule_generated.h
Normal file
@@ -0,0 +1,288 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_ROBOTMODULE_H_
|
||||
#define FLATBUFFERS_GENERATED_ROBOTMODULE_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 == 2 &&
|
||||
// FLATBUFFERS_VERSION_REVISION == 10,
|
||||
// "Non-compatible flatbuffers version included");
|
||||
|
||||
struct MotorState;
|
||||
struct MotorStateBuilder;
|
||||
|
||||
struct RobotModule;
|
||||
struct RobotModuleBuilder;
|
||||
|
||||
enum ModuleType : int8_t {
|
||||
ModuleType_SPLITTER = 0,
|
||||
ModuleType_SERVO_1 = 1,
|
||||
ModuleType_DC_MOTOR = 2,
|
||||
ModuleType_BATTERY = 3,
|
||||
ModuleType_SERVO_2 = 4,
|
||||
ModuleType_MIN = ModuleType_SPLITTER,
|
||||
ModuleType_MAX = ModuleType_SERVO_2
|
||||
};
|
||||
|
||||
inline const ModuleType (&EnumValuesModuleType())[5] {
|
||||
static const ModuleType values[] = {ModuleType_SPLITTER, ModuleType_SERVO_1,
|
||||
ModuleType_DC_MOTOR, ModuleType_BATTERY,
|
||||
ModuleType_SERVO_2};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char *const *EnumNamesModuleType() {
|
||||
static const char *const names[6] = {"SPLITTER", "SERVO_1", "DC_MOTOR",
|
||||
"BATTERY", "SERVO_2", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameModuleType(ModuleType e) {
|
||||
if (::flatbuffers::IsOutRange(e, ModuleType_SPLITTER, ModuleType_SERVO_2))
|
||||
return "";
|
||||
const size_t index = static_cast<size_t>(e);
|
||||
return EnumNamesModuleType()[index];
|
||||
}
|
||||
|
||||
enum Orientation : int8_t {
|
||||
Orientation_Deg0 = 0,
|
||||
Orientation_Deg90 = 1,
|
||||
Orientation_Deg180 = 2,
|
||||
Orientation_Deg270 = 3,
|
||||
Orientation_MIN = Orientation_Deg0,
|
||||
Orientation_MAX = Orientation_Deg270
|
||||
};
|
||||
|
||||
inline const Orientation (&EnumValuesOrientation())[4] {
|
||||
static const Orientation values[] = {Orientation_Deg0, Orientation_Deg90, Orientation_Deg180,
|
||||
Orientation_Deg270};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char *const *EnumNamesOrientation() {
|
||||
static const char *const names[5] = {"Deg0", "Deg90", "Deg180", "Deg270", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameOrientation(Orientation e) {
|
||||
if (::flatbuffers::IsOutRange(e, Orientation_Deg0, Orientation_Deg270))
|
||||
return "";
|
||||
const size_t index = static_cast<size_t>(e);
|
||||
return EnumNamesOrientation()[index];
|
||||
}
|
||||
|
||||
enum ModuleState : uint8_t {
|
||||
ModuleState_NONE = 0,
|
||||
ModuleState_MotorState = 1,
|
||||
ModuleState_MIN = ModuleState_NONE,
|
||||
ModuleState_MAX = ModuleState_MotorState
|
||||
};
|
||||
|
||||
inline const ModuleState (&EnumValuesModuleState())[2] {
|
||||
static const ModuleState values[] = {ModuleState_NONE, ModuleState_MotorState};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char *const *EnumNamesModuleState() {
|
||||
static const char *const names[3] = {"NONE", "MotorState", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameModuleState(ModuleState e) {
|
||||
if (::flatbuffers::IsOutRange(e, ModuleState_NONE, ModuleState_MotorState))
|
||||
return "";
|
||||
const size_t index = static_cast<size_t>(e);
|
||||
return EnumNamesModuleState()[index];
|
||||
}
|
||||
|
||||
template <typename T> struct ModuleStateTraits {
|
||||
static const ModuleState enum_value = ModuleState_NONE;
|
||||
};
|
||||
|
||||
template <> struct ModuleStateTraits<MotorState> {
|
||||
static const ModuleState enum_value = ModuleState_MotorState;
|
||||
};
|
||||
|
||||
bool VerifyModuleState(::flatbuffers::Verifier &verifier, const void *obj, ModuleState type);
|
||||
bool VerifyModuleStateVector(::flatbuffers::Verifier &verifier,
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values,
|
||||
const ::flatbuffers::Vector<uint8_t> *types);
|
||||
|
||||
struct MotorState FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef MotorStateBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ANGLE = 4 };
|
||||
int32_t angle() const {
|
||||
return GetField<int32_t>(VT_ANGLE, 0);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<int32_t>(verifier, VT_ANGLE, 4) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct MotorStateBuilder {
|
||||
typedef MotorState Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_angle(int32_t angle) {
|
||||
fbb_.AddElement<int32_t>(MotorState::VT_ANGLE, angle, 0);
|
||||
}
|
||||
explicit MotorStateBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<MotorState> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<MotorState>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<MotorState> CreateMotorState(::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int32_t angle = 0) {
|
||||
MotorStateBuilder builder_(_fbb);
|
||||
builder_.add_angle(angle);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct RobotModule FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef RobotModuleBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_ID = 4,
|
||||
VT_MODULE_TYPE = 6,
|
||||
VT_CONFIGURATION_TYPE = 8,
|
||||
VT_CONFIGURATION = 10
|
||||
};
|
||||
uint8_t id() const {
|
||||
return GetField<uint8_t>(VT_ID, 0);
|
||||
}
|
||||
ModuleType module_type() const {
|
||||
return static_cast<ModuleType>(GetField<int8_t>(VT_MODULE_TYPE, 0));
|
||||
}
|
||||
ModuleState configuration_type() const {
|
||||
return static_cast<ModuleState>(GetField<uint8_t>(VT_CONFIGURATION_TYPE, 0));
|
||||
}
|
||||
const void *configuration() const {
|
||||
return GetPointer<const void *>(VT_CONFIGURATION);
|
||||
}
|
||||
template <typename T> const T *configuration_as() const;
|
||||
const MotorState *configuration_as_MotorState() const {
|
||||
return configuration_type() == ModuleState_MotorState
|
||||
? static_cast<const MotorState *>(configuration())
|
||||
: nullptr;
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<uint8_t>(verifier, VT_ID, 1) &&
|
||||
VerifyField<int8_t>(verifier, VT_MODULE_TYPE, 1) &&
|
||||
VerifyField<uint8_t>(verifier, VT_CONFIGURATION_TYPE, 1) &&
|
||||
VerifyOffset(verifier, VT_CONFIGURATION) &&
|
||||
VerifyModuleState(verifier, configuration(), configuration_type()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
template <> inline const MotorState *RobotModule::configuration_as<MotorState>() const {
|
||||
return configuration_as_MotorState();
|
||||
}
|
||||
|
||||
struct RobotModuleBuilder {
|
||||
typedef RobotModule Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_id(uint8_t id) {
|
||||
fbb_.AddElement<uint8_t>(RobotModule::VT_ID, id, 0);
|
||||
}
|
||||
void add_module_type(ModuleType module_type) {
|
||||
fbb_.AddElement<int8_t>(RobotModule::VT_MODULE_TYPE, static_cast<int8_t>(module_type), 0);
|
||||
}
|
||||
void add_configuration_type(ModuleState configuration_type) {
|
||||
fbb_.AddElement<uint8_t>(RobotModule::VT_CONFIGURATION_TYPE,
|
||||
static_cast<uint8_t>(configuration_type), 0);
|
||||
}
|
||||
void add_configuration(::flatbuffers::Offset<void> configuration) {
|
||||
fbb_.AddOffset(RobotModule::VT_CONFIGURATION, configuration);
|
||||
}
|
||||
explicit RobotModuleBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<RobotModule> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<RobotModule>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<RobotModule>
|
||||
CreateRobotModule(::flatbuffers::FlatBufferBuilder &_fbb, uint8_t id = 0,
|
||||
ModuleType module_type = ModuleType_SPLITTER,
|
||||
ModuleState configuration_type = ModuleState_NONE,
|
||||
::flatbuffers::Offset<void> configuration = 0) {
|
||||
RobotModuleBuilder builder_(_fbb);
|
||||
builder_.add_configuration(configuration);
|
||||
builder_.add_configuration_type(configuration_type);
|
||||
builder_.add_module_type(module_type);
|
||||
builder_.add_id(id);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline bool VerifyModuleState(::flatbuffers::Verifier &verifier, const void *obj,
|
||||
ModuleState type) {
|
||||
switch (type) {
|
||||
case ModuleState_NONE: {
|
||||
return true;
|
||||
}
|
||||
case ModuleState_MotorState: {
|
||||
auto ptr = reinterpret_cast<const MotorState *>(obj);
|
||||
return verifier.VerifyTable(ptr);
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool
|
||||
VerifyModuleStateVector(::flatbuffers::Verifier &verifier,
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values,
|
||||
const ::flatbuffers::Vector<uint8_t> *types) {
|
||||
if (!values || !types)
|
||||
return !values && !types;
|
||||
if (values->size() != types->size())
|
||||
return false;
|
||||
for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
|
||||
if (!VerifyModuleState(verifier, values->Get(i), types->GetEnum<ModuleState>(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline const RobotModule *GetRobotModule(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<RobotModule>(buf);
|
||||
}
|
||||
|
||||
inline const RobotModule *GetSizePrefixedRobotModule(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<RobotModule>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyRobotModuleBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<RobotModule>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedRobotModuleBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<RobotModule>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishRobotModuleBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<RobotModule> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void FinishSizePrefixedRobotModuleBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<RobotModule> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_ROBOTMODULE_H_
|
||||
265
include/flatbuffers_generated/SensorMessage_generated.h
Normal file
265
include/flatbuffers_generated/SensorMessage_generated.h
Normal file
@@ -0,0 +1,265 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_SENSORMESSAGE_MESSAGING_H_
|
||||
#define FLATBUFFERS_GENERATED_SENSORMESSAGE_MESSAGING_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 == 2 &&
|
||||
// FLATBUFFERS_VERSION_REVISION == 10,
|
||||
// "Non-compatible flatbuffers version included");
|
||||
|
||||
namespace Messaging {
|
||||
|
||||
struct TargetAngle;
|
||||
struct TargetAngleBuilder;
|
||||
|
||||
struct CurrentAngle;
|
||||
struct CurrentAngleBuilder;
|
||||
|
||||
struct SensorMessage;
|
||||
struct SensorMessageBuilder;
|
||||
|
||||
enum SensorValue : uint8_t {
|
||||
SensorValue_NONE = 0,
|
||||
SensorValue_TargetAngle = 1,
|
||||
SensorValue_CurrentAngle = 2,
|
||||
SensorValue_MIN = SensorValue_NONE,
|
||||
SensorValue_MAX = SensorValue_CurrentAngle
|
||||
};
|
||||
|
||||
inline const SensorValue (&EnumValuesSensorValue())[3] {
|
||||
static const SensorValue values[] = {SensorValue_NONE, SensorValue_TargetAngle,
|
||||
SensorValue_CurrentAngle};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char *const *EnumNamesSensorValue() {
|
||||
static const char *const names[4] = {"NONE", "TargetAngle", "CurrentAngle", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameSensorValue(SensorValue e) {
|
||||
if (::flatbuffers::IsOutRange(e, SensorValue_NONE, SensorValue_CurrentAngle))
|
||||
return "";
|
||||
const size_t index = static_cast<size_t>(e);
|
||||
return EnumNamesSensorValue()[index];
|
||||
}
|
||||
|
||||
template <typename T> struct SensorValueTraits {
|
||||
static const SensorValue enum_value = SensorValue_NONE;
|
||||
};
|
||||
|
||||
template <> struct SensorValueTraits<Messaging::TargetAngle> {
|
||||
static const SensorValue enum_value = SensorValue_TargetAngle;
|
||||
};
|
||||
|
||||
template <> struct SensorValueTraits<Messaging::CurrentAngle> {
|
||||
static const SensorValue enum_value = SensorValue_CurrentAngle;
|
||||
};
|
||||
|
||||
bool VerifySensorValue(::flatbuffers::Verifier &verifier, const void *obj, SensorValue type);
|
||||
bool VerifySensorValueVector(::flatbuffers::Verifier &verifier,
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values,
|
||||
const ::flatbuffers::Vector<uint8_t> *types);
|
||||
|
||||
struct TargetAngle FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef TargetAngleBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_VALUE = 4 };
|
||||
int16_t value() const {
|
||||
return GetField<int16_t>(VT_VALUE, 0);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<int16_t>(verifier, VT_VALUE, 2) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct TargetAngleBuilder {
|
||||
typedef TargetAngle Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_value(int16_t value) {
|
||||
fbb_.AddElement<int16_t>(TargetAngle::VT_VALUE, value, 0);
|
||||
}
|
||||
explicit TargetAngleBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<TargetAngle> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<TargetAngle>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<TargetAngle> CreateTargetAngle(::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
int16_t value = 0) {
|
||||
TargetAngleBuilder builder_(_fbb);
|
||||
builder_.add_value(value);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct CurrentAngle FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef CurrentAngleBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_VALUE = 4 };
|
||||
int16_t value() const {
|
||||
return GetField<int16_t>(VT_VALUE, 0);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<int16_t>(verifier, VT_VALUE, 2) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct CurrentAngleBuilder {
|
||||
typedef CurrentAngle Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_value(int16_t value) {
|
||||
fbb_.AddElement<int16_t>(CurrentAngle::VT_VALUE, value, 0);
|
||||
}
|
||||
explicit CurrentAngleBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<CurrentAngle> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<CurrentAngle>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<CurrentAngle>
|
||||
CreateCurrentAngle(::flatbuffers::FlatBufferBuilder &_fbb, int16_t value = 0) {
|
||||
CurrentAngleBuilder builder_(_fbb);
|
||||
builder_.add_value(value);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
struct SensorMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef SensorMessageBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_VALUES_TYPE = 4,
|
||||
VT_VALUES = 6
|
||||
};
|
||||
const ::flatbuffers::Vector<uint8_t> *values_type() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<uint8_t> *>(VT_VALUES_TYPE);
|
||||
}
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *>(VT_VALUES);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_VALUES_TYPE) &&
|
||||
verifier.VerifyVector(values_type()) && VerifyOffset(verifier, VT_VALUES) &&
|
||||
verifier.VerifyVector(values()) &&
|
||||
VerifySensorValueVector(verifier, values(), values_type()) && verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct SensorMessageBuilder {
|
||||
typedef SensorMessage Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_values_type(::flatbuffers::Offset<::flatbuffers::Vector<uint8_t>> values_type) {
|
||||
fbb_.AddOffset(SensorMessage::VT_VALUES_TYPE, values_type);
|
||||
}
|
||||
void
|
||||
add_values(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<void>>> values) {
|
||||
fbb_.AddOffset(SensorMessage::VT_VALUES, values);
|
||||
}
|
||||
explicit SensorMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<SensorMessage> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<SensorMessage>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<SensorMessage> CreateSensorMessage(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<uint8_t>> values_type = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<void>>> values = 0) {
|
||||
SensorMessageBuilder builder_(_fbb);
|
||||
builder_.add_values(values);
|
||||
builder_.add_values_type(values_type);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline ::flatbuffers::Offset<SensorMessage>
|
||||
CreateSensorMessageDirect(::flatbuffers::FlatBufferBuilder &_fbb,
|
||||
const std::vector<uint8_t> *values_type = nullptr,
|
||||
const std::vector<::flatbuffers::Offset<void>> *values = nullptr) {
|
||||
auto values_type__ = values_type ? _fbb.CreateVector<uint8_t>(*values_type) : 0;
|
||||
auto values__ = values ? _fbb.CreateVector<::flatbuffers::Offset<void>>(*values) : 0;
|
||||
return Messaging::CreateSensorMessage(_fbb, values_type__, values__);
|
||||
}
|
||||
|
||||
inline bool VerifySensorValue(::flatbuffers::Verifier &verifier, const void *obj,
|
||||
SensorValue type) {
|
||||
switch (type) {
|
||||
case SensorValue_NONE: {
|
||||
return true;
|
||||
}
|
||||
case SensorValue_TargetAngle: {
|
||||
auto ptr = reinterpret_cast<const Messaging::TargetAngle *>(obj);
|
||||
return verifier.VerifyTable(ptr);
|
||||
}
|
||||
case SensorValue_CurrentAngle: {
|
||||
auto ptr = reinterpret_cast<const Messaging::CurrentAngle *>(obj);
|
||||
return verifier.VerifyTable(ptr);
|
||||
}
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool
|
||||
VerifySensorValueVector(::flatbuffers::Verifier &verifier,
|
||||
const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values,
|
||||
const ::flatbuffers::Vector<uint8_t> *types) {
|
||||
if (!values || !types)
|
||||
return !values && !types;
|
||||
if (values->size() != types->size())
|
||||
return false;
|
||||
for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
|
||||
if (!VerifySensorValue(verifier, values->Get(i), types->GetEnum<SensorValue>(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
inline const Messaging::SensorMessage *GetSensorMessage(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Messaging::SensorMessage>(buf);
|
||||
}
|
||||
|
||||
inline const Messaging::SensorMessage *GetSizePrefixedSensorMessage(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Messaging::SensorMessage>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifySensorMessageBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Messaging::SensorMessage>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedSensorMessageBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Messaging::SensorMessage>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishSensorMessageBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Messaging::SensorMessage> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void
|
||||
FinishSizePrefixedSensorMessageBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Messaging::SensorMessage> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Messaging
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_SENSORMESSAGE_MESSAGING_H_
|
||||
203
include/flatbuffers_generated/TopologyMessage_generated.h
Normal file
203
include/flatbuffers_generated/TopologyMessage_generated.h
Normal file
@@ -0,0 +1,203 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
#ifndef FLATBUFFERS_GENERATED_TOPOLOGYMESSAGE_MESSAGING_H_
|
||||
#define FLATBUFFERS_GENERATED_TOPOLOGYMESSAGE_MESSAGING_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 == 2 &&
|
||||
// FLATBUFFERS_VERSION_REVISION == 10,
|
||||
// "Non-compatible flatbuffers version included");
|
||||
|
||||
#include "RobotModule_generated.h"
|
||||
|
||||
namespace Messaging {
|
||||
|
||||
struct TopologyMessage;
|
||||
struct TopologyMessageBuilder;
|
||||
|
||||
enum ConnectionType : int8_t {
|
||||
ConnectionType_DIRECT = 0,
|
||||
ConnectionType_HOP = 1,
|
||||
ConnectionType_MIN = ConnectionType_DIRECT,
|
||||
ConnectionType_MAX = ConnectionType_HOP
|
||||
};
|
||||
|
||||
inline const ConnectionType (&EnumValuesConnectionType())[2] {
|
||||
static const ConnectionType values[] = {ConnectionType_DIRECT, ConnectionType_HOP};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char *const *EnumNamesConnectionType() {
|
||||
static const char *const names[3] = {"DIRECT", "HOP", nullptr};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameConnectionType(ConnectionType e) {
|
||||
if (::flatbuffers::IsOutRange(e, ConnectionType_DIRECT, ConnectionType_HOP))
|
||||
return "";
|
||||
const size_t index = static_cast<size_t>(e);
|
||||
return EnumNamesConnectionType()[index];
|
||||
}
|
||||
|
||||
struct TopologyMessage FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
|
||||
typedef TopologyMessageBuilder Builder;
|
||||
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
|
||||
VT_MODULE_ID = 4,
|
||||
VT_MODULE_TYPE = 6,
|
||||
VT_NUM_CHANNELS = 8,
|
||||
VT_CHANNEL_TO_MODULE = 10,
|
||||
VT_CHANNEL_TO_ORIENTATION = 12,
|
||||
VT_CONNECTION = 14,
|
||||
VT_LEADER = 16,
|
||||
VT_FIRMWARE = 18
|
||||
};
|
||||
uint8_t module_id() const {
|
||||
return GetField<uint8_t>(VT_MODULE_ID, 0);
|
||||
}
|
||||
ModuleType module_type() const {
|
||||
return static_cast<ModuleType>(GetField<int8_t>(VT_MODULE_TYPE, 0));
|
||||
}
|
||||
uint8_t num_channels() const {
|
||||
return GetField<uint8_t>(VT_NUM_CHANNELS, 0);
|
||||
}
|
||||
const ::flatbuffers::Vector<uint8_t> *channel_to_module() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<uint8_t> *>(VT_CHANNEL_TO_MODULE);
|
||||
}
|
||||
const ::flatbuffers::Vector<int8_t> *channel_to_orientation() const {
|
||||
return GetPointer<const ::flatbuffers::Vector<int8_t> *>(VT_CHANNEL_TO_ORIENTATION);
|
||||
}
|
||||
Messaging::ConnectionType connection() const {
|
||||
return static_cast<Messaging::ConnectionType>(GetField<int8_t>(VT_CONNECTION, 0));
|
||||
}
|
||||
uint8_t leader() const {
|
||||
return GetField<uint8_t>(VT_LEADER, 0);
|
||||
}
|
||||
const ::flatbuffers::String *firmware() const {
|
||||
return GetPointer<const ::flatbuffers::String *>(VT_FIRMWARE);
|
||||
}
|
||||
bool Verify(::flatbuffers::Verifier &verifier) const {
|
||||
return VerifyTableStart(verifier) && VerifyField<uint8_t>(verifier, VT_MODULE_ID, 1) &&
|
||||
VerifyField<int8_t>(verifier, VT_MODULE_TYPE, 1) &&
|
||||
VerifyField<uint8_t>(verifier, VT_NUM_CHANNELS, 1) &&
|
||||
VerifyOffset(verifier, VT_CHANNEL_TO_MODULE) &&
|
||||
verifier.VerifyVector(channel_to_module()) &&
|
||||
VerifyOffset(verifier, VT_CHANNEL_TO_ORIENTATION) &&
|
||||
verifier.VerifyVector(channel_to_orientation()) &&
|
||||
VerifyField<int8_t>(verifier, VT_CONNECTION, 1) &&
|
||||
VerifyField<uint8_t>(verifier, VT_LEADER, 1) &&
|
||||
VerifyOffset(verifier, VT_FIRMWARE) && verifier.VerifyString(firmware()) &&
|
||||
verifier.EndTable();
|
||||
}
|
||||
};
|
||||
|
||||
struct TopologyMessageBuilder {
|
||||
typedef TopologyMessage Table;
|
||||
::flatbuffers::FlatBufferBuilder &fbb_;
|
||||
::flatbuffers::uoffset_t start_;
|
||||
void add_module_id(uint8_t module_id) {
|
||||
fbb_.AddElement<uint8_t>(TopologyMessage::VT_MODULE_ID, module_id, 0);
|
||||
}
|
||||
void add_module_type(ModuleType module_type) {
|
||||
fbb_.AddElement<int8_t>(TopologyMessage::VT_MODULE_TYPE, static_cast<int8_t>(module_type),
|
||||
0);
|
||||
}
|
||||
void add_num_channels(uint8_t num_channels) {
|
||||
fbb_.AddElement<uint8_t>(TopologyMessage::VT_NUM_CHANNELS, num_channels, 0);
|
||||
}
|
||||
void
|
||||
add_channel_to_module(::flatbuffers::Offset<::flatbuffers::Vector<uint8_t>> channel_to_module) {
|
||||
fbb_.AddOffset(TopologyMessage::VT_CHANNEL_TO_MODULE, channel_to_module);
|
||||
}
|
||||
void add_channel_to_orientation(
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<int8_t>> channel_to_orientation) {
|
||||
fbb_.AddOffset(TopologyMessage::VT_CHANNEL_TO_ORIENTATION, channel_to_orientation);
|
||||
}
|
||||
void add_connection(Messaging::ConnectionType connection) {
|
||||
fbb_.AddElement<int8_t>(TopologyMessage::VT_CONNECTION, static_cast<int8_t>(connection), 0);
|
||||
}
|
||||
void add_leader(uint8_t leader) {
|
||||
fbb_.AddElement<uint8_t>(TopologyMessage::VT_LEADER, leader, 0);
|
||||
}
|
||||
void add_firmware(::flatbuffers::Offset<::flatbuffers::String> firmware) {
|
||||
fbb_.AddOffset(TopologyMessage::VT_FIRMWARE, firmware);
|
||||
}
|
||||
explicit TopologyMessageBuilder(::flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) {
|
||||
start_ = fbb_.StartTable();
|
||||
}
|
||||
::flatbuffers::Offset<TopologyMessage> Finish() {
|
||||
const auto end = fbb_.EndTable(start_);
|
||||
auto o = ::flatbuffers::Offset<TopologyMessage>(end);
|
||||
return o;
|
||||
}
|
||||
};
|
||||
|
||||
inline ::flatbuffers::Offset<TopologyMessage> CreateTopologyMessage(
|
||||
::flatbuffers::FlatBufferBuilder &_fbb, uint8_t module_id = 0,
|
||||
ModuleType module_type = ModuleType_SPLITTER, uint8_t num_channels = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<uint8_t>> channel_to_module = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::Vector<int8_t>> channel_to_orientation = 0,
|
||||
Messaging::ConnectionType connection = Messaging::ConnectionType_DIRECT, uint8_t leader = 0,
|
||||
::flatbuffers::Offset<::flatbuffers::String> firmware = 0) {
|
||||
TopologyMessageBuilder builder_(_fbb);
|
||||
builder_.add_firmware(firmware);
|
||||
builder_.add_channel_to_orientation(channel_to_orientation);
|
||||
builder_.add_channel_to_module(channel_to_module);
|
||||
builder_.add_leader(leader);
|
||||
builder_.add_connection(connection);
|
||||
builder_.add_num_channels(num_channels);
|
||||
builder_.add_module_type(module_type);
|
||||
builder_.add_module_id(module_id);
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline ::flatbuffers::Offset<TopologyMessage>
|
||||
CreateTopologyMessageDirect(::flatbuffers::FlatBufferBuilder &_fbb, uint8_t module_id = 0,
|
||||
ModuleType module_type = ModuleType_SPLITTER, uint8_t num_channels = 0,
|
||||
const std::vector<uint8_t> *channel_to_module = nullptr,
|
||||
const std::vector<int8_t> *channel_to_orientation = nullptr,
|
||||
Messaging::ConnectionType connection = Messaging::ConnectionType_DIRECT,
|
||||
uint8_t leader = 0, const char *firmware = nullptr) {
|
||||
auto channel_to_module__ =
|
||||
channel_to_module ? _fbb.CreateVector<uint8_t>(*channel_to_module) : 0;
|
||||
auto channel_to_orientation__ =
|
||||
channel_to_orientation ? _fbb.CreateVector<int8_t>(*channel_to_orientation) : 0;
|
||||
auto firmware__ = firmware ? _fbb.CreateString(firmware) : 0;
|
||||
return Messaging::CreateTopologyMessage(_fbb, module_id, module_type, num_channels,
|
||||
channel_to_module__, channel_to_orientation__,
|
||||
connection, leader, firmware__);
|
||||
}
|
||||
|
||||
inline const Messaging::TopologyMessage *GetTopologyMessage(const void *buf) {
|
||||
return ::flatbuffers::GetRoot<Messaging::TopologyMessage>(buf);
|
||||
}
|
||||
|
||||
inline const Messaging::TopologyMessage *GetSizePrefixedTopologyMessage(const void *buf) {
|
||||
return ::flatbuffers::GetSizePrefixedRoot<Messaging::TopologyMessage>(buf);
|
||||
}
|
||||
|
||||
inline bool VerifyTopologyMessageBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifyBuffer<Messaging::TopologyMessage>(nullptr);
|
||||
}
|
||||
|
||||
inline bool VerifySizePrefixedTopologyMessageBuffer(::flatbuffers::Verifier &verifier) {
|
||||
return verifier.VerifySizePrefixedBuffer<Messaging::TopologyMessage>(nullptr);
|
||||
}
|
||||
|
||||
inline void FinishTopologyMessageBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Messaging::TopologyMessage> root) {
|
||||
fbb.Finish(root);
|
||||
}
|
||||
|
||||
inline void
|
||||
FinishSizePrefixedTopologyMessageBuffer(::flatbuffers::FlatBufferBuilder &fbb,
|
||||
::flatbuffers::Offset<Messaging::TopologyMessage> root) {
|
||||
fbb.FinishSizePrefixed(root);
|
||||
}
|
||||
|
||||
} // namespace Messaging
|
||||
|
||||
#endif // FLATBUFFERS_GENERATED_TOPOLOGYMESSAGE_MESSAGING_H_
|
||||
Reference in New Issue
Block a user