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
}
 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.
 
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::ObjectPriority 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::GroupId > GetLatestGroupID () const noexcept
 
constexpr std::optional< messages::ObjectId > GetLatestObjectID () const noexcept
 
constexpr void SetLatestGroupID (messages::GroupId new_id) noexcept
 
constexpr void SetLatestObjectID (messages::ObjectId new_id) noexcept
 
Callbacks
virtual void ObjectReceived (const ObjectHeaders &object_headers, BytesSpan data)
 Notification of received [full] data object.
 
virtual void StreamDataRecv (bool is_start, uint64_t stream_id, std::shared_ptr< const std::vector< uint8_t > > data)
 Notification of received stream data slice.
 
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.
 
void RequestNewGroup () noexcept
 

Static Public Member Functions

static std::shared_ptr< FetchTrackHandlerCreate (const FullTrackName &full_track_name, messages::ObjectPriority 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::ObjectPriority priority, messages::GroupOrder group_order=messages::GroupOrder::kAscending, messages::FilterType filter_type=messages::FilterType::kLatestObject)
 Create shared Subscribe track handler.
 

Public Attributes

SubscribeTrackMetrics subscribe_track_metrics_
 Subscribe metrics for the track.
 
std::function< void(messages::SubscribeId, messages::TrackAlias)> new_group_request_callback_
 

Protected Member Functions

 FetchTrackHandler (const FullTrackName &full_track_name, messages::ObjectPriority 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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FetchTrackHandler()

quicr::FetchTrackHandler::FetchTrackHandler ( const FullTrackName & full_track_name,
messages::ObjectPriority 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]

static std::shared_ptr< FetchTrackHandler > quicr::FetchTrackHandler::Create ( const FullTrackName & full_track_name,
messages::ObjectPriority 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.

◆ Create() [2/2]

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

◆ 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

◆ GetLatestGroupID()

std::optional< messages::GroupId > quicr::SubscribeTrackHandler::GetLatestGroupID ( ) const
inlineconstexprnoexceptinherited

◆ GetLatestObjectID()

std::optional< messages::ObjectId > quicr::SubscribeTrackHandler::GetLatestObjectID ( ) const
inlineconstexprnoexceptinherited

◆ GetPriority()

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

Get subscription priority.

Returns
Priority value

◆ 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

◆ 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

◆ RequestNewGroup()

void quicr::SubscribeTrackHandler::RequestNewGroup ( )
noexceptinherited

◆ SetLatestGroupID()

void quicr::SubscribeTrackHandler::SetLatestGroupID ( messages::GroupId new_id)
inlineconstexprnoexceptinherited

◆ SetLatestObjectID()

void quicr::SubscribeTrackHandler::SetLatestObjectID ( messages::ObjectId new_id)
inlineconstexprnoexceptinherited

◆ SetPriority()

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

Set the priority of received data.

Parameters
priorityPriority value of received data

◆ SetStatus()

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

Set the subscribe status.

Parameters
statusStatus of the subscribe

◆ 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()

virtual void quicr::SubscribeTrackHandler::StreamDataRecv ( bool is_start,
uint64_t stream_id,
std::shared_ptr< const std::vector< uint8_t > > data )
virtualinherited

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

Member Data Documentation

◆ new_group_request_callback_

std::function<void(messages::SubscribeId, messages::TrackAlias)> quicr::SubscribeTrackHandler::new_group_request_callback_
inherited

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