| 54 | { |
| 55 | |
| 56 | ConstSystemMonitorsRcPtr SystemMonitors::Get() noexcept |
| 57 | { |
| 58 | static ConstSystemMonitorsRcPtr monitors; |
| 59 | static Mutex mutex; |
| 60 | |
| 61 | AutoMutex guard(mutex); |
| 62 | |
| 63 | if (!monitors) |
| 64 | { |
| 65 | SystemMonitorsRcPtr m = std::make_shared<SystemMonitorsImpl>(); |
| 66 | try |
| 67 | { |
| 68 | DynamicPtrCast<SystemMonitorsImpl>(m)->getAllMonitors(); |
| 69 | } |
| 70 | catch (const std::exception & ex) |
| 71 | { |
| 72 | LogDebug(ex.what()); |
| 73 | } |
| 74 | monitors = m; |
| 75 | } |
| 76 | |
| 77 | return monitors; |
| 78 | } |
| 79 | |
| 80 | bool SystemMonitorsImpl::isSupported() const noexcept |
| 81 | { |
nothing calls this directly
no test coverage detected