#ifndef MDD_PROCESSORBASE_H #define MDD_PROCESSORBASE_H #include #include "Input.h" #include "Output.h" #include "IProcessor.h" namespace mdd { class ProcessorBase : public IProcessor{ private: template class HandlerModule { public: std::shared_ptr moduleHandler; std::shared_ptr accessHandler; HandlerModule(std::shared_ptr module, std::shared_ptr access) { moduleHandler = module; accessHandler = access; } }; std::string _prefix = ""; std::string _type = ""; int _appendix = 0; 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, const std::vector& value); int addProcessorOutput(const std::string& type, const std::vector& 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(const std::string& type) override; std::string getType() override; std::string setPrefix(const std::string& prefix) override; std::string setAppendix(int appendix) override; void updateID() override ; std::string addModule(std::shared_ptr module) override ; void removeModule(std::shared_ptr module) override; std::string addModuleInput(std::string module_ID, std::string input_ID) override; std::string addModuleInput(std::shared_ptr module, std::shared_ptr input) override; std::string addModuleOutput(std::string module_ID, std::string output_ID) override; std::string addModuleOutput(std::shared_ptr module, std::shared_ptr output) override; std::vector getInputs() override; std::vector getOutputs() override; std::vector getModules() override; std::vector getInputIDs() override; std::vector getOutputIDs() override; std::vector getModuleIDs() override; std::vector getInputStates() override; std::vector getOutputStates() override; std::vector> getInputConnections() override; std::vector >> getOutputConnections() override; std::vector > getOptimizableInputs() override; std::vector > getOptimizableOutputs() override; std::shared_ptr getOutput(const std::string& output_id) override; std::shared_ptr getInput(const std::string& input_id) override; std::shared_ptr getModule(std::string module_id) override; }; } #endif