| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/helper/pmon/processregistry.h`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <memory> |
| 7 | #include <mutex> |
| 8 | #include <optional> |
| 9 | #include <string> |
| 10 | #include <unordered_map> |
| 11 | |
| 12 | class IAppRegistrycxx . . $ IAppRegistry#; |
| 13 | |
| 14 | class ProcessRegistrycxx . . $ ProcessRegistry# final |
| 15 | { |
| 16 | public: |
| 17 | ProcessRegistrycxx . . $ ProcessRegistry#ProcessRegistry(f4d4064d3339a82d).(stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<IAppRegistrycxx . . $ IAppRegistry#> appRegistry) noexcept; |
| 18 | |
| 19 | void addcxx . . $ ProcessRegistry#add(448e1223d74ef93).(int PID, stdcxx . . $ std/::stringcxx . . $ std/string# const &app); |
| 20 | void removecxx . . $ ProcessRegistry#remove(d4f767463ce0a6b3).(int PID); |
| 21 | |
| 22 | bool runningcxx . . $ ProcessRegistry#running(7c222eea44a24d43).(stdcxx . . $ std/::stringcxx . . $ std/string# const &app); |
| 23 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> findAppcxx . . $ ProcessRegistry#findApp(aeccc7d5c30f8eff).(int PID); |
| 24 | |
| 25 | private: |
| 26 | void registeredAppcxx . . $ ProcessRegistry#registeredApp(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &app); |
| 27 | void unregisteredAppcxx . . $ ProcessRegistry#unregisteredApp(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &app); |
| 28 | |
| 29 | class AppRegistryObservercxx . . $ ProcessRegistry#AppRegistryObserver#; |
| 30 | stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<AppRegistryObservercxx . . $ ProcessRegistry#AppRegistryObserver#> const appRegObserver_cxx . . $ ProcessRegistry#appRegObserver_.; |
| 31 | stdcxx . . $ std/::unordered_mapcxx . . $ std/unordered_map#<int, stdcxx . . $ std/::stringcxx . . $ std/string#> pidReg_cxx . . $ ProcessRegistry#pidReg_.; |
| 32 | stdcxx . . $ std/::unordered_mapcxx . . $ std/unordered_map#<stdcxx . . $ std/::stringcxx . . $ std/string#, int> appCounterReg_cxx . . $ ProcessRegistry#appCounterReg_.; |
| 33 | stdcxx . . $ std/::mutexcxx . . $ std/mutex# mutex_cxx . . $ ProcessRegistry#mutex_.; |
| 34 | }; |