/* * @brief Defines the aircraft reporter module to communicate with the backend * @file aman/com/AircraftReporter.h * @author Sven Czarnian * @copyright Copyright 2021 Sven Czarnian * @license This project is published under the GNU General Public License v3 (GPLv3) */ #pragma once #include #include namespace aman { /** * @brief Defines the base class for all file formats * @ingroup format * * The base class provides error information, etc. */ class AircraftReporter { private: std::unique_ptr m_socket; AircraftReporter() noexcept; template bool setSocketKey(const std::string& key, T entry) { try { this->m_socket->set(entry, key); return true; } catch (std::exception&) { return false; } } public: AircraftReporter(const AircraftReporter&) = delete; AircraftReporter(AircraftReporter&&) = delete; AircraftReporter& operator=(const AircraftReporter&) = delete; AircraftReporter& operator=(AircraftReporter&&) = delete; bool initialize(const Communication& configuration); bool deinitialize(); bool send(zmq::message_t& message); static AircraftReporter& instance(); bool send(const aman::AircraftReport& report); }; }