SmartSpectra C++ SDK
Measure human vitals from video with SmartSpectra C++ SDK.
Loading...
Searching...
No Matches
presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode > Class Template Reference

#include <redis_ipc_stream_writer.hpp>

Inheritance diagram for presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >:
presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >

Public Types

using Base = ipc::IpcStreamWriter<TIntegrationMode>
using BackgroundContainer
Public Types inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >
using BackgroundContainer

Public Member Functions

 RedisIpcStreamWriter (const RedisIpcConfig &configuration)
absl::Status WriteStatus (const presage::physiology::StatusValue &status) override
absl::Status WriteCoreMetrics (const presage::physiology::MetricsBuffer &metrics, int64_t timestamp_us) override
absl::Status WriteEdgeMetrics (const presage::physiology::Metrics &metrics, int64_t timestamp_us) override
absl::Status WriteFrame (const cv::Mat &frame, int64_t timestamp_us) override
void Close () override
bool IsOperational () const override
absl::Status Flush () override
absl::Status PublishRecordingState (bool recording)
Public Member Functions inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >
virtual absl::Status SwapContainer (std::shared_ptr< BackgroundContainer > new_container)
const BackgroundContainerGetContainer () const

Protected Member Functions

absl::Status Initialize ()
std::string BuildKey (const std::string &suffix) const
std::string BuildChannel (const std::string &suffix) const
Protected Member Functions inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >
virtual absl::Status RegisterCallbacks ()
virtual absl::Status SendInitialStatus ()
int64_t GetCurrentTimestampUs ()

Additional Inherited Members

Protected Attributes inherited from presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >
std::shared_ptr< BackgroundContainercontainer_

Detailed Description

template<container::settings::IntegrationMode TIntegrationMode>
class presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >

Redis-based implementation of IPC stream writer. Uses Redis pub/sub for real-time streaming and Redis keys for state storage.

Member Function Documentation

◆ BuildChannel()

template<container::settings::IntegrationMode TIntegrationMode>
std::string presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::BuildChannel ( const std::string & suffix) const
protected

Build Redis channel name with configured prefix.

◆ BuildKey()

template<container::settings::IntegrationMode TIntegrationMode>
std::string presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::BuildKey ( const std::string & suffix) const
protected

Build Redis key with configured prefix.

◆ Close()

template<container::settings::IntegrationMode TIntegrationMode>
void presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::Close ( )
overridevirtual

Close the stream and release resources. After calling this, the writer should not be used again.

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.

◆ Flush()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::Flush ( )
overridevirtual

Flush any buffered data to the underlying stream. Some implementations may buffer data for performance.

Returns
Status indicating success or failure

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.

◆ Initialize()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::Initialize ( )
protected

Initialize Redis connection and state.

◆ IsOperational()

template<container::settings::IntegrationMode TIntegrationMode>
bool presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::IsOperational ( ) const
overridevirtual

Check if the writer is currently operational.

Returns
true if the writer can accept writes, false otherwise

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.

◆ PublishRecordingState()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::PublishRecordingState ( bool recording)

Publish recording state change to Redis channel.

Parameters
recordingTrue if recording started, false if stopped
Returns
Status indicating success or failure

◆ WriteCoreMetrics()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::WriteCoreMetrics ( const presage::physiology::MetricsBuffer & metrics,
int64_t timestamp_us )
overridevirtual

Write core metrics to the stream.

Parameters
metricsThe core metrics buffer to write
timestamp_usTimestamp in microseconds since epoch
Returns
Status indicating success or failure

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.

◆ WriteEdgeMetrics()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::WriteEdgeMetrics ( const presage::physiology::Metrics & metrics,
int64_t timestamp_us )
overridevirtual

Write edge metrics to the stream.

Parameters
metricsThe edge metrics to write
Returns
Status indicating success or failure

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.

◆ WriteFrame()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::WriteFrame ( const cv::Mat & frame,
int64_t timestamp_us )
overridevirtual

Write a video frame to the stream.

Parameters
frameThe video frame as an OpenCV Mat (RGB format expected)
timestamp_usTimestamp in microseconds since epoch
Returns
Status indicating success or failure

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.

◆ WriteStatus()

template<container::settings::IntegrationMode TIntegrationMode>
absl::Status presage::smartspectra::redis_ipc::RedisIpcStreamWriter< TIntegrationMode >::WriteStatus ( const presage::physiology::StatusValue & status)
overridevirtual

Write a status value to the stream.

Parameters
statusThe status value to write
Returns
Status indicating success or failure

Implements presage::smartspectra::ipc::IpcStreamWriter< TIntegrationMode >.


The documentation for this class was generated from the following files: