[libcamera-devel] [PATCH 1/6] libcamera: object: Define message invocation type

Jacopo Mondi jacopo at jmondi.org
Sun Oct 27 21:33:30 CET 2019


Define an enumeration of invocation types to be used to describe the
delivery method of messages through the Object::invokeMethod operation.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 include/libcamera/object.h |  7 +++++++
 src/libcamera/object.cpp   | 27 +++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/include/libcamera/object.h b/include/libcamera/object.h
index 3308330af857..017d3f8aa915 100644
--- a/include/libcamera/object.h
+++ b/include/libcamera/object.h
@@ -21,6 +21,13 @@ class Signal;
 class SignalBase;
 class Thread;
 
+enum InvocationType {
+	InvocationTypeAuto,
+	InvocationTypeDirect,
+	InvocationTypeQueued,
+	InvocationTypeBlocking,
+};
+
 class Object
 {
 public:
diff --git a/src/libcamera/object.cpp b/src/libcamera/object.cpp
index 98aa0af2f9b9..82df3893d052 100644
--- a/src/libcamera/object.cpp
+++ b/src/libcamera/object.cpp
@@ -25,6 +25,33 @@ namespace libcamera {
 
 LOG_DEFINE_CATEGORY(Object)
 
+/**
+ * \enum InvocationType
+ * \brief Method invocation type
+ *
+ * This enumeration describes the possible methods invocation types
+ * that can be used to invoke methods on an Object running in a different
+ * execution context.
+ *
+ * Method invocation is performed by appending an InvokeMessage message to the
+ * receiver's message queue. This enumeration defines how the caller behaves
+ * once the message has been delivered to the receiver's queue.
+ *
+ * \var InvocationType::InvocationTypeAuto
+ * \brief === I'm not sure how we would use this for method invocation ===
+ *
+ * \var InvocationType::InvocationTypeDirect
+ * \brief === I'm not sure how we would use this for method invocation ===
+ *
+ * \var InvocationType::InvocationTypeQueued
+ * \brief The method is invoked on the Object and the caller immediately returns
+ * as soon as the message is queued to the receiver's message queue
+ *
+ * \var InvocationType::InvocationTypeBlocking
+ * \brief The method is invoked on the Object and the caller is blocked until
+ * the called method is not executed
+ */
+
 /**
  * \class Object
  * \brief Base object to support automatic signal disconnection
-- 
2.23.0



More information about the libcamera-devel mailing list