SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
status_code_provider.hpp
1
2// status_code_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 <condition_variable>
23#include <thread>
24#include <queue>
25// === third-party includes (if any) ===
26#include <grpc/grpc.h>
27#include <grpcpp/grpcpp.h>
28#include <grpcpp/impl/codegen/server_callback.h>
29#include <physiology/modules/rpc.h>
30// === local includes (if any) ===
31#include <smartspectra/cpp/physiology_service.pb.h>
32#include <smartspectra/container/background_container.hpp>
33#include "queued_server_write_reactor.hpp"
34
35#pragma once
36
37namespace presage::smartspectra::grpc_bindings {
38
39template<container::settings::IntegrationMode TIntegrationMode>
40class StatusCodeProvider :
41 public QueuedServerWriteReactor<presage::physiology::StatusValue> {
42public:
43 using BackgroundContainer =
45 presage::platform_independence::DeviceType::Cpu,
46 smartspectra::container::settings::OperationMode::Continuous,
47 TIntegrationMode
48 >;
49 explicit StatusCodeProvider(std::shared_ptr<BackgroundContainer> container);
50 void SwapContainer(std::shared_ptr<BackgroundContainer> new_container);
51 const BackgroundContainer* GetContainer() const { return this->container.get(); }
52private:
53 std::shared_ptr<BackgroundContainer> container;
54 physiology::StatusValue gap_status;
55};
56
57} // namespace presage::smartspectra::grpc_bindings
Container for background thread processing.
Definition background_container.hpp:40