Sunshine master
Self-hosted game stream host for Moonlight.
safe::mail_raw_t Class Reference

Mailbox backing store for events, queues, and posted cleanup objects. More...

#include <src/thread_safe.h>

Inheritance diagram for safe::mail_raw_t:
[legend]
Collaboration diagram for safe::mail_raw_t:
[legend]

Public Types

template<class T >
using event_t = std::shared_ptr<post_t<event_t<T>>>
 Mailbox-backed event wrapper for a typed value.
 
template<class T >
using queue_t = std::shared_ptr<post_t<queue_t<T>>>
 Mailbox-backed queue wrapper for typed messages.
 

Public Member Functions

void cleanup ()
 Run cleanup for completed asynchronous work.
 
template<class T >
event_t< T > event (const std::string_view &id)
 Create a typed event channel from the raw mailbox.
 
template<class T >
queue_t< T > queue (const std::string_view &id)
 Create a typed queue channel from the raw mailbox.
 

Public Attributes

std::map< std::string, std::weak_ptr< void >, std::less<> > id_to_post
 Posted objects keyed by cleanup identifier.
 
std::mutex mutex
 Mutex protecting the map of live posted objects.
 

Detailed Description

Mailbox backing store for events, queues, and posted cleanup objects.

Member Function Documentation

◆ event()

template<class T >
event_t< T > safe::mail_raw_t::event ( const std::string_view & id)
inline

Create a typed event channel from the raw mailbox.

Parameters
idIdentifier for the controller, session, display, or resource.
Returns
Typed event channel associated with the supplied identifier.

◆ queue()

template<class T >
queue_t< T > safe::mail_raw_t::queue ( const std::string_view & id)
inline

Create a typed queue channel from the raw mailbox.

Parameters
idIdentifier for the controller, session, display, or resource.
Returns
Typed queue channel associated with the supplied identifier.

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