MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::Mailbox Class Reference

#include <mailbox.hpp>

Inheritance diagram for mbgl::Mailbox:

Public Member Functions

 Mailbox ()
 
 Mailbox (Scheduler &)
 
void open (Scheduler &scheduler_)
 
void close ()
 
bool isOpen () const
 
void push (std::unique_ptr< Message >)
 
void receive ()
 

Static Public Member Functions

static void maybeReceive (const std::weak_ptr< Mailbox > &)
 
static std::function< void()> makeClosure (std::weak_ptr< Mailbox >)
 

Detailed Description

Definition at line 15 of file mailbox.hpp.

Constructor & Destructor Documentation

◆ Mailbox() [1/2]

mbgl::Mailbox::Mailbox ( )

Create a "holding" mailbox, messages to which will remain queued, unconsumed, until the mailbox is associated with a Scheduler using start(). This allows a Mailbox object to be created on one thread and later transferred to a different target thread that may not yet exist.

◆ Mailbox() [2/2]

mbgl::Mailbox::Mailbox ( Scheduler )

Member Function Documentation

◆ close()

void mbgl::Mailbox::close ( )

◆ isOpen()

bool mbgl::Mailbox::isOpen ( ) const

◆ makeClosure()

static std::function<void()> mbgl::Mailbox::makeClosure ( std::weak_ptr< Mailbox )
static

◆ maybeReceive()

static void mbgl::Mailbox::maybeReceive ( const std::weak_ptr< Mailbox > &  )
static

◆ open()

void mbgl::Mailbox::open ( Scheduler scheduler_)

Attach the given scheduler to this mailbox and begin processing messages sent to it. The mailbox must be a "holding" mailbox, as created by the default constructor Mailbox().

◆ push()

void mbgl::Mailbox::push ( std::unique_ptr< Message )

◆ receive()

void mbgl::Mailbox::receive ( )

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