|
LibQuicR
|
Receives namespace or track publication notifications below a prefix. More...
#include <subscribe_namespace_handler.h>
Public Types | |
| enum class | Mode { kNamespaces , kTracks } |
| Selects which notification family the peer sends for the prefix. More... | |
| enum class | Status : uint8_t { kOk = 0 , kNotSubscribed , kError } |
| Status codes for the subscribe track. More... | |
Public Member Functions | |
| virtual | ~SubscribeNamespaceHandler () |
| Destroys the handler; destruction currently sends no protocol message. More... | |
| virtual void | StatusChanged (Status status) |
| Notification of subscribe status. More... | |
| const TrackNamespace & | GetPrefix () const noexcept |
| messages::FilterType | GetFilterType () const noexcept |
| constexpr const messages::Filter & | GetFilter () const noexcept |
| constexpr Status | GetStatus () const noexcept |
| Get the status of the subscribe. More... | |
| std::optional< Error< ErrorCode > > | GetError () const noexcept |
| Get the error code and reason for the subscribe namespace, if any. More... | |
| constexpr Mode | GetMode () const noexcept |
| Get the mode this handler is operating in. More... | |
| TrackNamespace | ExpandSuffix (const TrackNamespace &suffix) const |
| Fully qualifies a NAMESPACE suffix relative to the subscribed prefix. 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 |
Static Public Member Functions | |
| static auto | Create (const TrackNamespace &prefix, const Mode mode, const messages::Filter &filter=std::monostate{}) |
| Creates a namespace subscription with shared ownership. More... | |
Protected Member Functions | |
| SubscribeNamespaceHandler (const TrackNamespace &prefix, Mode mode, const messages::Filter &filter=std::monostate{}) | |
| Constructs a namespace subscription. More... | |
| virtual void | NamespaceReceived ([[maybe_unused]] const TrackNamespace &name_space) |
Reports a NAMESPACE notification in kNamespaces mode. More... | |
| virtual void | NamespaceDoneReceived ([[maybe_unused]] const TrackNamespace &name_space) |
Reports a NAMESPACE_DONE notification in kNamespaces mode. More... | |
| void | SetStatus (const Status status) noexcept |
| Set the subscribe status. More... | |
| void | SetError (const Error< ErrorCode > &error) |
Stores an error and transitions to kError. More... | |
| void | RequestOkReceived (const messages::Parameters ¶ms) override |
Handles acceptance by validating empty parameters and entering kOk. More... | |
| Reply< messages::Parameters, ErrorCode > | RequestUpdateReceived (const messages::Parameters ¶ms) override |
| Rejects updates to a namespace subscription. More... | |
| void | RequestError (ErrorCode error_code, std::string reason) override |
Stores a request error and enters kError. 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_ |
Receives namespace or track publication notifications below a prefix.
Create the handler, customize its protected callbacks in a derived class, and pass it to the session. Callback and status mutation occur on session processing paths; getters are not synchronized with those callbacks.
|
strong |
|
strong |
Status codes for the subscribe track.
| Enumerator | |
|---|---|
| kOk | The peer accepted the subscription. |
| kNotSubscribed | Initial state; no active namespace subscription. |
| kError | The peer or library rejected the request; inspect |
|
protected |
Constructs a namespace subscription.
| prefix | Namespace prefix against which notifications are matched. |
| mode | Kind of notification to receive. |
| filter | Protocol filter sent with the subscription. |
|
virtual |
Destroys the handler; destruction currently sends no protocol message.
|
inlinestatic |
Creates a namespace subscription with shared ownership.
| prefix | Namespace prefix against which notifications are matched. |
| mode | Kind of notification to receive. |
| filter | Protocol filter sent with the subscription. |
| TrackNamespace quicr::SubscribeNamespaceHandler::ExpandSuffix | ( | const TrackNamespace & | suffix | ) | const |
Fully qualifies a NAMESPACE suffix relative to the subscribed prefix.
| suffix | Relative namespace entries received from the peer. |
|
inlineinherited |
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. |
|
inlineinherited |
|
inherited |
|
inlinenoexceptinherited |
Gets the transport connection identifier assigned by the session.
|
inlinenoexcept |
Get the error code and reason for the subscribe namespace, if any.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
GetFilter().
|
inlinenoexceptinherited |
Get the full track name.
|
inlineconstexprnoexcept |
Get the mode this handler is operating in.
|
inlinenoexcept |
|
inlinenoexceptinherited |
Get the request ID.
std::nullopt when none is assigned.
|
inherited |
Get the stream ID of the request control stream.
std::nullopt if no stream is attached.
|
protectednoexceptinherited |
Gets the non-owning session handle.
|
inlineconstexprnoexcept |
Get the status of the subscribe.
|
inlineprotectedvirtual |
Reports a NAMESPACE_DONE notification in kNamespaces mode.
| name_space | Namespace relative to GetPrefix(). |
|
inlineprotectedvirtual |
Reports a NAMESPACE notification in kNamespaces mode.
| name_space | Namespace relative to GetPrefix(); use ExpandSuffix() to qualify it. |
|
inlineoverrideprotectedvirtual |
Stores a request error and enters kError.
| error_code | Peer-provided error code. |
| reason | Peer-provided reason, moved into the stored error. |
Reimplemented from quicr::TrackHandler.
|
overrideprotectedvirtual |
Handles acceptance by validating empty parameters and entering kOk.
| params | Response parameters, which must be empty. |
| messages::ProtocolViolationException | if unsupported parameters are present. |
Implements quicr::TrackHandler.
|
overrideprotectedvirtual |
Rejects updates to a namespace subscription.
| params | Unused update parameters. |
| messages::ProtocolViolationException | Always. |
Implements quicr::TrackHandler.
Stores an error and transitions to kError.
| error | Error code and optional reason, copied into the handler. |
|
inlineinherited |
Sets or clears the connection-scoped request ID.
| request_id | Request ID assigned by the session, or std::nullopt when unbound. |
|
inlineprotectednoexcept |
Set the subscribe status.
| status | Status of the subscribe |
Entering kError without a preceding SetError() installs an internal-error fallback, then invokes StatusChanged even if the value did not change.
|
protectedinherited |
Sets the session used for control and data operations.
| transport | Session retained weakly; passing null clears effective access. |
|
virtual |
Notification of subscribe status.
Notification of the subscribe status
| status | Indicates status of the subscribe |
|
protectedinherited |
|
protectedinherited |
Full track identity retained for the handler's lifetime.