libcamera  v0.2.0+85-1c5830a9
Supporting cameras in Linux since 2019
Classes | Namespaces
message.h File Reference

Message queue support. More...

#include <atomic>
#include <libcamera/base/private.h>
#include <libcamera/base/bound_method.h>
Include dependency graph for message.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


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...


 Top-level libcamera namespace.

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 function. After delivery the message is automatically deleted.