66796de1 | #ifndef INSTALLER_H_ #define INSTALLER_H_ |
e21fc4bc | |
66796de1 | #include <string> |
bf756dea | #include <memory> #include <functional> |
66796de1 | |
bf756dea | #include "token.h" #include "sys_unistd.h" #include "user.h" class installer_ifc { |
e21fc4bc | public: |
bf756dea | using generator = std::function<std::string()>; virtual std::string install_token() const { |
e21fc4bc | return "123456"; } }; |
66796de1 | |
bf756dea | class installer { public: using delegate = std::shared_ptr<installer_ifc>; private: delegate delegate_; public: installer(const delegate &delegate = std::make_shared<installer_ifc>()) : delegate_(delegate) {} std::string install_token() const { return delegate_->install_token(); } static installer create(const tokens &tokens, const unistd &unistd, const directory &directory, const installer_ifc::generator &generator); }; |
66796de1 | #endif |