ProcessorStandard.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef MDD_PROCESSORSTANDARD_H
  2. #define MDD_PROCESSORSTANDARD_H
  3. #include "ProcessorBase.h"
  4. #include "Output.h"
  5. #include <chrono>
  6. namespace mdd {
  7. enum priority {
  8. MANUAL,
  9. STATIC,
  10. DYNAMIC,
  11. TIME
  12. };
  13. class ProcessorStandard : public ProcessorBase {
  14. private:
  15. struct module_priority{
  16. std::shared_ptr<IModule> module_ptr;
  17. size_t connectionCounter;
  18. size_t changeCounter;
  19. std::chrono::milliseconds runtime;
  20. module_priority(std::shared_ptr<IModule> module, size_t connection = 0, size_t change = 0);
  21. };
  22. std::vector<module_priority> _priority_list;
  23. public:
  24. int maxIterations;
  25. priority priorityEvaluation;
  26. ProcessorStandard(priority priorityEvaluation = MANUAL, int maxIterations = -1);
  27. std::string addModule(std::shared_ptr<IModule> module) override;
  28. void removeModule(std::shared_ptr<IModule> module) override;
  29. std::vector<std::shared_ptr<IModule>> getModulePriority();
  30. state update() override;
  31. std::shared_ptr<IOutput> getIteration();
  32. };
  33. }
  34. #endif //MDD_PROCESSORMANUAL_H