mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Add topology builder
This commit is contained in:
26
components/flatbuffers/include/TopologyBuilder.h
Normal file
26
components/flatbuffers/include/TopologyBuilder.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef TOPOLOGYBUILDER
|
||||
#define TOPOLOGYBUILDER
|
||||
|
||||
#include "SerializedMessage.h"
|
||||
#include <vector>
|
||||
#include "constants/datalink.h"
|
||||
#include "constants/rmt.h"
|
||||
|
||||
#include "flatbuffers_generated/Topology_generated.h"
|
||||
#include "flatbuffers/flatbuffers.h"
|
||||
|
||||
namespace Flatbuffers {
|
||||
class TopologyBuilder {
|
||||
public:
|
||||
TopologyBuilder() : builder_(RIP_MAX_ROUTES*(sizeof(Topology::NeighbourBlob) + sizeof(Topology::ChannelBoardConn)*MAX_CHANNELS)) {}
|
||||
|
||||
SerializedMessage build_topology(const std::vector<flatbuffers::Offset<Topology::NeighbourBlob>>& topology);
|
||||
flatbuffers::Offset<Topology::NeighbourBlob> build_neighbour_info(uint16_t board_id, const std::vector<Topology::ChannelBoardConn>& connections);
|
||||
Topology::ChannelBoardConn build_connections(uint8_t channel, uint16_t board_id);
|
||||
|
||||
private:
|
||||
flatbuffers::FlatBufferBuilder builder_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //TOPOLOGYBUILDER
|
||||
Reference in New Issue
Block a user