Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::pipeline::StateTracker Class Reference

Pipeline state tracker. More...

#include <state_tracker.h>

Inheritance diagram for roc::pipeline::StateTracker:
Collaboration diagram for roc::pipeline::StateTracker:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ StateTracker()

roc::pipeline::StateTracker::StateTracker ( )

Initialize all counters to zero.

Member Function Documentation

◆ add_active_sessions()

void roc::pipeline::StateTracker::add_active_sessions ( int  increment)

Add/subtract to active sessions counter.

◆ add_pending_packets()

void roc::pipeline::StateTracker::add_pending_packets ( int  increment)

Add/subtract to pending packets counter.

◆ get_state()

sndio::DeviceState roc::pipeline::StateTracker::get_state ( ) const

Compute current state.

◆ num_active_sessions()

size_t roc::pipeline::StateTracker::num_active_sessions ( ) const

Get active sessions counter.

◆ num_pending_packets()

size_t roc::pipeline::StateTracker::num_pending_packets ( ) const

Get pending packets counter.


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