diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-07-15 07:59:35 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-07-16 10:55:27 +0300 |
commit | fae053307dcc6807dd8ab127294c1fe5c5bb2d72 (patch) | |
tree | 90df0625ef86a0552d382e0211ea18535d687fb5 /src/libcamera/include/message.h | |
parent | 3e29a2d520c9cb8c7b290574bceaadcc107678fa (diff) |
libcamera: message: Add user message types
Reserve identifiers for user-defined message types and add an operation
to the Message class to register the type identifiers.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/libcamera/include/message.h')
-rw-r--r-- | src/libcamera/include/message.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcamera/include/message.h b/src/libcamera/include/message.h index db17d647..416fe74b 100644 --- a/src/libcamera/include/message.h +++ b/src/libcamera/include/message.h @@ -7,6 +7,8 @@ #ifndef __LIBCAMERA_MESSAGE_H__ #define __LIBCAMERA_MESSAGE_H__ +#include <atomic> + namespace libcamera { class Object; @@ -19,6 +21,7 @@ public: enum Type { None = 0, SignalMessage = 1, + UserMessage = 1000, }; Message(Type type); @@ -27,11 +30,15 @@ public: Type type() const { return type_; } Object *receiver() const { return receiver_; } + static Type registerMessageType(); + private: friend class Thread; Type type_; Object *receiver_; + + static std::atomic_uint nextUserType_; }; class SignalMessage : public Message |