message.h File Reference

Message queue support. More...

`#include <atomic>`
`#include <libcamera/bound_method.h>`

Go to the source code of this file.

## Classes

class | libcamera::Message
| A message that can be posted to a Thread. More...
class | libcamera::InvokeMessage
| A message carrying a method invocation across threads. More...

## Detailed Description

Message queue support.

The messaging API enables inter-thread communication through message posting. Messages can be sent from any thread to any recipient deriving from the Object class.

To post a message, the sender allocates it dynamically as instance of a class derived from Message. It then posts the message to an Object recipient through Object::postMessage(). Message ownership is passed to the object, thus the message shall not store any temporary data.

The message is delivered in the context of the object's thread, through the Object::message() virtual method. After delivery the message is automatically deleted.