Newer
Older
#ifndef RAW_FILES_PATH
#define RAW_FILES_PATH std::string(std::getenv("HOME")).append("/BIAS/config/RawTestFiles")
#endif
/**
* @brief The namespace inaf::oasbo::Receivers contains classes related to receiving data.
*/
/**
* @brief The FileReceiver class is a derived class of BaseReceiver and is responsible for receiving packets from files.
* check the Base_Receiver.h file for more information.
*/
/**
* @brief Constructs a FileReceiver object with a source and a rate.
* @param source The source files to receive.
* @param rate The rate at which the packets are received.
*/
/**
* @brief Constructs a FileReceiver object with a source.
* @param source The source files to receive.
*/
/**
* @brief Constructs a FileReceiver object.
*/
std::ifstream *ifile = nullptr; /**< Pointer to the input file stream. */
ssize_t filesize = 0; /**< The size of the file being received. */
std::vector<std::string> filesToProcess; /**< Vector of files to process. */
size_t filesCount = 0; /**< The number of files to process. */
/**
* @brief Opens the next file to process.
* @return integer representing the status of the operation.
*/
/**
* @brief Resets the first bytes of the packet to 0.
* @param pack The packet to reset.
* @param bytes The number of bytes to reset.
*/
/**
* @brief Resolves the environment variable in the given path.
* @param path The path containing the environment variable.
* @return The resolved path.
*/
int rate; /**< The rate at which the packets are received. */
/**
* @brief Destructor for the FileReceiver class.
*/
~FileReceiver();
std::string getHost() override;
void setHost(std::string host) override;
int connectToClient() override;
int closeConnectionToClient() override;
bool isConnectedToClient() const override;
/**
* @brief The FileReceiverBuilder class is responsible for building FileReceiver objects.
*/
FileReceiver *rcv; /**< Pointer to the FileReceiver object being built. */
std::string sourceFile; /**< The source file for the FileReceiver object. */
std::string config_target { "filereceiver" }; /**< The configuration target for the FileReceiverBuilder. */
std::string source_key { "source" }; /**< The source key for the FileReceiverBuilder. */
std::string rate_key { "rate" }; /**< The rate key for the FileReceiverBuilder. */
/**
* @brief Constructs a FileReceiverBuilder object.
*/
/**
* @brief Destructor for the FileReceiverBuilder class.
*/
/**
* @brief Resets the FileReceiverBuilder object.
*/
/**
* @brief Configures the FileReceiverBuilder object from a BaseConfigurator object.
* @param conf The BaseConfigurator object to configure from.
* @return A pointer to the FileReceiverBuilder object.
*/
FileReceiverBuilder* configFrom(Configurators::BaseConfigurator &conf);
/**
* @brief Sets the source for the FileReceiverBuilder object.
* @param source The source of the files to receive.
* @return A pointer to the FileReceiverBuilder object.
*/
/**
* @brief Sets the rate for the FileReceiverBuilder object.
* @param rate The rate at which the files are received.
* @return A pointer to the FileReceiverBuilder object.
*/
/**
* @brief Gets the built FileReceiver object.
* @return A pointer to the built FileReceiver object.
*/