SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
core_metrics_provider.hpp
1
2// metrics_provider.hpp
3// Created by greg on 2/19/25.
4// Copyright (C) 2025 Presage Security, Inc.
5//
6// This program is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 3 of the License, or (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public License
17// along with this program; if not, write to the Free Software Foundation,
18// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
21// === standard library includes (if any) ===
22#include <queue>
23#include <mutex>
24// === third-party includes (if any) ===
25#include <grpc/grpc.h>
26#include <grpcpp/grpcpp.h>
27#include <grpcpp/impl/codegen/server_callback.h>
28#include <physiology/modules/rpc.h>
29// === local includes (if any) ===
30#include <smartspectra/cpp/physiology_service.pb.h>
31#include <smartspectra/container/background_container.hpp>
32#include "queued_server_write_reactor.hpp"
33
34#pragma once
35
36namespace presage::smartspectra::grpc_bindings {
37
38template<container::settings::IntegrationMode TIntegrationMode>
39class CoreMetricsProvider :
40 public QueuedServerWriteReactor<presage::physiology::MetricsBuffer> {
41public:
42 using BackgroundContainer =
44 presage::platform_independence::DeviceType::Cpu,
45 smartspectra::container::settings::OperationMode::Continuous,
46 TIntegrationMode
47 >;
48 explicit CoreMetricsProvider(std::shared_ptr<BackgroundContainer> container);
49 void SwapContainer(std::shared_ptr<BackgroundContainer> new_container);
50 const BackgroundContainer* GetContainer() const { return this->container.get(); }
51private:
52 std::shared_ptr<BackgroundContainer> container;
53};
54
55
56} // namespace presage::smartspectra::grpc_bindings
Container for background thread processing.
Definition background_container.hpp:40