Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::midi::PeSubscriptionManager Class Reference

Authoritative subscription registry on the responder side. More...

#include <midi_ci_pe.hpp>

Public Member Functions

std::string subscribe (std::string_view resource, MUID subscriber)
 NOT RT-safe — allocates a new PeSubscription (two std::strings), pushes onto subs_, and builds the returned subscription id via std::to_string.
bool unsubscribe (std::string_view subscription_id)
 NOT RT-safe — linear scan + std::vector::erase.
std::vector< PeSubscription > subscribers_of (std::string_view resource) const
 NOT RT-safe — allocates the result std::vector<PeSubscription>, even when the call ends up empty (the return value still owns a 0-capacity vector header).
const std::vector< PeSubscription > & all () const
 Non-owning live view of the registry.

Detailed Description

Authoritative subscription registry on the responder side.

Lifecycle:

  • subscribe(resource, peer) returns a new subscription id and records the binding.
  • unsubscribe(id) removes it.
  • subscribers_of(resource) is used by the responder when a resource changes to fan out Notify messages.

RT-safety contract: every mutating method allocates; subscribers_of() allocates a fresh result vector even when nothing matches. Drive the manager from the same non-RT thread that drives PE message dispatch.

Member Function Documentation

◆ all()

const std::vector< PeSubscription > & pulp::midi::PeSubscriptionManager::all ( ) const
inline

Non-owning live view of the registry.

No allocation, but not RT-safe: callers must use it from the same non-audio thread that owns subscription mutation.

◆ subscribe()

std::string pulp::midi::PeSubscriptionManager::subscribe ( std::string_view resource,
MUID subscriber )

NOT RT-safe — allocates a new PeSubscription (two std::strings), pushes onto subs_, and builds the returned subscription id via std::to_string.

◆ subscribers_of()

std::vector< PeSubscription > pulp::midi::PeSubscriptionManager::subscribers_of ( std::string_view resource) const

NOT RT-safe — allocates the result std::vector<PeSubscription>, even when the call ends up empty (the return value still owns a 0-capacity vector header).

Use it from the same non-audio thread that drives PE message dispatch.

◆ unsubscribe()

bool pulp::midi::PeSubscriptionManager::unsubscribe ( std::string_view subscription_id)

NOT RT-safe — linear scan + std::vector::erase.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/midi/include/pulp/midi/midi_ci_pe.hpp