Newer
Older
/**
* @brief The BaseConfigurator class is an abstract base class for configurators in the DAQ system.
*
* It provides common functionality for reading and pushing configurations to a source,
* as well as inserting new configurations into the existing ones.
*/
/**
* @brief Read the configuration from the source.
*
* @return int Returns 0 on success, or an error code on failure.
*/
/**
* @brief Read the configuration for the specified target.
*
* @param target The target for which to read the configuration.
* @return int Returns 0 on success, or an error code on failure.
*/
/**
* @brief Push the configuration to the source.
*
* @return int Returns 0 on success, or an error code on failure.
*/
/**
* @brief Push the configuration for the specified target.
*
* @param target The target for which to push the configuration.
* @return int Returns 0 on success, or an error code on failure.
*/
/**
* @brief Insert new configurations into the existing ones.
*
* @param newConfig The new configurations to insert.
* @param target The target for which to insert the new configurations.
* @return int Returns 0 on success, or an error code on failure.
*/
virtual int insert(std::map<std::string, std::string> newConfig, std::string target) = 0;
/**
* @brief Get the current configuration.
*
* @return std::map<std::string, std::string> The current configuration.
*/
virtual std::map<std::string, std::string> getConfig() {return this->config;}
/**
* @brief Convert the configuration to a string representation.
*
* @return std::string The string representation of the configuration.
*/
for( const std::pair<std::string, std::string> n : config) {
ret += n.first + " : " + n.second + "\n";
}
return ret;
}
virtual ~BaseConfigurator() = default;
};