LibQuicR
quicr::ForwardingSubscribeTrackHandler Class Referenceabstract

MOQ track handler that takes a subscribed track's streams as bytes. More...

#include <forwarding_subscribe_track_handler.h>

Inheritance diagram for quicr::ForwardingSubscribeTrackHandler:
quicr::SubscribeTrackHandler quicr::TrackHandler

Public Types

enum class  Error : uint8_t { kOk = 0 , kNotAuthorized , kNotSubscribed , kNoData }
 Receive status codes. More...
 
enum class  Status : uint8_t {
  kOk = 0 , kNotConnected , kError , kNotAuthorized ,
  kNotSubscribed , kPendingResponse , kSendingUnsubscribe , kPaused ,
  kNewGroupRequested , kCancelled , kDoneByFin , kDoneByReset
}
 Status codes for the subscribe track. More...
 

Public Member Functions

virtual void SubgroupStarted (std::uint64_t group_id, std::uint64_t subgroup_id, std::optional< std::uint8_t > priority, messages::StreamHeaderProperties properties)=0
 Notification that a subgroup has started arriving on a stream of its own. More...
 
virtual void StreamBytesForwarded (std::uint64_t group_id, std::uint64_t subgroup_id, Bytes &&data)=0
 Notification of bytes arriving on a subgroup's stream. More...
 
constexpr Status GetStatus () const noexcept
 Get the status of the subscribe. More...
 
void SetSubscriberPriority (uint8_t priority) noexcept
 Sets the subscriber priority used in subsequent control updates. More...
 
constexpr std::uint8_t GetSubscriberPriority () const noexcept
 Get subscription priority. More...
 
constexpr std::optional< messages::GroupOrder > GetGroupOrder () const noexcept
 Get subscription group order. More...
 
constexpr messages::GroupOrder GetPublisherDefaultGroupOrder () const noexcept
 
void SetPublisherDefaultGroupOrder (messages::GroupOrder group_order) noexcept
 Stores the publisher's default group order. More...
 
messages::FilterType GetFilterType () const noexcept
 Get subscription filter type. More...
 
constexpr const messages::Filter & GetFilter () const noexcept
 
constexpr std::optional< messages::Location > GetLatestLocation () const noexcept
 
constexpr void SetLatestLocation (messages::Location new_location) noexcept
 Records the latest object location. More...
 
std::optional< messages::Location > GetLatestDeliveredLocation () const
 
std::optional< JoiningFetch > GetJoiningFetch () const noexcept
 Gets joining-fetch attributes. More...
 
void SetTrackAlias (uint64_t track_alias)
 Set the track alias. More...
 
std::optional< uint64_t > GetTrackAlias () const noexcept
 Get the track alias. More...
 
void SetReceivedTrackAlias (uint64_t track_alias)
 Set the received track alias. More...
 
void SetNewGroupRequestId (uint64_t group_id)
 Set the new group request Id. More...
 
std::optional< uint64_t > GetReceivedTrackAlias () const noexcept
 Get the received track alias. More...
 
void SetPublishInitiated () noexcept
 Marks this handler publisher-initiated. More...
 
void Pause () noexcept
 Pause receiving data. More...
 
void Resume () noexcept
 Resume receiving data. More...
 
void RequestNewGroup (uint64_t group_id=0) noexcept
 Generate a new group request for this subscription. More...
 
void SupportNewGroupRequest (bool is_supported) noexcept
 Indicate if subscribe handler should send new group requests or not. More...
 
bool IsNewGroupRequestSupported () const noexcept
 Indicate if subscribe handler can send new group requests or not. More...
 
const std::optional< std::chrono::milliseconds > & GetDeliveryTimeout () const noexcept
 Gets the requested delivery timeout. More...
 
void SetDeliveryTimeout (std::chrono::milliseconds timeout) noexcept
 Stores a requested delivery timeout. More...
 
constexpr std::chrono::milliseconds GetRendezvousTimeout () const noexcept
 Gets the requested rendezvous timeout. More...
 
void SetRendezvousTimeout (std::chrono::milliseconds timeout)
 Set the subscription's rendezvous timeout. More...
 
bool IsPublisherInitiated () const noexcept
 Check if the subscribe is publisher initiated or not. More...
 
template<typename T >
requires std::is_base_of_v< TrackHandler, T > std::shared_ptr< T > Get ()
 Get the derived type of the track handler. More...
 
void SetRequestId (std::optional< uint64_t > request_id)
 Sets or clears the connection-scoped request ID. More...
 
std::optional< uint64_t > GetRequestId () const noexcept
 Get the request ID. More...
 
std::optional< uint64_t > GetRequestStreamId () const
 Get the stream ID of the request control stream. More...
 
FullTrackName GetFullTrackName () const noexcept
 Get the full track name. More...
 
uint64_t GetConnectionId () const noexcept
 Gets the transport connection identifier assigned by the session. More...
 
std::shared_ptr< Connection > GetConnection () const
 
Binding GetBinding () const
 
virtual void RequestError (ErrorCode error_code, std::string reason)
 Handles a REQUEST_ERROR for this handler. More...
 
Callbacks
virtual void ObjectReceived ([[maybe_unused]] const ObjectHeaders &object_headers, [[maybe_unused]] BytesSpan data, std::optional< messages::StreamHeaderProperties > stream_mode=std::nullopt)
 Notification of received [full] data object. More...
 
virtual void ObjectStatusReceived ([[maybe_unused]] uint64_t group_id, [[maybe_unused]] uint64_t object_id, [[maybe_unused]] std::uint8_t priority, [[maybe_unused]] ObjectStatus status, [[maybe_unused]] std::optional< Extensions > extensions, [[maybe_unused]] std::optional< Extensions > immutable_extensions)
 Notification of received object status. More...
 
virtual void SubgroupEnded ([[maybe_unused]] std::uint64_t group_id, [[maybe_unused]] std::uint64_t subgroup_id, [[maybe_unused]] bool reset)
 Notification that no more objects are coming for a subgroup. More...
 
virtual void DgramDataRecv (std::shared_ptr< const std::vector< uint8_t >> data)
 Notification of received datagram data. More...
 
virtual void PartialObjectReceived ([[maybe_unused]] const ObjectHeaders &object_headers, [[maybe_unused]] BytesSpan data)
 Notification of a partial object received data object. More...
 
virtual void StatusChanged ([[maybe_unused]] Status status)
 Notification of subscribe status. More...
 
virtual void MetricsSampled ([[maybe_unused]] const SubscribeTrackMetrics &metrics)
 Notification callback to provide sampled metrics. More...
 
Reply< messages::Parameters, ErrorCode > RequestUpdateReceived (const messages::Parameters &params) override
 Handles an update received from the publisher. More...
 

Static Public Member Functions

static std::shared_ptr< SubscribeTrackHandler > Create (const FullTrackName &full_track_name, std::uint8_t priority, std::optional< messages::GroupOrder > group_order=messages::GroupOrder::kAscending, const messages::Filter &filter=std::monostate{}, bool publisher_initiated=false)
 Create shared Subscribe track handler. More...
 

Public Attributes

SubscribeTrackMetrics subscribe_track_metrics_
 Subscribe metrics for the track. More...
 

Protected Member Functions

 SubscribeTrackHandler (const FullTrackName &full_track_name, std::uint8_t priority, std::optional< messages::GroupOrder > group_order, const messages::Filter &filter=std::monostate{}, const std::optional< JoiningFetch > &joining_fetch=std::nullopt, bool publisher_initiated=false)
 Inherits the protected subscription constructors. More...
 
void RequestOkReceived (const messages::Parameters &params) override
 Validates REQUEST_UPDATE_OK parameters. More...
 
void SetStatus (Status status) noexcept
 Set the subscribe status. More...
 
void SetTransport (std::shared_ptr< Session > transport)
 Sets the session used for control and data operations. More...
 
const std::weak_ptr< Session > & GetSession () const noexcept
 Gets the non-owning session handle. More...
 

Protected Attributes

std::optional< uint64_t > pending_new_group_request_id_
 Pending new-group request ID; zero denotes an unspecified group. More...
 
StreamBuffer< uint8_t > dgram_buffer_
 Reusable internal datagram decode buffer; derived classes should not retain views into it. More...
 
FullTrackName full_track_name_
 Full track identity retained for the handler's lifetime. More...
 
std::mutex binding_operation_mutex_
 

Detailed Description

MOQ track handler that takes a subscribed track's streams as bytes.

Delivers each subgroup header followed by its raw stream bytes, allowing a relay to forward the subgroup without parsing individual objects. The track alias must be rewritten because it is scoped to the session.

Stream objects are not delivered to ObjectReceived or counted individually. Datagrams are still delivered to ObjectReceived, which a relay should override if it expects them. Callbacks run synchronously on the session receive path and may interleave across subgroup streams, but calls themselves are not concurrent from one session's receive processing.

Member Enumeration Documentation

◆ Error

enum quicr::SubscribeTrackHandler::Error : uint8_t
stronginherited

Receive status codes.

Enumerator
kOk 

Receive operation succeeded.

kNotAuthorized 

Subscriber is not authorized for the track.

kNotSubscribed 

No active subscription exists.

kNoData 

No object data is available.

◆ Status

enum quicr::SubscribeTrackHandler::Status : uint8_t
stronginherited

Status codes for the subscribe track.

Enumerator
kOk 

Subscription is active and may receive data.

kNotConnected 

Transport is disconnected.

kError 

Subscription failed for an unspecified error.

kNotAuthorized 

Peer denied authorization.

kNotSubscribed 

Initial/inactive state.

kPendingResponse 

Waiting for the peer's response.

kSendingUnsubscribe 

In this state, callbacks will not be called,.

kPaused 

Forwarding is locally marked paused.

kNewGroupRequested 

A new-group transition is in progress.

kCancelled 

Subscription was cancelled.

kDoneByFin 

Request or data stream ended normally.

kDoneByReset 

Request or data stream was reset.

Member Function Documentation

◆ Create()

static std::shared_ptr<SubscribeTrackHandler> quicr::SubscribeTrackHandler::Create ( const FullTrackName &  full_track_name,
std::uint8_t  priority,
std::optional< messages::GroupOrder >  group_order = messages::GroupOrder::kAscending,
const messages::Filter &  filter = std::monostate{},
bool  publisher_initiated = false 
)
inlinestaticinherited

Create shared Subscribe track handler.

Parameters
full_track_nameFull track name struct
prioritySubscription priority, if omitted, publisher priority is considered
group_orderOrder for group delivery, or nullopt for publisher default
filterSubscription selection filter
publisher_initiatedWhether the peer publisher initiated the subscription
Returns
Shared ownership of the new handler.
Examples
simple_subscribe/main.cpp.

◆ DgramDataRecv()

virtual void quicr::SubscribeTrackHandler::DgramDataRecv ( std::shared_ptr< const std::vector< uint8_t >>  data)
virtualinherited

Notification of received datagram data.

Event notification to provide the caller the raw data received as a datagram

Parameters
dataShared immutable ownership of the complete encoded datagram; an override may retain it after return.

The default implementation decodes the datagram synchronously, updates object counters, and invokes ObjectReceived or ObjectStatusReceived. The pointer must not be null and the buffer must not be empty.

Exceptions
messages::ProtocolViolationExceptionPropagated for malformed protocol fields.

◆ Get()

template<typename T >
requires std::is_base_of_v<TrackHandler, T> std::shared_ptr<T> quicr::TrackHandler::Get ( )
inlineinherited

Get the derived type of the track handler.

Template Parameters
TDerived type of the track handler.
Returns
Shared ownership cast to T, or null when the dynamic type is incompatible.
Exceptions
std::bad_weak_ptrif this object is not currently owned by a shared_ptr.

◆ GetBinding()

Binding quicr::TrackHandler::GetBinding ( ) const
inlineinherited

◆ GetConnection()

std::shared_ptr<Connection> quicr::TrackHandler::GetConnection ( ) const
inherited

◆ GetConnectionId()

uint64_t quicr::TrackHandler::GetConnectionId ( ) const
inlinenoexceptinherited

Gets the transport connection identifier assigned by the session.

Returns
Connection ID, or the initial value zero before assignment.

◆ GetDeliveryTimeout()

const std::optional<std::chrono::milliseconds>& quicr::SubscribeTrackHandler::GetDeliveryTimeout ( ) const
inlinenoexceptinherited

Gets the requested delivery timeout.

Returns
Borrowed optional timeout, valid for this handler's lifetime.

◆ GetFilter()

constexpr const messages::Filter& quicr::SubscribeTrackHandler::GetFilter ( ) const
inlineconstexprnoexceptinherited
Returns
Borrowed immutable filter, valid for this handler's lifetime.

◆ GetFilterType()

messages::FilterType quicr::SubscribeTrackHandler::GetFilterType ( ) const
inlinenoexceptinherited

Get subscription filter type.

Returns
Protocol discriminator for GetFilter().

◆ GetFullTrackName()

FullTrackName quicr::TrackHandler::GetFullTrackName ( ) const
inlinenoexceptinherited

Get the full track name.

Returns
A copy of the full track name.

◆ GetGroupOrder()

constexpr std::optional<messages::GroupOrder> quicr::SubscribeTrackHandler::GetGroupOrder ( ) const
inlineconstexprnoexceptinherited

Get subscription group order.

Returns
Requested order, or std::nullopt when the publisher chooses.

◆ GetJoiningFetch()

std::optional<JoiningFetch> quicr::SubscribeTrackHandler::GetJoiningFetch ( ) const
inlinenoexceptinherited

Gets joining-fetch attributes.

Returns
A copy of the attributes, or std::nullopt when no joining fetch was requested.

◆ GetLatestDeliveredLocation()

std::optional<messages::Location> quicr::SubscribeTrackHandler::GetLatestDeliveredLocation ( ) const
inlineinherited

◆ GetLatestLocation()

constexpr std::optional<messages::Location> quicr::SubscribeTrackHandler::GetLatestLocation ( ) const
inlineconstexprnoexceptinherited
Returns
Most recently recorded object location, or std::nullopt if none is known.

◆ GetPublisherDefaultGroupOrder()

constexpr messages::GroupOrder quicr::SubscribeTrackHandler::GetPublisherDefaultGroupOrder ( ) const
inlineconstexprnoexceptinherited
Returns
Publisher's default group order learned for this subscription.

◆ GetReceivedTrackAlias()

std::optional<uint64_t> quicr::SubscribeTrackHandler::GetReceivedTrackAlias ( ) const
inlinenoexceptinherited

Get the received track alias.

If the track alias is set, it will be returned, otherwise std::nullopt.

Returns
Track alias if set, otherwise std::nullopt.

◆ GetRendezvousTimeout()

constexpr std::chrono::milliseconds quicr::SubscribeTrackHandler::GetRendezvousTimeout ( ) const
inlineconstexprnoexceptinherited

Gets the requested rendezvous timeout.

Returns
Non-negative timeout; zero requests no rendezvous wait.

◆ GetRequestId()

std::optional<uint64_t> quicr::TrackHandler::GetRequestId ( ) const
inlinenoexceptinherited

Get the request ID.

Returns
Current connection-scoped request ID, or std::nullopt when none is assigned.

◆ GetRequestStreamId()

std::optional<uint64_t> quicr::TrackHandler::GetRequestStreamId ( ) const
inherited

Get the stream ID of the request control stream.

Returns
Request stream's ID, or std::nullopt if no stream is attached.
Note
Thread-safe with request-stream installation/removal.

◆ GetSession()

const std::weak_ptr<Session>& quicr::TrackHandler::GetSession ( ) const
protectednoexceptinherited

Gets the non-owning session handle.

Returns
Borrowed reference to the stored weak pointer, valid for this handler's lifetime. Callers must lock it before use.

◆ GetStatus()

constexpr Status quicr::SubscribeTrackHandler::GetStatus ( ) const
inlineconstexprnoexceptinherited

Get the status of the subscribe.

Returns
Status of the subscribe

◆ GetSubscriberPriority()

constexpr std::uint8_t quicr::SubscribeTrackHandler::GetSubscriberPriority ( ) const
inlineconstexprnoexceptinherited

Get subscription priority.

Returns
Current subscription priority.

◆ GetTrackAlias()

std::optional<uint64_t> quicr::SubscribeTrackHandler::GetTrackAlias ( ) const
inlinenoexceptinherited

Get the track alias.

If the track alias is set, it will be returned, otherwise std::nullopt.

Returns
Track alias if set, otherwise std::nullopt.

◆ IsNewGroupRequestSupported()

bool quicr::SubscribeTrackHandler::IsNewGroupRequestSupported ( ) const
inlinenoexceptinherited

Indicate if subscribe handler can send new group requests or not.

Returns
True if new group requests are supported.

◆ IsPublisherInitiated()

bool quicr::SubscribeTrackHandler::IsPublisherInitiated ( ) const
inlinenoexceptinherited

Check if the subscribe is publisher initiated or not.

Returns
True if publisher initiated, false if initiated by the relay/server

◆ MetricsSampled()

virtual void quicr::SubscribeTrackHandler::MetricsSampled ( [[maybe_unused] ] const SubscribeTrackMetrics &  metrics)
inlinevirtualinherited

Notification callback to provide sampled metrics.

Called at the connection metrics cadence, including idle periods, on the session's metrics-reporting path. The structure is a cumulative live snapshot for object and byte counters; those counters are not reset after the callback.

Parameters
metricsCopy of the subscribed metrics for the sample period
Note
The reference is borrowed for the callback. Copy it to retain a stable snapshot.

◆ ObjectReceived()

virtual void quicr::SubscribeTrackHandler::ObjectReceived ( [[maybe_unused] ] const ObjectHeaders &  object_headers,
[[maybe_unused] ] BytesSpan  data,
std::optional< messages::StreamHeaderProperties >  stream_mode = std::nullopt 
)
virtualinherited

Notification of received [full] data object.

Event notification to provide the caller the received full data object

Warning
data is borrowed and invalid after this method returns. Copy it to retain it.
Parameters
object_headersObject headers, must include group and object Ids
dataObject payload data received, MUST match ObjectHeaders::payload_length.
stream_modeIf this is the first object of a subgroup, its properties.
Note
Called synchronously on the session receive path. The default implementation discards the object.
Examples
simple_subscribe/main.cpp.

◆ ObjectStatusReceived()

virtual void quicr::SubscribeTrackHandler::ObjectStatusReceived ( [[maybe_unused] ] uint64_t  group_id,
[[maybe_unused] ] uint64_t  object_id,
[[maybe_unused] ] std::uint8_t  priority,
[[maybe_unused] ] ObjectStatus  status,
[[maybe_unused] ] std::optional< Extensions >  extensions,
[[maybe_unused] ] std::optional< Extensions >  immutable_extensions 
)
inlinevirtualinherited

Notification of received object status.

Event notification when an ObjectDatagramStatus message is received.

Parameters
group_idGroup ID of the status
object_idObject ID of the status
priorityPriority of the status
statusStatus
extensionsMutable extensions, if any
immutable_extensionsImmutable extensions, if any
Note
Extension optionals are passed by value and may be retained or moved by an override. The default implementation does nothing.

◆ PartialObjectReceived()

virtual void quicr::SubscribeTrackHandler::PartialObjectReceived ( [[maybe_unused] ] const ObjectHeaders &  object_headers,
[[maybe_unused] ] BytesSpan  data 
)
inlinevirtualinherited

Notification of a partial object received data object.

Event notification to provide the caller the received data object

Warning
data is borrowed and invalid after this method returns. Copy it to retain it.
Parameters
object_headersObject headers, must include group and object Ids
dataObject payload data received, can be <= ObjectHeaders::payload_length
Note
The default implementation does nothing. This callback is reserved for partial delivery paths and does not imply object completion.

◆ Pause()

void quicr::SubscribeTrackHandler::Pause ( )
noexceptinherited

Pause receiving data.

Sends a REQUEST_UPDATE with forwarding disabled and immediately changes local state to kPaused. It silently does nothing without a live session/request stream, when already paused, or in kNotConnected. No StatusChanged callback is made.

◆ RequestError()

virtual void quicr::TrackHandler::RequestError ( ErrorCode  error_code,
std::string  reason 
)
virtualinherited

Handles a REQUEST_ERROR for this handler.

Parameters
error_codePeer-provided request error code.
reasonPeer-provided reason, passed by value for optional retention.
Note
The base implementation intentionally does nothing.

Reimplemented in quicr::TrackStatusHandler, quicr::SubscribeNamespaceHandler, and quicr::PublishNamespaceHandler.

◆ RequestNewGroup()

void quicr::SubscribeTrackHandler::RequestNewGroup ( uint64_t  group_id = 0)
noexceptinherited

Generate a new group request for this subscription.

Parameters
group_idValue of group requested or zero if unknown

Silently does nothing unless status is kOk, new-group requests are enabled, and both the session and request stream are available. Local status is unchanged.

◆ RequestOkReceived()

void quicr::SubscribeTrackHandler::RequestOkReceived ( const messages::Parameters &  params)
overrideprotectedvirtualinherited

Validates REQUEST_UPDATE_OK parameters.

Parameters
paramsBorrowed response parameters; only expiration and largest-object are accepted.
Exceptions
messages::ProtocolViolationExceptionfor unsupported parameters.
Note
Accepted values are currently validated but otherwise ignored.

Implements quicr::TrackHandler.

◆ RequestUpdateReceived()

Reply<messages::Parameters, ErrorCode> quicr::SubscribeTrackHandler::RequestUpdateReceived ( const messages::Parameters &  params)
overridevirtualinherited

Handles an update received from the publisher.

Parameters
paramsBorrowed update parameters.
Returns
Immediate success with empty parameters for a valid publisher-initiated authorization-token-only update.
Exceptions
messages::ProtocolViolationExceptionfor updates to subscriber-initiated subscriptions or unsupported parameters.

Implements quicr::TrackHandler.

◆ Resume()

void quicr::SubscribeTrackHandler::Resume ( )
noexceptinherited

Resume receiving data.

Sends a REQUEST_UPDATE with forwarding enabled and immediately changes local state to kOk. It silently does nothing unless currently paused and attached to a live session/request stream. No StatusChanged callback is made.

◆ SetDeliveryTimeout()

void quicr::SubscribeTrackHandler::SetDeliveryTimeout ( std::chrono::milliseconds  timeout)
inlinenoexceptinherited

Stores a requested delivery timeout.

Parameters
timeoutTimeout to store; negative values are accepted and no update is sent.

◆ SetLatestLocation()

constexpr void quicr::SubscribeTrackHandler::SetLatestLocation ( messages::Location  new_location)
inlineconstexprnoexceptinherited

Records the latest object location.

Parameters
new_locationLocation to store.

◆ SetNewGroupRequestId()

void quicr::SubscribeTrackHandler::SetNewGroupRequestId ( uint64_t  group_id)
inlineinherited

Set the new group request Id.

Parameters
group_idGroup ID to request via new group request

Stores the larger pending ID. A non-increasing ID replaces the pending value with zero, which represents an unknown/new group request.

◆ SetPublisherDefaultGroupOrder()

void quicr::SubscribeTrackHandler::SetPublisherDefaultGroupOrder ( messages::GroupOrder  group_order)
inlinenoexceptinherited

Stores the publisher's default group order.

Parameters
group_orderNew default.

◆ SetPublishInitiated()

void quicr::SubscribeTrackHandler::SetPublishInitiated ( )
inlinenoexceptinherited

Marks this handler publisher-initiated.

Also changes kNotSubscribed to kOk. No callback or protocol message is sent, and any previously retained joining-fetch attributes are not cleared.

◆ SetReceivedTrackAlias()

void quicr::SubscribeTrackHandler::SetReceivedTrackAlias ( uint64_t  track_alias)
inlineinherited

Set the received track alias.

Parameters
track_aliasMoQ track alias for track namespace+name that is relative to the QUIC connection session

◆ SetRendezvousTimeout()

void quicr::SubscribeTrackHandler::SetRendezvousTimeout ( std::chrono::milliseconds  timeout)
inlineinherited

Set the subscription's rendezvous timeout.

This requests that the peer holds this subscribe pending for up to this amount of time if a publisher is not yet present for this track.

Parameters
timeoutNon-negative duration to request.
Exceptions
std::invalid_argumentif the timeout is negative.
Note
Stores local request attributes only; it does not update an active subscription.

◆ SetRequestId()

void quicr::TrackHandler::SetRequestId ( std::optional< uint64_t >  request_id)
inlineinherited

Sets or clears the connection-scoped request ID.

Parameters
request_idRequest ID assigned by the session, or std::nullopt when unbound.
Note
Thread-safe with request-stream installation and removal.

◆ SetStatus()

void quicr::SubscribeTrackHandler::SetStatus ( Status  status)
inlineprotectednoexceptinherited

Set the subscribe status.

Parameters
statusStatus of the subscribe

Assigns the status and synchronously invokes StatusChanged, even when the value did not change.

◆ SetSubscriberPriority()

void quicr::SubscribeTrackHandler::SetSubscriberPriority ( uint8_t  priority)
inlinenoexceptinherited

Sets the subscriber priority used in subsequent control updates.

Parameters
priorityPriority value; existing streams and already-sent requests are unchanged.

◆ SetTrackAlias()

void quicr::SubscribeTrackHandler::SetTrackAlias ( uint64_t  track_alias)
inlineinherited

Set the track alias.

Parameters
track_aliasMoQ track alias for track namespace+name that is relative to the QUIC connection session

◆ SetTransport()

void quicr::TrackHandler::SetTransport ( std::shared_ptr< Session >  transport)
protectedinherited

Sets the session used for control and data operations.

Parameters
transportSession retained weakly; passing null clears effective access.
Note
The caller must keep the session alive independently.

◆ StatusChanged()

virtual void quicr::SubscribeTrackHandler::StatusChanged ( [[maybe_unused] ] Status  status)
inlinevirtualinherited

Notification of subscribe status.

Notification of the subscribe status

Parameters
statusIndicates status of the subscribe
Note
The default implementation does nothing. Depending on the initiating operation, some direct local state changes (including Pause() and Resume()) do not invoke it.

◆ StreamBytesForwarded()

virtual void quicr::ForwardingSubscribeTrackHandler::StreamBytesForwarded ( std::uint64_t  group_id,
std::uint64_t  subgroup_id,
Bytes &&  data 
)
pure virtual

Notification of bytes arriving on a subgroup's stream.

Everything that has arrived since the last call, in order, starting after the subgroup header. A run falls on no particular boundary, so it may hold several objects, part of one, or the end of one and the start of the next. A track's subgroups arrive on streams of their own and so interleave here, which is why every call names one.

Parameters
group_idGroup the subgroup belongs to
subgroup_idSubgroup the bytes belong to
dataOwning byte buffer transferred to the callback; it may be moved elsewhere and retained after return
Note
Called synchronously on the session receive path. The buffer contains only bytes received since the preceding call for this subgroup.

◆ SubgroupEnded()

virtual void quicr::SubscribeTrackHandler::SubgroupEnded ( [[maybe_unused] ] std::uint64_t  group_id,
[[maybe_unused] ] std::uint64_t  subgroup_id,
[[maybe_unused] ] bool  reset 
)
inlinevirtualinherited

Notification that no more objects are coming for a subgroup.

The publisher has either finished the subgroup or given up on it, so a subscriber forwarding it on can close out the subgroup it is publishing. Only reported for subgroups at least one object arrived for.

Parameters
group_idGroup the subgroup belongs to
subgroup_idSubgroup that has ended
resetTrue if the publisher gave up on the subgroup rather than finishing it
Note
Called only for a subgroup that reached the handler. The default does nothing.

◆ SubgroupStarted()

virtual void quicr::ForwardingSubscribeTrackHandler::SubgroupStarted ( std::uint64_t  group_id,
std::uint64_t  subgroup_id,
std::optional< std::uint8_t >  priority,
messages::StreamHeaderProperties  properties 
)
pure virtual

Notification that a subgroup has started arriving on a stream of its own.

Called once per stream, before any of its bytes, with enough of the subgroup header to write an equivalent one.

Parameters
group_idGroup the subgroup belongs to
subgroup_idSubgroup the bytes belong to
priorityPriority the publisher gave the subgroup, unset if it left it to the framing's default
propertiesHow the subgroup is framed
Note
Called synchronously before the first StreamBytesForwarded call for this stream.

◆ SubscribeTrackHandler()

quicr::SubscribeTrackHandler::SubscribeTrackHandler
inlineprotected

Inherits the protected subscription constructors.

Derived forwarding handlers supply the same subscription attributes and obey the same session-ownership and state rules as SubscribeTrackHandler.

Parameters
full_track_nameTrack identity copied into the handler.
prioritySubscription scheduling priority.
group_orderRequested group order, or no value for the publisher default.
filterSubscription selection filter.
joining_fetchOptional joining-fetch attributes.
publisher_initiatedWhether the publisher initiated the subscription.

◆ SupportNewGroupRequest()

void quicr::SubscribeTrackHandler::SupportNewGroupRequest ( bool  is_supported)
noexceptinherited

Indicate if subscribe handler should send new group requests or not.

Parameters
is_supportedTrue to send new group requests, False to disable sending
Note
This changes local capability only and sends no control message.

Member Data Documentation

◆ binding_operation_mutex_

std::mutex quicr::TrackHandler::binding_operation_mutex_
protectedinherited

◆ dgram_buffer_

StreamBuffer<uint8_t> quicr::SubscribeTrackHandler::dgram_buffer_
protectedinherited

Reusable internal datagram decode buffer; derived classes should not retain views into it.

◆ full_track_name_

FullTrackName quicr::TrackHandler::full_track_name_
protectedinherited

Full track identity retained for the handler's lifetime.

◆ pending_new_group_request_id_

std::optional<uint64_t> quicr::SubscribeTrackHandler::pending_new_group_request_id_
protectedinherited

Pending new-group request ID; zero denotes an unspecified group.

◆ subscribe_track_metrics_

SubscribeTrackMetrics quicr::SubscribeTrackHandler::subscribe_track_metrics_
inherited

Subscribe metrics for the track.

Public live counters updated by receive/session processing. Object counters include decoded data and status datagrams; byte counters count payload bytes for decoded objects and transport stream bytes for streamed delivery. Values are cumulative and are not reset after MetricsSampled. Unsynchronized application writes race with session updates.


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