#ifndef MDD_PROCESSORBASE_H #define MDD_PROCESSORBASE_H #include #include "Input.h" #include "IProcessor.h" #include "HandlerModule.h" namespace mdd { class ProcessorBase : public IProcessor{ private: std::string _prefix; std::string _type; int _appendix; std::vector> _processor_inputs; std::vector> _processor_outputs; std::vector> _module_inputs; std::vector> _module_outputs; std::vector> _modules; protected: int addProcesorInput(const std::string& type, int appendix, const json& value, const std::function& verification = []( const json&) { return true; }); int addProcessorOutput(const std::string& type, int appendix, const json& initial); std::shared_ptr getProcessorOutput(int handle); std::shared_ptr getProcessorInput(int handle); std::shared_ptr getModule(int handle); public: std::string getID() override ; std::string setType(std:: string type) override; std::string getType() override; std::string setPrefix(std::string prefix) override; std::string setAppendix(int appendix) override; void updateID() override ; std::string addModule(std::shared_ptr module) override ; std::string addModuleInput(std::string module_ID, std::string input_ID); std::string addModuleInput(std::shared_ptr module, std::shared_ptr input); std::string addModuleOutput(std::string module_ID, std::string output_ID); std::string addModuleOutput(std::shared_ptr module, std::shared_ptr output); std::vector getInputs() override; std::vector getOutputs() override; std::vector getModules() override; std::vector getInputIDs(); std::vector getOutputIDs(); std::vector getModuleIDs(); std::shared_ptr getOutput(std::string output_id) override; std::shared_ptr getInput(std::string input_id) override; std::shared_ptr getModule(std::string module_id) override; }; } #endif