LibQuicR
Loading...
Searching...
No Matches
quicr::FetchTrackHandler Class Reference

#include <fetch_track_handler.h>

Inheritance diagram for quicr::FetchTrackHandler:
quicr::SubscribeTrackHandler

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
}
 Status codes for the subscribe track. More...

Public Member Functions

constexpr const messages::GroupId & GetStartGroup () const noexcept
 Get the starting group id of the Fetch range.
constexpr const messages::GroupId & GetEndGroup () const noexcept
 Get the id of the group one past the end of the Fetch range.
constexpr const messages::GroupId & GetStartObject () const noexcept
 Get the starting object id of the Group range.
constexpr const messages::GroupId & GetEndObject () const noexcept
 Get the id of the object one past the end of the group range.
void StreamDataRecv (bool is_start, uint64_t stream_id, std::shared_ptr< const std::vector< uint8_t > > data) override
 Notification of received stream data slice.
constexpr Status GetStatus () const noexcept
 Get the status of the subscribe.
void SetPriority (uint8_t priority) noexcept
 Set the priority of received data.
constexpr messages::SubscriberPriority GetPriority () const noexcept
 Get subscription priority.
constexpr messages::GroupOrder GetGroupOrder () const noexcept
 Get subscription group order.
constexpr messages::FilterType GetFilterType () const noexcept
 Get subscription filter type.
constexpr std::optional< messages::Location > GetLatestLocation () const noexcept
constexpr void SetLatestLocation (messages::Location new_location) noexcept
std::optional< JoiningFetchGetJoiningFetch () const noexcept
 Get joining fetch info, if any.
void SetTrackAlias (uint64_t track_alias)
 Set the track alias.
std::optional< uint64_t > GetTrackAlias () const noexcept
 Get the track alias.
void SetReceivedTrackAlias (uint64_t track_alias)
 Set the received track alias.
std::optional< uint64_t > GetReceivedTrackAlias () const noexcept
 Get the received track alias.
void Pause () noexcept
 Pause receiving data.
void Resume () noexcept
 Resume receiving data.
void RequestNewGroup () noexcept
 Generate a new group request for this subscription.
std::chrono::milliseconds GetDeliveryTimeout () const noexcept
void SetDeliveryTimeout (std::chrono::milliseconds timeout) noexcept
bool IsPublisherInitiated () const noexcept
 Check if the subscribe is publisher initiated or not.
Callbacks
virtual void ObjectReceived (const ObjectHeaders &object_headers, BytesSpan data)
 Notification of received [full] data object.
virtual void DgramDataRecv (std::shared_ptr< const std::vector< uint8_t > > data)
 Notification of received datagram data.
virtual void PartialObjectReceived (const ObjectHeaders &object_headers, BytesSpan data)
 Notification of a partial object received data object.
virtual void StatusChanged (Status status)
 Notification of subscribe status.
virtual void MetricsSampled (const SubscribeTrackMetrics &metrics)
 Notification callback to provide sampled metrics.

Static Public Member Functions

static std::shared_ptr< FetchTrackHandlerCreate (const FullTrackName &full_track_name, messages::SubscriberPriority priority, messages::GroupOrder group_order, messages::GroupId start_group, messages::GroupId end_group, messages::GroupId start_object, messages::GroupId end_object)
 Create shared Fetch track handler.
static std::shared_ptr< SubscribeTrackHandlerCreate (const FullTrackName &full_track_name, messages::SubscriberPriority priority, messages::GroupOrder group_order=messages::GroupOrder::kAscending, messages::FilterType filter_type=messages::FilterType::kLargestObject)
 Create shared Subscribe track handler.

Public Attributes

SubscribeTrackMetrics subscribe_track_metrics_
 Subscribe metrics for the track.

Protected Member Functions

 FetchTrackHandler (const FullTrackName &full_track_name, messages::SubscriberPriority priority, messages::GroupOrder group_order, messages::GroupId start_group, messages::GroupId end_group, messages::GroupId start_object, messages::GroupId end_object)
 Fetch track handler constructor.
void SetStatus (Status status) noexcept
 Set the subscribe status.

Protected Attributes

StreamBuffer< uint8_t > stream_buffer_
uint64_t next_object_id_ { 0 }
uint64_t current_group_id_ { 0 }
bool sent_first_object_ { false }

Detailed Description

Examples
client.cpp, and server.cpp.

Member Enumeration Documentation

◆ Error

enum class quicr::SubscribeTrackHandler::Error : uint8_t
stronginherited

Receive status codes.

Enumerator
kOk 
kNotAuthorized 
kNotSubscribed 
kNoData 

◆ Status

enum class quicr::SubscribeTrackHandler::Status : uint8_t
stronginherited

Status codes for the subscribe track.

Enumerator
kOk 
kNotConnected 
kError 
kNotAuthorized 
kNotSubscribed 
kPendingResponse 
kSendingUnsubscribe 

In this state, callbacks will not be called,.

kPaused 
kNewGroupRequested 

Constructor & Destructor Documentation

◆ FetchTrackHandler()

quicr::FetchTrackHandler::FetchTrackHandler ( const FullTrackName & full_track_name,
messages::SubscriberPriority priority,
messages::GroupOrder group_order,
messages::GroupId start_group,
messages::GroupId end_group,
messages::GroupId start_object,
messages::GroupId end_object )
inlineprotected

Fetch track handler constructor.

Parameters
full_track_nameFull track name struct.
priorityThe priority of the track.
group_orderThe group order to use.
start_groupThe starting group of the range.
end_groupThe final group in the range.
start_objectThe starting object in a group.
end_objectThe final object in a group.

Member Function Documentation

◆ Create() [1/2]

std::shared_ptr< FetchTrackHandler > quicr::FetchTrackHandler::Create ( const FullTrackName & full_track_name,
messages::SubscriberPriority priority,
messages::GroupOrder group_order,
messages::GroupId start_group,
messages::GroupId end_group,
messages::GroupId start_object,
messages::GroupId end_object )
inlinestatic

Create shared Fetch track handler.

Parameters
full_track_nameFull track name struct.
priorityThe priority of the track.
group_orderThe group order to use.
start_groupThe starting group of the range.
start_objectThe starting object in a group.
end_groupThe final group in the range.
end_objectThe final object in a group.
Returns
Shared pointer to a Fetch track handler.
Examples
client.cpp, and server.cpp.

◆ Create() [2/2]

std::shared_ptr< SubscribeTrackHandler > quicr::SubscribeTrackHandler::Create ( const FullTrackName & full_track_name,
messages::SubscriberPriority priority,
messages::GroupOrder group_order = messages::GroupOrder::kAscending,
messages::FilterType filter_type = messages::FilterType::kLargestObject )
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

◆ 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 pointer to the data received

◆ GetDeliveryTimeout()

std::chrono::milliseconds quicr::SubscribeTrackHandler::GetDeliveryTimeout ( ) const
inlinenoexceptinherited

◆ GetEndGroup()

const messages::GroupId & quicr::FetchTrackHandler::GetEndGroup ( ) const
inlineconstexprnoexcept

Get the id of the group one past the end of the Fetch range.

Returns
The ending group ID.

◆ GetEndObject()

const messages::GroupId & quicr::FetchTrackHandler::GetEndObject ( ) const
inlineconstexprnoexcept

Get the id of the object one past the end of the group range.

Returns
The ending object ID.

◆ GetFilterType()

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

Get subscription filter type.

Returns
FilterType value

◆ GetGroupOrder()

messages::GroupOrder quicr::SubscribeTrackHandler::GetGroupOrder ( ) const
inlineconstexprnoexceptinherited

Get subscription group order.

Returns
GroupOrder value

◆ GetJoiningFetch()

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

Get joining fetch info, if any.

◆ GetLatestLocation()

std::optional< messages::Location > quicr::SubscribeTrackHandler::GetLatestLocation ( ) const
inlineconstexprnoexceptinherited

◆ GetPriority()

messages::SubscriberPriority quicr::SubscribeTrackHandler::GetPriority ( ) const
inlineconstexprnoexceptinherited

Get subscription priority.

Returns
Priority value

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

◆ GetStartGroup()

const messages::GroupId & quicr::FetchTrackHandler::GetStartGroup ( ) const
inlineconstexprnoexcept

Get the starting group id of the Fetch range.

Returns
The starting group ID.

◆ GetStartObject()

const messages::GroupId & quicr::FetchTrackHandler::GetStartObject ( ) const
inlineconstexprnoexcept

Get the starting object id of the Group range.

Returns
The starting object ID.

◆ GetStatus()

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

Get the status of the subscribe.

Returns
Status of the subscribe

◆ 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.
Examples
client.cpp, and server.cpp.

◆ 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 ( const SubscribeTrackMetrics & metrics)
inlinevirtualinherited

Notification callback to provide sampled metrics.

Callback will be triggered on Config::metrics_sample_ms to provide the sampled data based on the sample period. After this callback, the period/sample based metrics will reset and start over for the new period.

Parameters
metricsCopy of the subscribed metrics for the sample period

◆ ObjectReceived()

virtual void quicr::SubscribeTrackHandler::ObjectReceived ( const ObjectHeaders & object_headers,
BytesSpan data )
virtualinherited

Notification of received [full] data object.

Event notification to provide the caller the received full data object

Warning
This data will be invalided after return of this method
Parameters
object_headersObject headers, must include group and object Ids
dataObject payload data received, MUST match ObjectHeaders::payload_length.
Examples
client.cpp, and server.cpp.

◆ PartialObjectReceived()

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

Notification of a partial object received data object.

Event notification to provide the caller the received data object

Warning
This data will be invalided after return of this method
Parameters
object_headersObject headers, must include group and object Ids
dataObject payload data received, can be <= ObjectHeaders::payload_length

◆ Pause()

void quicr::SubscribeTrackHandler::Pause ( )
noexceptinherited

Pause receiving data.

Pause will send a MoQT SUBSCRIBE_UPDATE to change the forwarding state to be stopped *

◆ RequestNewGroup()

void quicr::SubscribeTrackHandler::RequestNewGroup ( )
noexceptinherited

Generate a new group request for this subscription.

Examples
client.cpp, and server.cpp.

◆ Resume()

void quicr::SubscribeTrackHandler::Resume ( )
noexceptinherited

Resume receiving data.

Rresume will send a MoQT SUBSCRIBE_UPDATE to change the forwarding state to send

◆ SetDeliveryTimeout()

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

◆ SetLatestLocation()

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

◆ SetPriority()

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

Set the priority of received data.

Parameters
priorityPriority value of received data

◆ 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

◆ SetStatus()

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

Set the subscribe status.

Parameters
statusStatus of the subscribe

◆ 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

◆ StatusChanged()

virtual void quicr::SubscribeTrackHandler::StatusChanged ( Status status)
inlinevirtualinherited

Notification of subscribe status.

Notification of the subscribe status

Parameters
statusIndicates status of the subscribe
Examples
client.cpp, and server.cpp.

◆ StreamDataRecv()

void quicr::FetchTrackHandler::StreamDataRecv ( bool is_start,
uint64_t stream_id,
std::shared_ptr< const std::vector< uint8_t > > data )
overridevirtual

Notification of received stream data slice.

Event notification to provide the caller the raw data received on a stream

Parameters
is_startTrue to indicate if this data is the start of a new stream
stream_idStream ID data was received on
dataShared pointer to the data received

Reimplemented from quicr::SubscribeTrackHandler.

Member Data Documentation

◆ current_group_id_

uint64_t quicr::SubscribeTrackHandler::current_group_id_ { 0 }
protectedinherited

◆ next_object_id_

uint64_t quicr::SubscribeTrackHandler::next_object_id_ { 0 }
protectedinherited

◆ sent_first_object_

bool quicr::SubscribeTrackHandler::sent_first_object_ { false }
protectedinherited

◆ stream_buffer_

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

◆ subscribe_track_metrics_

SubscribeTrackMetrics quicr::SubscribeTrackHandler::subscribe_track_metrics_
inherited

Subscribe metrics for the track.

Subscribe metrics are updated real-time and transport quic metrics on metrics_sample_ms period.


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