ProcessorBase.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #pragma once
  2. #include <list>
  3. #include "Input.h"
  4. #include "Output.h"
  5. #include "IProcessor.h"
  6. #include "Registration.h"
  7. namespace mdd {
  8. class Registration;
  9. class ProcessorBase : public IProcessor{
  10. private:
  11. std::string _type = "";
  12. int _appendix = 0;
  13. std::string _base_config = "";
  14. protected:
  15. ProcessorBase(const std::string& base_config);
  16. std::vector<std::shared_ptr<Input>>processor_inputs;
  17. std::vector<std::shared_ptr<Output>> processor_outputs;
  18. std::vector<std::shared_ptr<IModule>> modules;
  19. std::vector<std::shared_ptr<Parameter>> inputs;
  20. std::vector<std::shared_ptr<Parameter>> outputs;
  21. public:
  22. bool configure(const std::string& config);
  23. std::string getConfiguration() override;
  24. std::string getID() override ;
  25. std::string setType(const std::string& type) override;
  26. std::string getType() override;
  27. std::string setAppendix(int appendix) override;
  28. int getAppendix() override;
  29. std::string addModule(std::shared_ptr<IModule> module) override ;
  30. void removeModule(std::shared_ptr<IModule> module) override;
  31. std::vector<std::shared_ptr<Parameter>>& getInputParams() override;
  32. std::vector<std::shared_ptr<Parameter>>& getOutputParams() override;
  33. size_t getNumInputs() override;
  34. size_t getNumOutputs() override;
  35. std::shared_ptr<IInput> getInput(const std::string& id) override;
  36. std::shared_ptr<IInput> getInput(size_t index) override;
  37. std::shared_ptr<IOutput> getOutput(const std::string& id) override;
  38. std::shared_ptr<IOutput> getOutput(size_t index) override;
  39. std::vector<std::shared_ptr<IInput>> getOptimizableInputs() override;
  40. std::vector<std::shared_ptr<IOutput>> getOptimizableOutputs() override;
  41. std::vector<std::shared_ptr<IModule >>& getModules();
  42. size_t getNumModuls() override;
  43. std::shared_ptr<IModule> getModule(size_t index) override;
  44. std::shared_ptr<IModule> getModule(const std::string& id) override;
  45. bool connect(const std::string& output_id, const std::vector<std::string>& input_ids);
  46. void disconnect() override;
  47. void load(const json& j) override;
  48. json dump() override;
  49. };
  50. }
  51. //*/