libcamera: include/libcamera/base/message.h File Reference

libcamera v0.5.1 Supporting cameras in Linux since 2019 |

Loading...
Searching...
No Matches
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.

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

## Namespaces
namespace | libcamera
| 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.