| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/profilemanager.h`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "iprofile.h"cxx . . $ `<file>/src/core/iprofile.h`/ |
| 7 | #include "iprofilemanager.h"cxx . . $ `<file>/src/core/iprofilemanager.h`/ |
| 8 | #include "iprofilestorage.h"cxx . . $ `<file>/src/core/iprofilestorage.h`/ |
| 9 | #include <memory> |
| 10 | #include <mutex> |
| 11 | #include <string> |
| 12 | #include <unordered_map> |
| 13 | #include <unordered_set> |
| 14 | |
| 15 | class ProfileManagercxx . . $ ProfileManager# final : public IProfileManagercxx . . $ IProfileManager# |
| 16 | { |
| 17 | public: |
| 18 | ProfileManagercxx . . $ ProfileManager#ProfileManager(89d18fb28252b489).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfilecxx . . $ IProfile#> &&defaultProfile, |
| 19 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfileStoragecxx . . $ IProfileStorage#> &&profileStorage) noexcept; |
| 20 | |
| 21 | void addObservercxx . . $ ProfileManager#addObserver(bd1477ff1de9e2eb).(stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<IProfileManagercxx . . $ IProfileManager#::Observercxx . . $ IProfileManager#Observer#> observer) override; |
| 22 | void removeObservercxx . . $ ProfileManager#removeObserver(feeb623736561950).( |
| 23 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<IProfileManagercxx . . $ IProfileManager#::Observercxx . . $ IProfileManager#Observer#> const &observer) override; |
| 24 | |
| 25 | void initcxx . . $ ProfileManager#init(2ffe4369e6bd4764).(ISysModelcxx . . $ ISysModel# const &model) override; |
| 26 | |
| 27 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> profilescxx . . $ ProfileManager#profiles(491c255a7e496038).() const override; |
| 28 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<IProfilecxx . . $ IProfile# const>> |
| 29 | profilecxx . . $ ProfileManager#profile(f84880c9a777ebac).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) const override; |
| 30 | |
| 31 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> unsavedProfilescxx . . $ ProfileManager#unsavedProfiles(491c255a7e496038).() const override; |
| 32 | bool unsavedcxx . . $ ProfileManager#unsaved(13a55b95a0133754).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) const override; |
| 33 | |
| 34 | void addcxx . . $ ProfileManager#add(7a3f345cc6258353).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &info) override; |
| 35 | void clonecxx . . $ ProfileManager#clone(7d57608c21e2500c).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &cloneInfo, |
| 36 | stdcxx . . $ std/::stringcxx . . $ std/string# const &baseProfileName = |
| 37 | stdcxx . . $ std/__cxx11/basic_string#basic_string(bf1c47f775a49a2c).::stringcxx . . $ std/string#(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info#::GlobalIDcxx . . $ IProfile#Info#GlobalID.)) override; |
| 38 | void removecxx . . $ ProfileManager#remove(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 39 | void activatecxx . . $ ProfileManager#activate(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) override; |
| 40 | void resetcxx . . $ ProfileManager#reset(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 41 | void restorecxx . . $ ProfileManager#restore(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 42 | void updatecxx . . $ ProfileManager#update(eb2b9ce3c3c58e35).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, |
| 43 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo) override; |
| 44 | void updatecxx . . $ ProfileManager#update(1a91c228bd4123e9).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, |
| 45 | Importablecxx . . $ Importable#::Importercxx . . $ Importable#Importer# &importer) override; |
| 46 | bool loadFromcxx . . $ ProfileManager#loadFrom(19973e5c5433fa0c).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, |
| 47 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# const &path) override; |
| 48 | void savecxx . . $ ProfileManager#save(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 49 | bool exportTocxx . . $ ProfileManager#exportTo(19973e5c5433fa0c).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, |
| 50 | stdcxx . . $ std/::filesystemcxx . . $ std/filesystem/::pathcxx . . $ std/filesystem/__cxx11/path# const &path) override; |
| 51 | |
| 52 | private: |
| 53 | void notifyProfileAddedcxx . . $ ProfileManager#notifyProfileAdded(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName); |
| 54 | void notifyProfileRemovedcxx . . $ ProfileManager#notifyProfileRemoved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName); |
| 55 | void notifyProfileChangedcxx . . $ ProfileManager#notifyProfileChanged(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName); |
| 56 | void notifyProfileActiveChangedcxx . . $ ProfileManager#notifyProfileActiveChanged(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active); |
| 57 | void notifyProfileSavedcxx . . $ ProfileManager#notifyProfileSaved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName); |
| 58 | void notifyProfileInfoChangedcxx . . $ ProfileManager#notifyProfileInfoChanged(1acf29b044426ccc).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &oldInfo, |
| 59 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo); |
| 60 | |
| 61 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfilecxx . . $ IProfile#> defaultProfile_cxx . . $ ProfileManager#defaultProfile_.; |
| 62 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfileStoragecxx . . $ IProfileStorage#> profileStorage_cxx . . $ ProfileManager#profileStorage_.; |
| 63 | stdcxx . . $ std/::unordered_mapcxx . . $ std/unordered_map#<stdcxx . . $ std/::stringcxx . . $ std/string#, stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfilecxx . . $ IProfile#>> profiles_cxx . . $ ProfileManager#profiles_.; |
| 64 | stdcxx . . $ std/::unordered_setcxx . . $ std/unordered_set#<stdcxx . . $ std/::stringcxx . . $ std/string#> unsavedProfiles_cxx . . $ ProfileManager#unsavedProfiles_.; |
| 65 | |
| 66 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<IProfileManagercxx . . $ IProfileManager#::Observercxx . . $ IProfileManager#Observer#>> observers_cxx . . $ ProfileManager#observers_.; |
| 67 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# obMutex_cxx . . $ ProfileManager#obMutex_.; |
| 68 | }; |