| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/sysmodelsyncer.h`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "commandqueue.h"cxx . . $ `<file>/src/core/commandqueue.h`/ |
| 7 | #include "helper/ihelpersysctl.h"cxx . . $ `<file>/src/helper/ihelpersysctl.h`/ |
| 8 | #include "iprofileapplicator.h"cxx . . $ `<file>/src/core/iprofileapplicator.h`/ |
| 9 | #include "isysmodel.h"cxx . . $ `<file>/src/core/isysmodel.h`/ |
| 10 | #include "isysmodelsyncer.h"cxx . . $ `<file>/src/core/isysmodelsyncer.h`/ |
| 11 | #include <QObject> |
| 12 | #include <atomic> |
| 13 | #include <memory> |
| 14 | #include <mutex> |
| 15 | #include <string> |
| 16 | #include <thread> |
| 17 | #include <unordered_map> |
| 18 | #include <unordered_set> |
| 19 | |
| 20 | class IProfileViewcxx . . $ IProfileView#; |
| 21 | |
| 22 | class SysModelSyncercxx . . $ SysModelSyncer# final |
| 23 | : public QObjectcxx . . $ QObject# |
| 24 | , public ISysModelSyncercxx . . $ ISysModelSyncer# |
| 25 | , public IProfileApplicatorcxx . . $ IProfileApplicator# |
| 26 | { |
| 27 | Q_OBJECTcxx . . $ SysModelSyncer#tr(75d9f1c324b4579d). |
| 28 | |
| 29 | public: |
| 30 | SysModelSyncercxx . . $ SysModelSyncer#SysModelSyncer(522add7052a4c64b).(stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<ISysModelcxx . . $ ISysModel#> &&sysModel, |
| 31 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IHelperSysCtlcxx . . $ IHelperSysCtl#> &&helperSysCtl) noexcept; |
| 32 | |
| 33 | ISysModelcxx . . $ ISysModel# &sysModelcxx . . $ SysModelSyncer#sysModel(aa35fd785725305d).() const override; |
| 34 | void settingChangedcxx . . $ SysModelSyncer#settingChanged(1c60a90c724e6bfb).(QStringcxx . . $ QString# const &key, QVariantcxx . . $ QVariant# const &value) override; |
| 35 | void logCommandscxx . . $ SysModelSyncer#logCommands(b45ddcbc8423892c).(bool enable) override; |
| 36 | |
| 37 | void initcxx . . $ SysModelSyncer#init(49f6e7a06ebc5aa8).() override; |
| 38 | void stopcxx . . $ SysModelSyncer#stop(49f6e7a06ebc5aa8).() override; |
| 39 | |
| 40 | void applycxx . . $ SysModelSyncer#apply(1fbcc559ec85543d).(IProfileViewcxx . . $ IProfileView# &profileView) override; |
| 41 | |
| 42 | private: |
| 43 | void updateSensorscxx . . $ SysModelSyncer#updateSensors(49f6e7a06ebc5aa8).(); |
| 44 | void syncModelcxx . . $ SysModelSyncer#syncModel(49f6e7a06ebc5aa8).(); |
| 45 | |
| 46 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<ISysModelcxx . . $ ISysModel#> const sysModel_cxx . . $ SysModelSyncer#sysModel_.; |
| 47 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IHelperSysCtlcxx . . $ IHelperSysCtl#> const helperSysCtl_cxx . . $ SysModelSyncer#helperSysCtl_.; |
| 48 | |
| 49 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# syncMutex_cxx . . $ SysModelSyncer#syncMutex_.; |
| 50 | CommandQueuecxx . . $ CommandQueue# cmds_cxx . . $ SysModelSyncer#cmds_.; |
| 51 | |
| 52 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# sensorsMutex_cxx . . $ SysModelSyncer#sensorsMutex_.; |
| 53 | stdcxx . . $ std/::unordered_mapcxx . . $ std/unordered_map#<stdcxx . . $ std/::stringcxx . . $ std/string#, stdcxx . . $ std/::unordered_setcxx . . $ std/unordered_set#<stdcxx . . $ std/::stringcxx . . $ std/string#>> ignoredSensors_cxx . . $ SysModelSyncer#ignoredSensors_.; |
| 54 | |
| 55 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<stdcxx . . $ std/::threadcxx . . $ std/thread#> updateThread_cxx . . $ SysModelSyncer#updateThread_.; |
| 56 | stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<stdcxx . . $ std/::threadcxx . . $ std/thread#> syncThread_cxx . . $ SysModelSyncer#syncThread_.; |
| 57 | stdcxx . . $ std/::atomiccxx . . $ std/atomic#<bool> stopSignal_cxx . . $ SysModelSyncer#stopSignal_.{cxx . . $ std/atomic#atomic(9f0ba574c1c44ffc).false}; |
| 58 | }; |