7d075ab4 | /* Copyright (C) CJ Affiliate * * You may use, distribute and modify this code under the * terms of the GNU General Public License version 2 or * later. * * You should have received a copy of the license with this * file. If not, you will find a copy in the "LICENSE" file * at https://github.com/cjdev/dual-control. */ |
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" |
f2a91ef8 | #include "generator.h" |
bf756dea | |
7d075ab4 | class installer_ifc { public: virtual std::string install_token() const { return "123456"; } |
e21fc4bc | }; |
66796de1 | |
7d075ab4 | 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, |
f2a91ef8 | const directory &directory, const generator &generator); |
bf756dea | }; |
66796de1 | #endif |
7d075ab4 |