HiveMindBridge
IHiveMindHostApiResponseHandler.h
Go to the documentation of this file.
1 #ifndef HIVEMINDBRIDGE_IHIVEMINDHOSTAPIRESPONSEHANDLER_H
2 #define HIVEMINDBRIDGE_IHIVEMINDHOSTAPIRESPONSEHANDLER_H
3 
4 #include "pheromones/HiveMindHostApiResponseDTO.h"
5 #include "pheromones/MessageDTO.h"
6 
7 typedef struct {
8  float distance;
9  float azimuth;
10  bool inLOS;
11 } Position;
12 
13 #include <functional>
14 
16  public:
17  static constexpr uint16_t NEIGHBORS_MAX_SIZE = NEIGHBORS_LIST_SIZE;
18 
19  virtual void handleMessage(const MessageDTO& message,
20  const HiveMindHostApiResponseDTO& hmResponse) = 0;
21 
22  virtual bool onNeighborListUpdated(std::function<void(std::array<uint16_t, NEIGHBORS_MAX_SIZE>,
23  uint64_t bytesLength)> callback) = 0;
24 
25  virtual bool onNeighborUpdated(
26  std::function<void(uint16_t neighborId, std::optional<Position> position)> callback) = 0;
27 };
28 
29 #endif // HIVEMINDBRIDGE_IHIVEMINDHOSTAPIRESPONSEHANDLER_H
Position::inLOS
bool inLOS
Definition: IHiveMindHostApiResponseHandler.h:10
IHiveMindHostApiResponseHandler::onNeighborUpdated
virtual bool onNeighborUpdated(std::function< void(uint16_t neighborId, std::optional< Position > position)> callback)=0
IHiveMindHostApiResponseHandler
Definition: IHiveMindHostApiResponseHandler.h:15
IHiveMindHostApiResponseHandler::NEIGHBORS_MAX_SIZE
static constexpr uint16_t NEIGHBORS_MAX_SIZE
Definition: IHiveMindHostApiResponseHandler.h:17
Position::azimuth
float azimuth
Definition: IHiveMindHostApiResponseHandler.h:9
Position::distance
float distance
Definition: IHiveMindHostApiResponseHandler.h:8
IHiveMindHostApiResponseHandler::onNeighborListUpdated
virtual bool onNeighborListUpdated(std::function< void(std::array< uint16_t, NEIGHBORS_MAX_SIZE >, uint64_t bytesLength)> callback)=0
Position
Definition: IHiveMindHostApiResponseHandler.h:7
IHiveMindHostApiResponseHandler::handleMessage
virtual void handleMessage(const MessageDTO &message, const HiveMindHostApiResponseDTO &hmResponse)=0