#ifndef AIRPORT_TCP_DATA_SOURCE_H #define AIRPORT_TCP_DATA_SOURCE_H #include "DataSource.h" #include "ConnectionConfig.h" #include class TCPDataSource : public DataSource { public: explicit TCPDataSource(const ConnectionConfig& config); ~TCPDataSource() override; bool isAvailable() const override; bool connect() override; void disconnect() override; std::optional getData() override; private: ConnectionConfig config_; boost::asio::io_context io_context_; std::unique_ptr socket_; bool connected_{false}; bool readData(std::vector& buffer); VehicleData parseData(const std::vector& buffer); }; #endif // AIRPORT_TCP_DATA_SOURCE_H