12345678910111213141516171819202122232425262728293031 |
- #ifndef MDD_BASEMODULE_H
- #define MDD_BASEMODULE_H
- #include <string>
- #include <functional>
- #include "IModule.h"
- #include "Output.h"
- #include <bits/shared_ptr.h>
- struct Input
- {
- std::string name;
- rapidjson::Value value;
- std::function<bool(rapidjson::Value&)> verification;
- std::shared_ptr<IOutput> output;
- Input(std::string name, rapidjson::Value value, std::function<bool(rapidjson::Value&)> verification = [](rapidjson::Value&){return true;});
- };
- class ModuleBase : IModule
- {
- std::vector<Input> inputs;
- public:
- std::vector<std::string> getInputs();
- int addInput(std::string name, rapidjson::Value value, std::function<bool(rapidjson::Value&)> verification = [](rapidjson::Value&){return true;});
- bool connectInput(std::string input_name, std::shared_ptr<IOutput> output);
- const rapidjson::Value& getValue(int handle);
- };
- #endif //MDD_BASEMODULE_H
|