Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Pipeline state tracker. More...
#include <state_tracker.h>
Public Member Functions | |
StateTracker () | |
Initialize all counters to zero. More... | |
sndio::DeviceState | get_state () const |
Compute current state. More... | |
size_t | num_active_sessions () const |
Get active sessions counter. More... | |
void | add_active_sessions (int increment) |
Add/subtract to active sessions counter. More... | |
size_t | num_pending_packets () const |
Get pending packets counter. More... | |
void | add_pending_packets (int increment) |
Add/subtract to pending packets counter. More... | |
Pipeline state tracker.
All sender/receiver slots, endpoints, and sessions pass state updates to the tracker, so that the top-level source/sink can quickly check if there is any ongoing activity currently.
Thread-safe.
Definition at line 30 of file state_tracker.h.
roc::pipeline::StateTracker::StateTracker | ( | ) |
Initialize all counters to zero.
void roc::pipeline::StateTracker::add_active_sessions | ( | int | increment | ) |
Add/subtract to active sessions counter.
void roc::pipeline::StateTracker::add_pending_packets | ( | int | increment | ) |
Add/subtract to pending packets counter.
sndio::DeviceState roc::pipeline::StateTracker::get_state | ( | ) | const |
Compute current state.
size_t roc::pipeline::StateTracker::num_active_sessions | ( | ) | const |
Get active sessions counter.
size_t roc::pipeline::StateTracker::num_pending_packets | ( | ) | const |
Get pending packets counter.