|
LibQuicR
|
Common request state for track-related handlers. More...
#include <track_handler.h>
Classes | |
| struct | Binding |
Public Member Functions | |
| virtual | ~TrackHandler ()=default |
| Releases this handler; shared stream/session handles are released automatically. More... | |
| TrackHandler ()=delete | |
| A track identity is mandatory. 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 Reply< messages::Parameters, ErrorCode > | RequestUpdateReceived (const messages::Parameters ¶ms)=0 |
| Received an update for this handler's request. More... | |
| virtual void | RequestError (ErrorCode error_code, std::string reason) |
| Handles a REQUEST_ERROR for this handler. More... | |
Protected Member Functions | |
| TrackHandler (const FullTrackName &full_track_name) | |
| Constructs a handler for one full track name. More... | |
| virtual void | RequestOkReceived (const messages::Parameters ¶ms)=0 |
| Handles REQUEST_OK for this handler's request. 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 | |
| FullTrackName | full_track_name_ |
| Full track identity retained for the handler's lifetime. More... | |
| std::mutex | binding_operation_mutex_ |
Common request state for track-related handlers.
Handlers are intended to be managed by std::shared_ptr; Get() and session registration rely on shared ownership. Request stream access is synchronized, while most other fields are initialized or mutated by the session and are not generally thread-safe.
|
virtualdefault |
Releases this handler; shared stream/session handles are released automatically.
|
delete |
A track identity is mandatory.
|
inlineprotected |
Constructs a handler for one full track name.
| full_track_name | Track identity copied into the handler. |
|
inline |
Get the derived type of the track handler.
| T | Derived type of the track handler. |
T, or null when the dynamic type is incompatible. | std::bad_weak_ptr | if this object is not currently owned by a shared_ptr. |
|
inline |
| std::shared_ptr<Connection> quicr::TrackHandler::GetConnection | ( | ) | const |
|
inlinenoexcept |
Gets the transport connection identifier assigned by the session.
|
inlinenoexcept |
Get the full track name.
|
inlinenoexcept |
Get the request ID.
std::nullopt when none is assigned. | std::optional<uint64_t> quicr::TrackHandler::GetRequestStreamId | ( | ) | const |
Get the stream ID of the request control stream.
std::nullopt if no stream is attached.
|
protectednoexcept |
Gets the non-owning session handle.
|
virtual |
Handles a REQUEST_ERROR for this handler.
| error_code | Peer-provided request error code. |
| reason | Peer-provided reason, passed by value for optional retention. |
Reimplemented in quicr::TrackStatusHandler, quicr::SubscribeNamespaceHandler, and quicr::PublishNamespaceHandler.
|
protectedpure virtual |
Handles REQUEST_OK for this handler's request.
| params | Borrowed response parameters, valid only for this callback. |
| messages::ProtocolViolationException | when parameters violate the request contract. |
Implemented in quicr::TrackStatusHandler, quicr::SubscribeTrackHandler, quicr::SubscribeNamespaceHandler, quicr::PublishTrackHandler, and quicr::PublishNamespaceHandler.
|
pure virtual |
Received an update for this handler's request.
The session acknowledges the update with the returned reply: success sends REQUEST_UPDATE_OK with its parameters and failure sends REQUEST_ERROR. Reply::Resolve invokes a deferred producer synchronously, so the producer must start any slow authorization, I/O, or other asynchronous work itself. Completion is queued back through the transport. The request and its stream may disappear before deferred completion, in which case no response is sent.
| params | Borrowed updated parameters, valid only for this callback. |
| messages::ProtocolViolationException | if the update is invalid for this request. |
Implemented in quicr::TrackStatusHandler, quicr::SubscribeTrackHandler, quicr::SubscribeNamespaceHandler, quicr::PublishTrackHandler, and quicr::PublishNamespaceHandler.
|
inline |
Sets or clears the connection-scoped request ID.
| request_id | Request ID assigned by the session, or std::nullopt when unbound. |
|
protected |
Sets the session used for control and data operations.
| transport | Session retained weakly; passing null clears effective access. |
|
protected |
|
protected |
Full track identity retained for the handler's lifetime.