rename the files and use the new interface to communicate with the backend

This commit is contained in:
Sven Czarnian
2021-11-13 22:59:04 +01:00
parent 50bb565229
commit 8b1292c95a
4 changed files with 28 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
/*
* @brief Defines the aircraft reporter module to communicate with the backend
* @file aman/com/AircraftReporter.h
* @brief Defines the backend notification module to communicate with the backend
* @file aman/com/BackendNotification.h
* @author Sven Czarnian <devel@svcz.de>
* @copyright Copyright 2021 Sven Czarnian
* @license This project is published under the GNU General Public License v3 (GPLv3)
@@ -13,19 +13,19 @@
#include <aman/types/Communication.h>
#pragma warning(push, 0)
#include "protobuf/AircraftReport.pb.h"
#include <protobuf/Communication.pb.h>
#pragma warning(pop)
namespace aman {
/**
* @brief Defines the aircraft reporter class which sends aircraft information to the backend
* @brief Defines the bakcend notification class which sends aircraft information to the backend
* @ingroup com
*/
class AircraftReporter {
class BackendNotification {
private:
std::unique_ptr<zmq::socket_t> m_socket;
AircraftReporter() noexcept;
BackendNotification() noexcept;
template <typename T>
bool setSocketKey(const std::string& key, T entry) {
@@ -39,10 +39,10 @@ namespace aman {
}
public:
AircraftReporter(const AircraftReporter&) = delete;
AircraftReporter(AircraftReporter&&) = delete;
AircraftReporter& operator=(const AircraftReporter&) = delete;
AircraftReporter& operator=(AircraftReporter&&) = delete;
BackendNotification(const BackendNotification&) = delete;
BackendNotification(BackendNotification&&) = delete;
BackendNotification& operator=(const BackendNotification&) = delete;
BackendNotification& operator=(BackendNotification&&) = delete;
/**
* @brief Initializes the aircraft reporter
@@ -61,14 +61,14 @@ namespace aman {
bool initialized() const noexcept;
/**
* @brief Sends a new message to the backend
* @param[in] report The new aircraft report
* @param[in] report The new aircraft update
* @return True if the report is sent, else false
*/
bool send(aman::AircraftReport& report);
bool send(aman::AircraftUpdate& report);
/**
* @brief Returns the reporter instance
* @return The system-wide instance
*/
static AircraftReporter& instance() noexcept;
static BackendNotification& instance() noexcept;
};
}