| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "profilefactory.h" |
| 5 | |
| 6 | #include "isysmodel.h" |
| 7 | #include "profile.h" |
| 8 | #include <utility> |
| 9 | |
| 10 | ProfileFactory::ProfileFactory( |
| 11 | std::unique_ptr<IProfilePartProvider> &&profilePartProvider) noexcept |
| 12 | : profilePartProvider_(std::move(profilePartProvider)) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | std::unique_ptr<IProfile> ProfileFactory::build(ISysModel const &sysModel) const |
| 17 | { |
| 18 | auto profile = std::make_unique<Profile>(); |
| 19 | Profile::Factory profileFactory(*profilePartProvider_, *profile); |
| 20 | sysModel.exportWith(profileFactory); |
| 21 | return std::move(profile); |
| 22 | } |