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 BaseProvider class is an abstract base class for providers in the DAQ system.
*
* This class defines the common interface for providers that write packets to a destination.
* Derived classes must implement the pure virtual functions defined in this class.
*/
std::string dest; /**< The destination where packets are written to. */
/**
* @brief Writes a packet to the destination.
*
* @param packet The packet to be written.
* @return int Returns an integer indicating the success or failure of the write operation.
*/
/**
* @brief Writes a packet to a specified destination.
*
* @param packet The packet to be written.
* @param dest The destination where the packet should be written to.
* @return int Returns an integer indicating the success or failure of the write operation.
*/
virtual int write(Packets::BasePacket &packet, std::string dest) = 0;
/**
* @brief Opens the provider.
*
* @return int Returns an integer indicating the success or failure of the open operation.
*/
virtual int open() = 0;
/**
* @brief Closes the provider.
*
* @return int Returns an integer indicating the success or failure of the close operation.
*/
virtual int close() = 0;
/**
* @brief Checks if the provider is open.
*
* @return bool Returns true if the provider is open, false otherwise.
*/
/**
* @brief Sets the destination where packets should be written to.
*
* @param dest The destination to be set.
*/
/**
* @brief Gets the current destination where packets are written to.
*
* @return std::string Returns the current destination.
*/