libcamera  v0.4.0
Supporting cameras in Linux since 2019
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
libcamera::Message Class Reference

A message that can be posted to a Thread. More...

Inheritance diagram for libcamera::Message:
Inheritance graph
[legend]

Public Types

enum  Type {
  None = 0, InvokeMessage = 1, ThreadMoveMessage = 2, DeferredDelete = 3,
  UserMessage = 1000
}
 The message type. More...
 

Public Member Functions

 Message (Type type)
 Construct a message object of type type. More...
 
Type type () const
 Retrieve the message type. More...
 
Objectreceiver () const
 Retrieve the message receiver. More...
 

Static Public Member Functions

static Type registerMessageType ()
 Reserve and register a custom user-defined message type. More...
 

Friends

class Thread
 

Detailed Description

A message that can be posted to a Thread.

Member Enumeration Documentation

◆ Type

The message type.

Enumerator
None 

Invalid message type.

InvokeMessage 

Asynchronous method invocation across threads.

ThreadMoveMessage 

Object is being moved to a different thread.

DeferredDelete 

Object is scheduled for deletion.

UserMessage 

First value available for user-defined messages.

Constructor & Destructor Documentation

◆ Message()

libcamera::Message::Message ( Message::Type  type)

Construct a message object of type type.

Parameters
[in]typeThe message type

Member Function Documentation

◆ receiver()

libcamera::Message::receiver ( ) const
inline

Retrieve the message receiver.

Returns
The message receiver

◆ registerMessageType()

Message::Type libcamera::Message::registerMessageType ( )
static

Reserve and register a custom user-defined message type.

Custom message types use values starting at Message::UserMessage. Assigning custom types manually may lead to accidental duplicated types. To avoid this problem, this function reserves and returns the next available user-defined message type.

The recommended way to use this function is to subclass Message and provide a static accessor for the custom message type.

class MyCustomMessage : public Message
{
public:
MyCustomMessage() : Message(type()) {}
{
static MessageType type = registerMessageType();
return type;
}
};
Returns
A new unique message type

◆ type()

libcamera::Message::type ( ) const
inline

Retrieve the message type.

Returns
The message type

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