Newer
Older
/*
**************************************************************************
* Copyright (C) 2023 INAF
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License
* or (at your option) any later version. This program is distributed
* in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Authors:
*
* <>Valerio Pastore INAF-OAS Bologna valerio.pastore@inaf.it
****************************************************************************
*/
/**
* @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 ~BaseReceiver() = default;