#pragma once #include #include namespace inaf::oasbo::Archivers { /** * @brief The BaseArchiver class is an abstract base class for archivers. * * This class provides a common interface for archiving packets. Derived classes * must implement the pure virtual functions defined in this class. */ class BaseArchiver { protected: std::string dest; /**< The destination of the archiver. */ public: /** * @brief Write a packet to the archiver. * * This function writes the given packet to the "archive". * * @param packet The packet to write. * @return An integer indicating the success or failure of the write operation. */ virtual int write(PacketLib::BasePacket&) = 0; /** * @brief Write a packet to the archiver with a specified destination. * * This function writes the given packet to the archiver with the specified destination. * * @param packet The packet to write. * @param destination The destination where the packet should be written. * @return An integer indicating the success or failure of the write operation. */ virtual int write(PacketLib::BasePacket&, std::string destination) = 0; /** * @brief Open the archiver. * * This function opens the archiver. * * @return An integer indicating the success or failure of the open operation. */ virtual int open()=0; /** * @brief Close the archiver. * * This function closes the archiver. * * @return An integer indicating the success or failure of the close operation. */ virtual int close()=0; /** * @brief Check if the archiver is open. * * This function checks if the archiver is open. * * @return A boolean value indicating whether the archiver is open or not. */ virtual bool is_open()=0; /** * @brief Set the destination of the archiver. * * This function sets the destination of the archiver. * * @param dest The destination to set. */ virtual void setDest(std::string dest) = 0; /** * @brief Get the destination of the archiver. * * This function gets the destination of the archiver. * * @return The destination of the archiver. */ virtual std::string getDest() = 0; /** * @brief Destructor for the BaseArchiver class. */ virtual ~BaseArchiver() = default; }; }