53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
|
|
#ifndef MODULAR_PROCESSOR_HPP
|
||
|
|
#define MODULAR_PROCESSOR_HPP
|
||
|
|
|
||
|
|
#include <string>
|
||
|
|
#include <any>
|
||
|
|
#include <memory>
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Represents the result of a data processing operation.
|
||
|
|
*/
|
||
|
|
struct ProcessResult {
|
||
|
|
bool success = false; ///< Whether the operation succeeded.
|
||
|
|
int code = 0; ///< Result code (0 = success, non-zero = error).
|
||
|
|
std::string message; ///< Human-readable result message.
|
||
|
|
std::any output_data; ///< Optional output data payload.
|
||
|
|
};
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Core business logic processor.
|
||
|
|
*
|
||
|
|
* Accepts input data and produces a ProcessResult.
|
||
|
|
* The processor can be configured with a ConfigManager and Logger.
|
||
|
|
*/
|
||
|
|
class DataProcessor {
|
||
|
|
public:
|
||
|
|
/**
|
||
|
|
* @brief Construct a DataProcessor.
|
||
|
|
* @param log An optional shared Logger instance.
|
||
|
|
*/
|
||
|
|
explicit DataProcessor(std::shared_ptr<class Logger> log = nullptr);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Set a configuration manager for the processor.
|
||
|
|
* @param cfg Shared pointer to a ConfigManager.
|
||
|
|
*/
|
||
|
|
void setConfig(std::shared_ptr<class ConfigManager> cfg);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @brief Process input data.
|
||
|
|
* @param input Arbitrary input data (std::any).
|
||
|
|
* @return A ProcessResult describing the outcome.
|
||
|
|
*
|
||
|
|
* This is a placeholder implementation. Override or extend for real logic.
|
||
|
|
*/
|
||
|
|
ProcessResult process(const std::any& input);
|
||
|
|
|
||
|
|
private:
|
||
|
|
std::shared_ptr<class Logger> logger_;
|
||
|
|
std::shared_ptr<class ConfigManager> config_;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // MODULAR_PROCESSOR_HPP
|