| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/session.cpp`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #include "session.h"cxx . . $ `<file>/src/core/session.h`/ |
| 5 | |
| 6 | #include "helper/ihelpermonitor.h"cxx . . $ `<file>/src/helper/ihelpermonitor.h`/ |
| 7 | #include "iprofileapplicator.h"cxx . . $ `<file>/src/core/iprofileapplicator.h`/ |
| 8 | #include "iprofilemanager.h"cxx . . $ `<file>/src/core/iprofilemanager.h`/ |
| 9 | #include "iprofileview.h"cxx . . $ `<file>/src/core/iprofileview.h`/ |
| 10 | #include "iprofileviewfactory.h"cxx . . $ `<file>/src/core/iprofileviewfactory.h`/ |
| 11 | #include <algorithm> |
| 12 | #include <format> |
| 13 | #include <iterator> |
| 14 | #include <spdlog/spdlog.h> |
| 15 | #include <sstream> |
| 16 | #include <utility> |
| 17 | |
| 18 | class Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver# : public IProfileManagercxx . . $ IProfileManager#::Observercxx . . $ IProfileManager#Observer# |
| 19 | { |
| 20 | public: |
| 21 | ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#ProfileManagerObserver(582ac3a005f348cb).(Sessioncxx . . $ Session# &outer) noexcept |
| 22 | : outer_cxx . . $ Session#ProfileManagerObserver#outer_.(outer) |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | void profileAddedcxx . . $ Session#ProfileManagerObserver#profileAdded(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 27 | void profileRemovedcxx . . $ Session#ProfileManagerObserver#profileRemoved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 28 | void profileChangedcxx . . $ Session#ProfileManagerObserver#profileChanged(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 29 | void profileActiveChangedcxx . . $ Session#ProfileManagerObserver#profileActiveChanged(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) override; |
| 30 | void profileSavedcxx . . $ Session#ProfileManagerObserver#profileSaved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) override; |
| 31 | void profileInfoChangedcxx . . $ Session#ProfileManagerObserver#profileInfoChanged(1acf29b044426ccc).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &oldInfo, |
| 32 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo) override; |
| 33 | |
| 34 | private: |
| 35 | Sessioncxx . . $ Session# &outer_cxx . . $ Session#ProfileManagerObserver#outer_.; |
| 36 | }; |
| 37 | |
| 38 | void Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#::profileAddedcxx . . $ Session#ProfileManagerObserver#profileAdded(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 39 | { |
| 40 | outer_cxx . . $ Session#ProfileManagerObserver#outer_..profileAddedcxx . . $ Session#profileAdded(9c546c94e5fcce4e).(profileName); |
| 41 | } |
| 42 | |
| 43 | void Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#::profileRemovedcxx . . $ Session#ProfileManagerObserver#profileRemoved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 44 | { |
| 45 | outer_cxx . . $ Session#ProfileManagerObserver#outer_..profileRemovedcxx . . $ Session#profileRemoved(9c546c94e5fcce4e).(profileName); |
| 46 | } |
| 47 | |
| 48 | void Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#::profileChangedcxx . . $ Session#ProfileManagerObserver#profileChanged(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 49 | { |
| 50 | outer_cxx . . $ Session#ProfileManagerObserver#outer_..profileChangedcxx . . $ Session#profileChanged(9c546c94e5fcce4e).(profileName); |
| 51 | } |
| 52 | |
| 53 | void Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#::profileActiveChangedcxx . . $ Session#ProfileManagerObserver#profileActiveChanged(a3b17e0268c60856).( |
| 54 | stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) |
| 55 | { |
| 56 | outer_cxx . . $ Session#ProfileManagerObserver#outer_..profileActiveChangedcxx . . $ Session#profileActiveChanged(a3b17e0268c60856).(profileName, active); |
| 57 | } |
| 58 | |
| 59 | void Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#::profileSavedcxx . . $ Session#ProfileManagerObserver#profileSaved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 60 | { |
| 61 | outer_cxx . . $ Session#ProfileManagerObserver#outer_..profileSavedcxx . . $ Session#profileSaved(9c546c94e5fcce4e).(profileName); |
| 62 | } |
| 63 | |
| 64 | void Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#::profileInfoChangedcxx . . $ Session#ProfileManagerObserver#profileInfoChanged(1acf29b044426ccc).( |
| 65 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &oldInfo, IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo) |
| 66 | { |
| 67 | outer_cxx . . $ Session#ProfileManagerObserver#outer_..profileInfoChangedcxx . . $ Session#profileInfoChanged(1acf29b044426ccc).(oldInfo, newInfo); |
| 68 | } |
| 69 | |
| 70 | class Sessioncxx . . $ Session#::HelperMonitorObservercxx . . $ Session#HelperMonitorObserver# : public IHelperMonitorcxx . . $ IHelperMonitor#::Observercxx . . $ IHelperMonitor#Observer# |
| 71 | { |
| 72 | public: |
| 73 | HelperMonitorObservercxx . . $ Session#HelperMonitorObserver#HelperMonitorObserver(582ac3a005f348cb).(Sessioncxx . . $ Session# &outer) noexcept |
| 74 | : outer_cxx . . $ Session#HelperMonitorObserver#outer_.(outer) |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | void appExeccxx . . $ Session#HelperMonitorObserver#appExec(8d4ab0a187bf9331).(stdcxx . . $ std/::stringcxx . . $ std/string# appExe) override; |
| 79 | void appExitcxx . . $ Session#HelperMonitorObserver#appExit(8d4ab0a187bf9331).(stdcxx . . $ std/::stringcxx . . $ std/string# appExe) override; |
| 80 | |
| 81 | private: |
| 82 | Sessioncxx . . $ Session# &outer_cxx . . $ Session#HelperMonitorObserver#outer_.; |
| 83 | }; |
| 84 | |
| 85 | void Sessioncxx . . $ Session#::HelperMonitorObservercxx . . $ Session#HelperMonitorObserver#::appExeccxx . . $ Session#HelperMonitorObserver#appExec(8d4ab0a187bf9331).(stdcxx . . $ std/::stringcxx . . $ std/string# appExe) |
| 86 | { |
| 87 | outer_cxx . . $ Session#HelperMonitorObserver#outer_..queueProfileViewForExecutablecxx . . $ Session#queueProfileViewForExecutable(9c546c94e5fcce4e).(appExe); |
| 88 | } |
| 89 | |
| 90 | void Sessioncxx . . $ Session#::HelperMonitorObservercxx . . $ Session#HelperMonitorObserver#::appExitcxx . . $ Session#HelperMonitorObserver#appExit(8d4ab0a187bf9331).(stdcxx . . $ std/::stringcxx . . $ std/string# appExe) |
| 91 | { |
| 92 | outer_cxx . . $ Session#HelperMonitorObserver#outer_..dequeueProfileViewForExecutablecxx . . $ Session#dequeueProfileViewForExecutable(9c546c94e5fcce4e).(appExe); |
| 93 | } |
| 94 | |
| 95 | Sessioncxx . . $ Session#::Sessioncxx . . $ Session#Session(456168c8863a4993).(stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<IProfileApplicatorcxx . . $ IProfileApplicator#> profileApplicator, |
| 96 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfileManagercxx . . $ IProfileManager#> &&profileManager, |
| 97 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IProfileViewFactorycxx . . $ IProfileViewFactory#> &&profileViewFactory, |
| 98 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IHelperMonitorcxx . . $ IHelperMonitor#> &&helperMonitor, |
| 99 | bool logProfileStack) noexcept |
| 100 | : profileApplicator_cxx . . $ Session#profileApplicator_.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(profileApplicator)) |
| 101 | , profileManager_cxx . . $ Session#profileManager_.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(profileManager)) |
| 102 | , profileViewFactory_cxx . . $ Session#profileViewFactory_.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(profileViewFactory)) |
| 103 | , helperMonitor_cxx . . $ Session#helperMonitor_.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(helperMonitor)) |
| 104 | , profileManagerObserver_cxx . . $ Session#profileManagerObserver_.( |
| 105 | stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(25752750ef11e821).<Sessioncxx . . $ Session#::ProfileManagerObservercxx . . $ Session#ProfileManagerObserver#>(*this)) |
| 106 | , helperMonitorObserver_cxx . . $ Session#helperMonitorObserver_.(stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(25752750ef11e821).<Sessioncxx . . $ Session#::HelperMonitorObservercxx . . $ Session#HelperMonitorObserver#>(*this)) |
| 107 | , logProfileStack_cxx . . $ Session#logProfileStack_.(logProfileStack) |
| 108 | { |
| 109 | profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).addObservercxx . . $ IProfileManager#addObserver(bd1477ff1de9e2eb).(profileManagerObserver_cxx . . $ std/shared_ptr#shared_ptr(d70455e50ed85f60).); |
| 110 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).addObservercxx . . $ IHelperMonitor#addObserver(c5c359039219b577).(helperMonitorObserver_cxx . . $ std/shared_ptr#shared_ptr(d70455e50ed85f60).); |
| 111 | } |
| 112 | |
| 113 | void Sessioncxx . . $ Session#::addManualProfileObservercxx . . $ Session#addManualProfileObserver(b6a8fcfa605ca162).( |
| 114 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<ISessioncxx . . $ ISession#::ManualProfileObservercxx . . $ ISession#ManualProfileObserver#> observer) |
| 115 | { |
| 116 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileObserversMutex_cxx . . $ Session#manualProfileObserversMutex_.); |
| 117 | auto const it = stdcxx . . $ std/::findcxx . . $ std/find(a92da12e15934614).(manualProfileObservers_cxx . . $ Session#manualProfileObservers_..begincxx . . $ std/vector#begin(55a6de06420d4903).(), |
| 118 | manualProfileObservers_cxx . . $ Session#manualProfileObservers_..endcxx . . $ std/vector#end(55a6de06420d4903).(), observer); |
| 119 | if (it ==cxx . . $ __gnu_cxx/`operator==`(1a98aefd92b4272a). manualProfileObservers_cxx . . $ Session#manualProfileObservers_..cendcxx . . $ std/vector#cend(d1e1699016b9d7e6).()) |
| 120 | manualProfileObservers_cxx . . $ Session#manualProfileObservers_..emplace_backcxx . . $ std/vector#emplace_back(a1bcdfdabc3a37df).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(observer)); |
| 121 | } |
| 122 | |
| 123 | void Sessioncxx . . $ Session#::removeManualProfileObservercxx . . $ Session#removeManualProfileObserver(b6a8fcfa605ca162).( |
| 124 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<ISessioncxx . . $ ISession#::ManualProfileObservercxx . . $ ISession#ManualProfileObserver#> observer) |
| 125 | { |
| 126 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileObserversMutex_cxx . . $ Session#manualProfileObserversMutex_.); |
| 127 | stdcxx . . $ std/::erasecxx . . $ std/erase(d1155fb03f0860d).(manualProfileObservers_cxx . . $ Session#manualProfileObservers_., observer); |
| 128 | } |
| 129 | |
| 130 | void Sessioncxx . . $ Session#::initcxx . . $ Session#init(2ffe4369e6bd4764).(ISysModelcxx . . $ ISysModel# const &model) |
| 131 | { |
| 132 | profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).initcxx . . $ IProfileManager#init(2ffe4369e6bd4764).(model); |
| 133 | |
| 134 | populateProfileExeIndexcxx . . $ Session#populateProfileExeIndex(49f6e7a06ebc5aa8).(); |
| 135 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).({cxx . . $ std/optional#optional(ced63f7c635d850d).}, {cxx . . $ std/vector#vector(9619226211e5a241).stdcxx . . $ std/::stringcxx . . $ std/string#(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info#::GlobalIDcxx . . $ IProfile#Info#GlobalID.)}); |
| 136 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 137 | |
| 138 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).initcxx . . $ IHelperMonitor#init(49f6e7a06ebc5aa8).(); |
| 139 | watchProfilescxx . . $ Session#watchProfiles(49f6e7a06ebc5aa8).(); |
| 140 | |
| 141 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 142 | } |
| 143 | |
| 144 | bool Sessioncxx . . $ Session#::toggleManualProfilecxx . . $ Session#toggleManualProfile(7c222eea44a24d43).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 145 | { |
| 146 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 147 | if (!profile || profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).().execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 148 | return false; |
| 149 | |
| 150 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 151 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> mLockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileMutex_cxx . . $ Session#manualProfileMutex_.); |
| 152 | |
| 153 | // remove the profile view of the current active manual profile |
| 154 | if (manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 155 | pViews_cxx . . $ Session#pViews_..pop_backcxx . . $ std/deque#pop_back(ced63f7c635d850d).(); |
| 156 | notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_., false); |
| 157 | } |
| 158 | |
| 159 | // update manual profile state |
| 160 | if (manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && manualProfile_cxx . . $ Session#manualProfile_. ==cxx . . $ std/`operator==`(348876303c74c3ee). profileName) |
| 161 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(38d427c8744fed4f). stdcxx . . $ std/::nulloptcxx . . $ std/nullopt.; |
| 162 | else |
| 163 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(a631871c47728645). profileName; |
| 164 | |
| 165 | // create the profile view of the manual profile |
| 166 | if (manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 167 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).(*cxx . . $ std/optional#optional(e3f0d6382bd52f24).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).(), {cxx . . $ std/vector#vector(9619226211e5a241).*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_.}); |
| 168 | notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_., true); |
| 169 | } |
| 170 | |
| 171 | // apply active profile view |
| 172 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 173 | |
| 174 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 175 | |
| 176 | return true; |
| 177 | } |
| 178 | |
| 179 | bool Sessioncxx . . $ Session#::activateManualProfilecxx . . $ Session#activateManualProfile(7c222eea44a24d43).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 180 | { |
| 181 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 182 | if (!profile || profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).().execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 183 | return false; |
| 184 | |
| 185 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> mLockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileMutex_cxx . . $ Session#manualProfileMutex_.); |
| 186 | if (manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && manualProfile_cxx . . $ Session#manualProfile_. ==cxx . . $ std/`operator==`(348876303c74c3ee). profileName) |
| 187 | return true; // NOOP |
| 188 | |
| 189 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 190 | |
| 191 | // remove the profile view of the current active manual profile |
| 192 | if (manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 193 | pViews_cxx . . $ Session#pViews_..pop_backcxx . . $ std/deque#pop_back(ced63f7c635d850d).(); |
| 194 | notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_., false); |
| 195 | } |
| 196 | |
| 197 | // update manual profile state |
| 198 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(a631871c47728645). profileName; |
| 199 | |
| 200 | // create the profile view of the manual profile |
| 201 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).(*cxx . . $ std/optional#optional(e3f0d6382bd52f24).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).(), {cxx . . $ std/vector#vector(9619226211e5a241).*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_.}); |
| 202 | notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_., true); |
| 203 | |
| 204 | // apply active profile view |
| 205 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 206 | |
| 207 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 208 | |
| 209 | return true; |
| 210 | } |
| 211 | |
| 212 | bool Sessioncxx . . $ Session#::deactivateManualProfilecxx . . $ Session#deactivateManualProfile(7c222eea44a24d43).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 213 | { |
| 214 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 215 | if (!profile || profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).().execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 216 | return false; |
| 217 | |
| 218 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> mLockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileMutex_cxx . . $ Session#manualProfileMutex_.); |
| 219 | if (!(manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && manualProfile_cxx . . $ Session#manualProfile_. ==cxx . . $ std/`operator==`(348876303c74c3ee). profileName)) |
| 220 | return true; // NOOP |
| 221 | |
| 222 | // remove profile view of the manual profile |
| 223 | pViews_cxx . . $ Session#pViews_..pop_backcxx . . $ std/deque#pop_back(ced63f7c635d850d).(); |
| 224 | notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_., false); |
| 225 | |
| 226 | // update manual profile state |
| 227 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(38d427c8744fed4f). stdcxx . . $ std/::nulloptcxx . . $ std/nullopt.; |
| 228 | |
| 229 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 230 | |
| 231 | // apply active profile view |
| 232 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 233 | |
| 234 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 235 | |
| 236 | return true; |
| 237 | } |
| 238 | |
| 239 | IProfileManagercxx . . $ IProfileManager# &Sessioncxx . . $ Session#::profileManagercxx . . $ Session#profileManager(4cba1b6c4fb53c57).() const |
| 240 | { |
| 241 | return *cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).profileManager_cxx . . $ Session#profileManager_.; |
| 242 | } |
| 243 | |
| 244 | void Sessioncxx . . $ Session#::logProfileStackcxx . . $ Session#logProfileStack(b45ddcbc8423892c).(bool enable) |
| 245 | { |
| 246 | logProfileStack_cxx . . $ Session#logProfileStack_. = enable; |
| 247 | } |
| 248 | |
| 249 | void Sessioncxx . . $ Session#::profileAddedcxx . . $ Session#profileAdded(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 250 | { |
| 251 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 252 | if (profile.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().activecxx . . $ IProfile#active(50ce9a9e25b4a850).() && |
| 253 | profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).().execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) { |
| 254 | |
| 255 | auto const &exe = profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).().execxx . . $ IProfile#Info#exe.; |
| 256 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(profileExeIndexMutex_cxx . . $ Session#profileExeIndexMutex_.); |
| 257 | |
| 258 | if (profileExeIndex_cxx . . $ Session#profileExeIndex_..findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(exe) == profileExeIndex_cxx . . $ Session#profileExeIndex_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).()) { |
| 259 | profileExeIndex_cxx . . $ Session#profileExeIndex_..emplacecxx . . $ std/unordered_map#emplace(8e800962ae7274b6).(exe, profileName); |
| 260 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).watchAppcxx . . $ IHelperMonitor#watchApp(9c546c94e5fcce4e).(exe); |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | void Sessioncxx . . $ Session#::profileRemovedcxx . . $ Session#profileRemoved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 266 | { |
| 267 | bool isManual = false; |
| 268 | { |
| 269 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileMutex_cxx . . $ Session#manualProfileMutex_.); |
| 270 | if (manualProfile_cxx . . $ Session#manualProfile_. ==cxx . . $ std/`operator==`(348876303c74c3ee). profileName) { |
| 271 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(38d427c8744fed4f). stdcxx . . $ std/::nulloptcxx . . $ std/nullopt.; |
| 272 | isManual = true; |
| 273 | notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(profileName, false); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | if (!isManual) { // remove from profile executable index |
| 278 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(profileExeIndexMutex_cxx . . $ Session#profileExeIndexMutex_.); |
| 279 | |
| 280 | auto const profileIndexIter = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 281 | profileExeIndex_cxx . . $ Session#profileExeIndex_..cbegincxx . . $ std/unordered_map#cbegin(f3c6e12ee1fe7252).(), profileExeIndex_cxx . . $ Session#profileExeIndex_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).(), |
| 282 | [&](auto const &indexItem) { return indexItem.second == profileName; }); |
| 283 | |
| 284 | if (profileIndexIter != profileExeIndex_cxx . . $ Session#profileExeIndex_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).()) { |
| 285 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).forgetAppcxx . . $ IHelperMonitor#forgetApp(9c546c94e5fcce4e).(profileIndexIter->cxx . . $ std/__detail/_Node_const_iterator#`operator->`(8e614c7de0b1573e).firstcxx . . $ std/pair#first.); |
| 286 | profileExeIndex_cxx . . $ Session#profileExeIndex_..erasecxx . . $ std/unordered_map#erase(f3b347a1815c53c).(profileIndexIter); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | dequeueProfileViewcxx . . $ Session#dequeueProfileView(9c546c94e5fcce4e).(profileName); |
| 291 | } |
| 292 | |
| 293 | void Sessioncxx . . $ Session#::profileChangedcxx . . $ Session#profileChanged(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 294 | { |
| 295 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 296 | |
| 297 | auto const profileViewIter = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 298 | pViews_cxx . . $ Session#pViews_..cbegincxx . . $ std/deque#cbegin(5aea99939b02dae4).(), pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).(), |
| 299 | [&](auto const &pv) { return pv->name() == profileName; }); |
| 300 | |
| 301 | if (profileViewIter != pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).()) { |
| 302 | // compute a list with the names of profile views to recreate |
| 303 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> pViewsToRecreatecxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 304 | pViewsToRecreate.reservecxx . . $ std/vector#reserve(2c44cd906ae4e829).(pViews_cxx . . $ Session#pViews_..sizecxx . . $ std/deque#size(c9b1e749b64d5edc).()); |
| 305 | stdcxx . . $ std/::transformcxx . . $ std/transform(da30451c4a040264).(profileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928)., pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).(), |
| 306 | stdcxx . . $ std/::back_insertercxx . . $ std/back_inserter(7b559d6bdd90ff74).(pViewsToRecreate), |
| 307 | [](auto const &pv) { return pv->name(); }); |
| 308 | |
| 309 | // remove outdated profile views |
| 310 | pViews_cxx . . $ Session#pViews_..erasecxx . . $ std/deque#erase(74a41bd00f332169).(profileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928)., pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).()); |
| 311 | |
| 312 | // recreate the list of profile views |
| 313 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).( |
| 314 | pViews_cxx . . $ Session#pViews_..emptycxx . . $ std/deque#empty(3482b152b9333168).() |
| 315 | ? stdcxx . . $ std/optional#optional(eb2253fdec8870b5).::nulloptcxx . . $ std/nullopt. |
| 316 | : stdcxx . . $ std/::make_optionalcxx . . $ std/make_optional(93409f9a99a5ec4d).<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<IProfileViewcxx . . $ IProfileView#>>( |
| 317 | *cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()), |
| 318 | pViewsToRecreate); |
| 319 | |
| 320 | // apply active profile view |
| 321 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 322 | |
| 323 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | void Sessioncxx . . $ Session#::profileActiveChangedcxx . . $ Session#profileActiveChanged(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, bool active) |
| 328 | { |
| 329 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 330 | if (profile.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).() && |
| 331 | profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).().execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) { |
| 332 | if (active) |
| 333 | profileAddedcxx . . $ Session#profileAdded(9c546c94e5fcce4e).(profileName); |
| 334 | else |
| 335 | profileRemovedcxx . . $ Session#profileRemoved(9c546c94e5fcce4e).(profileName); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | void Sessioncxx . . $ Session#::profileSavedcxx . . $ Session#profileSaved(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &) |
| 340 | { |
| 341 | } |
| 342 | |
| 343 | void Sessioncxx . . $ Session#::profileInfoChangedcxx . . $ Session#profileInfoChanged(1acf29b044426ccc).(IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &oldInfo, |
| 344 | IProfilecxx . . $ IProfile#::Infocxx . . $ IProfile#Info# const &newInfo) |
| 345 | { |
| 346 | if (oldInfo.execxx . . $ IProfile#Info#exe. != newInfo.execxx . . $ IProfile#Info#exe. || oldInfo.namecxx . . $ IProfile#Info#name. != newInfo.namecxx . . $ IProfile#Info#name.) { |
| 347 | |
| 348 | // sync profile executable index |
| 349 | { |
| 350 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(profileExeIndexMutex_cxx . . $ Session#profileExeIndexMutex_.); |
| 351 | |
| 352 | profileExeIndex_cxx . . $ Session#profileExeIndex_..erasecxx . . $ std/unordered_map#erase(ff4e454bb663bf95).(oldInfo.execxx . . $ IProfile#Info#exe.); |
| 353 | if (newInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 354 | profileExeIndex_cxx . . $ Session#profileExeIndex_..emplacecxx . . $ std/unordered_map#emplace(8e800962ae7274b6).(newInfo.execxx . . $ IProfile#Info#exe., newInfo.namecxx . . $ IProfile#Info#name.); |
| 355 | } |
| 356 | |
| 357 | // update monitor |
| 358 | if (oldInfo.execxx . . $ IProfile#Info#exe. != newInfo.execxx . . $ IProfile#Info#exe.) { |
| 359 | if (oldInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 360 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).forgetAppcxx . . $ IHelperMonitor#forgetApp(9c546c94e5fcce4e).(oldInfo.execxx . . $ IProfile#Info#exe.); |
| 361 | |
| 362 | if (newInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 363 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).watchAppcxx . . $ IHelperMonitor#watchApp(9c546c94e5fcce4e).(newInfo.execxx . . $ IProfile#Info#exe.); |
| 364 | } |
| 365 | |
| 366 | // handle active manual profile |
| 367 | if (oldInfo.execxx . . $ IProfile#Info#exe. == IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) { |
| 368 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileMutex_cxx . . $ Session#manualProfileMutex_.); |
| 369 | |
| 370 | if (oldInfo.namecxx . . $ IProfile#Info#name. ==cxx . . $ std/`operator==`(3bdd94461e5f9e25). manualProfile_cxx . . $ Session#manualProfile_.) { |
| 371 | // the manual profile has been turned into an automatic profile |
| 372 | if (newInfo.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 373 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(38d427c8744fed4f). stdcxx . . $ std/::nulloptcxx . . $ std/nullopt.; |
| 374 | else // only the profile name has changed |
| 375 | manualProfile_cxx . . $ Session#manualProfile_. =cxx . . $ std/optional#`operator=`(a631871c47728645). newInfo.namecxx . . $ IProfile#Info#name.; |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | // handle profile view |
| 380 | { |
| 381 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 382 | |
| 383 | // find the profile view |
| 384 | auto profileViewIter = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 385 | pViews_cxx . . $ Session#pViews_..cbegincxx . . $ std/deque#cbegin(5aea99939b02dae4).(), pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).(), |
| 386 | [&](auto const &pv) { return pv->name() == oldInfo.namecxx . . $ IProfile#Info#name.; }); |
| 387 | |
| 388 | if (profileViewIter != pViews_cxx . . $ Session#pViews_..endcxx . . $ std/deque#end(3eee4dc5a9c66500).()) { |
| 389 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> pViewsToRecreatecxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 390 | pViewsToRecreate.reservecxx . . $ std/vector#reserve(2c44cd906ae4e829).(pViews_cxx . . $ Session#pViews_..sizecxx . . $ std/deque#size(c9b1e749b64d5edc).()); |
| 391 | |
| 392 | // recreate the profile view when only its name has been changed |
| 393 | if (oldInfo.execxx . . $ IProfile#Info#exe. ==cxx . . $ std/`operator==`(5ea818b58063a774). newInfo.execxx . . $ IProfile#Info#exe. && oldInfo.namecxx . . $ IProfile#Info#name. != newInfo.namecxx . . $ IProfile#Info#name.) |
| 394 | pViewsToRecreate.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(newInfo.namecxx . . $ IProfile#Info#name.); |
| 395 | |
| 396 | // compute a list with the names of profile views to recreate |
| 397 | auto nextProfileViewIter = stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(profileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928).); |
| 398 | if (nextProfileViewIter != pViews_cxx . . $ Session#pViews_..endcxx . . $ std/deque#end(3eee4dc5a9c66500).()) { |
| 399 | stdcxx . . $ std/::transformcxx . . $ std/transform(da30451c4a040264).(nextProfileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928)., pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).(), |
| 400 | stdcxx . . $ std/::back_insertercxx . . $ std/back_inserter(7b559d6bdd90ff74).(pViewsToRecreate), |
| 401 | [](auto const &pv) { return pv->name(); }); |
| 402 | } |
| 403 | |
| 404 | // remove affected the profile views |
| 405 | pViews_cxx . . $ Session#pViews_..erasecxx . . $ std/deque#erase(74a41bd00f332169).(profileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928)., pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).()); |
| 406 | |
| 407 | // recreate the list of profile views |
| 408 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).(*cxx . . $ std/optional#optional(e3f0d6382bd52f24).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).(), pViewsToRecreate); |
| 409 | |
| 410 | // apply active profile view |
| 411 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 412 | } |
| 413 | |
| 414 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | void Sessioncxx . . $ Session#::queueProfileViewForExecutablecxx . . $ Session#queueProfileViewForExecutable(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &executableName) |
| 420 | { |
| 421 | stdcxx . . $ std/::stringcxx . . $ std/string# profileNamecxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 422 | { |
| 423 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(profileExeIndexMutex_cxx . . $ Session#profileExeIndexMutex_.); |
| 424 | |
| 425 | auto const profileIndexNameIter = profileExeIndex_cxx . . $ Session#profileExeIndex_..findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(executableName); |
| 426 | if (profileIndexNameIter != profileExeIndex_cxx . . $ Session#profileExeIndex_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).()) |
| 427 | profileName =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). profileIndexNameIter->cxx . . $ std/__detail/_Node_iterator#`operator->`(35610babf8706b50).secondcxx . . $ std/pair#second.; |
| 428 | } |
| 429 | |
| 430 | queueProfileViewcxx . . $ Session#queueProfileView(9c546c94e5fcce4e).(profileName); |
| 431 | } |
| 432 | |
| 433 | void Sessioncxx . . $ Session#::dequeueProfileViewForExecutablecxx . . $ Session#dequeueProfileViewForExecutable(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &executableName) |
| 434 | { |
| 435 | stdcxx . . $ std/::stringcxx . . $ std/string# profileNamecxx . . $ std/__cxx11/basic_string#basic_string(925dcc5e17f50391).; |
| 436 | { |
| 437 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(profileExeIndexMutex_cxx . . $ Session#profileExeIndexMutex_.); |
| 438 | |
| 439 | auto const profileIndexNameIter = profileExeIndex_cxx . . $ Session#profileExeIndex_..findcxx . . $ std/unordered_map#find(f711f2f81556fe93).(executableName); |
| 440 | if (profileIndexNameIter != profileExeIndex_cxx . . $ Session#profileExeIndex_..cendcxx . . $ std/unordered_map#cend(f3c6e12ee1fe7252).()) |
| 441 | profileName =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). profileIndexNameIter->cxx . . $ std/__detail/_Node_iterator#`operator->`(35610babf8706b50).secondcxx . . $ std/pair#second.; |
| 442 | } |
| 443 | |
| 444 | dequeueProfileViewcxx . . $ Session#dequeueProfileView(9c546c94e5fcce4e).(profileName); |
| 445 | } |
| 446 | |
| 447 | void Sessioncxx . . $ Session#::populateProfileExeIndexcxx . . $ Session#populateProfileExeIndex(49f6e7a06ebc5aa8).() |
| 448 | { |
| 449 | auto profiles = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilescxx . . $ IProfileManager#profiles(491c255a7e496038).(); |
| 450 | for (auto &profileName : profiles) { |
| 451 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 452 | auto info = profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().infocxx . . $ IProfile#info(ad075d653bfbbbea).(); |
| 453 | if (profile->cxx . . $ std/optional#`operator->`(258ee1c9e0a18a5c).getcxx . . $ std/reference_wrapper#get(d426bc7b625886b7).().activecxx . . $ IProfile#active(50ce9a9e25b4a850).() && info.execxx . . $ IProfile#Info#exe. != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 454 | profileExeIndex_cxx . . $ Session#profileExeIndex_..emplacecxx . . $ std/unordered_map#emplace(8e800962ae7274b6).(info.execxx . . $ IProfile#Info#exe., stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(profileName)); |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | void Sessioncxx . . $ Session#::watchProfilescxx . . $ Session#watchProfiles(49f6e7a06ebc5aa8).() |
| 459 | { |
| 460 | for (auto const &[exe, name] : profileExeIndex_cxx . . $ Session#profileExeIndex_.) { |
| 461 | if (exe != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::GlobalIDcxx . . $ IProfile#Info#GlobalID. && exe != IProfilecxx . . $ std/basic_string_view#basic_string_view(b419d9def655ef02).::Infocxx . . $ IProfile#Info#::ManualIDcxx . . $ IProfile#Info#ManualID.) |
| 462 | helperMonitor_cxx . . $ Session#helperMonitor_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).watchAppcxx . . $ IHelperMonitor#watchApp(9c546c94e5fcce4e).(exe); |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | void Sessioncxx . . $ Session#::createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).( |
| 467 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::reference_wrappercxx . . $ std/reference_wrapper#<IProfileViewcxx . . $ IProfileView#>> baseProfileView, |
| 468 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &profileNames) |
| 469 | { |
| 470 | for (auto const &profileName : profileNames) { |
| 471 | auto profile = profileManager_cxx . . $ Session#profileManager_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).profilecxx . . $ IProfileManager#profile(f84880c9a777ebac).(profileName); |
| 472 | if (profile.has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 473 | auto profileView = profileViewFactory_cxx . . $ Session#profileViewFactory_.->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).buildcxx . . $ IProfileViewFactory#build(a5bd53f7a1e70b37).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).profile, baseProfileView); |
| 474 | // use the new view as the base for the next profile view |
| 475 | baseProfileView =cxx . . $ std/optional#`operator=`(a631871c47728645). *cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).profileView; |
| 476 | pViews_cxx . . $ Session#pViews_..emplace_backcxx . . $ std/deque#emplace_back(df8c12b98d24bd1e).(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(profileView)); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | void Sessioncxx . . $ Session#::queueProfileViewcxx . . $ Session#queueProfileView(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 482 | { |
| 483 | // compute a list of profile views to create including the profile |
| 484 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> pViewsToRecreatecxx . . $ std/vector#vector(9619226211e5a241).{profileName}; |
| 485 | |
| 486 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 487 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> mLockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileMutex_cxx . . $ Session#manualProfileMutex_.); |
| 488 | |
| 489 | // recreate active manual profile view |
| 490 | if (manualProfile_cxx . . $ Session#manualProfile_..has_valuecxx . . $ std/optional#has_value(3482b152b9333168).()) { |
| 491 | pViewsToRecreate.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(*cxx . . $ std/optional#`operator*`(47e1a15210ec6306).manualProfile_cxx . . $ Session#manualProfile_.); |
| 492 | pViews_cxx . . $ Session#pViews_..pop_backcxx . . $ std/deque#pop_back(ced63f7c635d850d).(); |
| 493 | } |
| 494 | |
| 495 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).(*cxx . . $ std/optional#optional(e3f0d6382bd52f24).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).(), pViewsToRecreate); |
| 496 | |
| 497 | // apply active profile view |
| 498 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 499 | |
| 500 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 501 | } |
| 502 | |
| 503 | void Sessioncxx . . $ Session#::dequeueProfileViewcxx . . $ Session#dequeueProfileView(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName) |
| 504 | { |
| 505 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(pViewsMutex_cxx . . $ Session#pViewsMutex_.); |
| 506 | |
| 507 | auto profileViewIter = stdcxx . . $ std/::find_ifcxx . . $ std/find_if(f0a0a4f94ee5cb00).( |
| 508 | pViews_cxx . . $ Session#pViews_..cbegincxx . . $ std/deque#cbegin(5aea99939b02dae4).(), pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).(), |
| 509 | [&](auto const &pv) { return pv->name() == profileName; }); |
| 510 | |
| 511 | if (profileViewIter != pViews_cxx . . $ Session#pViews_..endcxx . . $ std/deque#end(3eee4dc5a9c66500).()) { |
| 512 | auto nextProfileView = stdcxx . . $ std/::nextcxx . . $ std/next(31d62cd24490f169).(profileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928).); |
| 513 | |
| 514 | // compute a list with the names of profile views to recreate |
| 515 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> pViewsToRecreatecxx . . $ std/vector#vector(49f6e7a06ebc5aa8).; |
| 516 | if (nextProfileView != pViews_cxx . . $ Session#pViews_..endcxx . . $ std/deque#end(3eee4dc5a9c66500).()) { |
| 517 | pViewsToRecreate.reservecxx . . $ std/vector#reserve(2c44cd906ae4e829).(pViews_cxx . . $ Session#pViews_..sizecxx . . $ std/deque#size(c9b1e749b64d5edc).()); |
| 518 | stdcxx . . $ std/::transformcxx . . $ std/transform(da30451c4a040264).(nextProfileViewcxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928)., pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).(), |
| 519 | stdcxx . . $ std/::back_insertercxx . . $ std/back_inserter(7b559d6bdd90ff74).(pViewsToRecreate), |
| 520 | [](auto const &pv) { return pv->name(); }); |
| 521 | } |
| 522 | |
| 523 | // remove the profile view and the outdated profile views |
| 524 | pViews_cxx . . $ Session#pViews_..erasecxx . . $ std/deque#erase(74a41bd00f332169).(profileViewItercxx . . $ std/_Deque_iterator#_Deque_iterator(9c7371b184115928)., pViews_cxx . . $ Session#pViews_..cendcxx . . $ std/deque#cend(5aea99939b02dae4).()); |
| 525 | |
| 526 | // recreate the list of profile views |
| 527 | createProfileViewscxx . . $ Session#createProfileViews(521d355d0436275a).(*cxx . . $ std/optional#optional(e3f0d6382bd52f24).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).(), pViewsToRecreate); |
| 528 | |
| 529 | // apply active profile view |
| 530 | profileApplicator_cxx . . $ Session#profileApplicator_.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).applycxx . . $ IProfileApplicator#apply(1fbcc559ec85543d).(*cxx . . $ std/unique_ptr#`operator*`(2fbe4a4c783c152d).pViews_cxx . . $ Session#pViews_..backcxx . . $ std/deque#back(1c9784b1aa27a05e).()); |
| 531 | |
| 532 | logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).(); |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | void Sessioncxx . . $ Session#::notifyManualProfileToggledcxx . . $ Session#notifyManualProfileToggled(a3b17e0268c60856).(stdcxx . . $ std/::stringcxx . . $ std/string# const &profileName, |
| 537 | bool active) |
| 538 | { |
| 539 | stdcxx . . $ std/::lock_guardcxx . . $ std/lock_guard#<stdcxx . . $ std/::mutexcxx . . $ std/mutex#> lockcxx . . $ std/lock_guard#lock_guard(8e935d9c2e576e3a).(manualProfileObserversMutex_cxx . . $ Session#manualProfileObserversMutex_.); |
| 540 | for (auto &o : manualProfileObservers_cxx . . $ Session#manualProfileObservers_.) |
| 541 | o->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).toggledcxx . . $ ISession#ManualProfileObserver#toggled(a3b17e0268c60856).(profileName, active); |
| 542 | } |
| 543 | |
| 544 | void Sessioncxx . . $ Session#::logProfileStackcxx . . $ Session#logProfileStack(83f5f38750778ac8).() const |
| 545 | { |
| 546 | if (logProfileStack_cxx . . $ Session#logProfileStack_.) { |
| 547 | |
| 548 | stdcxx . . $ std/::ostringstreamcxx . . $ std/ostringstream# oscxx . . $ std/__cxx11/basic_ostringstream#basic_ostringstream(49f6e7a06ebc5aa8).; |
| 549 | for (auto &view : pViews_cxx . . $ Session#pViews_.) |
| 550 | os <<cxx . . $ std/`operator<<`(88df5bef833f7f83). stdcxx . . $ std/::formatcxx . . $ std/format(7a9e6f4918cdc192).("> {} "cxx . . $ std/basic_format_string#basic_format_string(edcd8b2679e9bd1a)., view->cxx . . $ std/unique_ptr#`operator->`(ea7391e9eeeaf20e).namecxx . . $ IProfileView#name(f4fff0029955a25f).()); |
| 551 | |
| 552 | SPDLOG_INFOcxx . . $ `<external>/13613935168682455490/spdlog.h:320:13`!("{}", os.str()); |
| 553 | } |
| 554 | } |