Newer
Older
/**
* @brief The BaseReceiver class is an abstract base class for receivers in the DAQ system.
*
* This class provides a common interface for receiving data from clients. It defines pure virtual
* functions for getting and setting the host, connecting to and closing the connection with the client,
* checking if the receiver is connected to the client, and receiving data from the client.
*
* Derived classes must implement these functions according to their specific requirements.
*/
/**
* @brief Get the host address.
*
* @return The host address as a string.
*/
/**
* @brief Set the host address.
*
* @param host The host address to set.
*/
virtual void setHost(std::string host) = 0;
/**
* @brief Connect to the client.
*
* @return An integer indicating the success or failure of the operation.
*/
/**
* @brief Close the connection with the client.
*
* @return An integer indicating the success or failure of the operation.
*/
/**
* @brief Check if the receiver is connected to the client.
*
* @return true if the receiver is connected to the client, false otherwise.
*/
/**
* @brief Receive data from the client.
*
* @param packet The received packet will be stored in this parameter.
* @return An integer indicating the success or failure of the operation.
*/
virtual int receiveFromClient(PacketLib::BasePacket &) = 0;
virtual ~BaseReceiver() = default;