diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-01-19 19:33:11 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2024-01-25 02:38:59 +0200 |
commit | d5c9b726bd86c44eac17dfec461d02771c22e101 (patch) | |
tree | 3385d98de077272a8ae434d0744486051c49332c | |
parent | fc4ded714dc0aafa0ad28d532c5f5f74b4cddd16 (diff) |
libcamera: signal: Replace object.h inclusion with forward declatation
The signal.h header doesn't need to include object.h. Replace it with a
forward declaration, and instead include object.h in source files that
require it. It can speed up compilation a little bit, but more
importantly avoids unintended dependencies from the Signal class to the
Object class to be added later as the compiler will catch them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Milan Zamazal <mzamazal@redhat.com>
-rw-r--r-- | include/libcamera/base/signal.h | 3 | ||||
-rw-r--r-- | src/libcamera/base/bound_method.cpp | 1 | ||||
-rw-r--r-- | src/libcamera/base/signal.cpp | 1 | ||||
-rw-r--r-- | src/libcamera/base/thread.cpp | 1 | ||||
-rw-r--r-- | test/event-thread.cpp | 1 | ||||
-rw-r--r-- | test/ipa/ipa_interface_test.cpp | 1 | ||||
-rw-r--r-- | test/message.cpp | 1 | ||||
-rw-r--r-- | test/signal-threads.cpp | 1 | ||||
-rw-r--r-- | test/timer-thread.cpp | 1 | ||||
-rw-r--r-- | utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl | 1 |
10 files changed, 11 insertions, 1 deletions
diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h index 841e4b4c..444997b4 100644 --- a/include/libcamera/base/signal.h +++ b/include/libcamera/base/signal.h @@ -13,10 +13,11 @@ #include <vector> #include <libcamera/base/bound_method.h> -#include <libcamera/base/object.h> namespace libcamera { +class Object; + class SignalBase { public: diff --git a/src/libcamera/base/bound_method.cpp b/src/libcamera/base/bound_method.cpp index 3ecec51c..c83d623f 100644 --- a/src/libcamera/base/bound_method.cpp +++ b/src/libcamera/base/bound_method.cpp @@ -7,6 +7,7 @@ #include <libcamera/base/bound_method.h> #include <libcamera/base/message.h> +#include <libcamera/base/object.h> #include <libcamera/base/semaphore.h> #include <libcamera/base/thread.h> diff --git a/src/libcamera/base/signal.cpp b/src/libcamera/base/signal.cpp index 02290ad7..f1018b37 100644 --- a/src/libcamera/base/signal.cpp +++ b/src/libcamera/base/signal.cpp @@ -8,6 +8,7 @@ #include <libcamera/base/signal.h> #include <libcamera/base/mutex.h> +#include <libcamera/base/object.h> /** * \file base/signal.h diff --git a/src/libcamera/base/thread.cpp b/src/libcamera/base/thread.cpp index b96951ac..75693c92 100644 --- a/src/libcamera/base/thread.cpp +++ b/src/libcamera/base/thread.cpp @@ -18,6 +18,7 @@ #include <libcamera/base/log.h> #include <libcamera/base/message.h> #include <libcamera/base/mutex.h> +#include <libcamera/base/object.h> /** * \page thread Thread Support diff --git a/test/event-thread.cpp b/test/event-thread.cpp index ef8a52c3..88a8c07e 100644 --- a/test/event-thread.cpp +++ b/test/event-thread.cpp @@ -11,6 +11,7 @@ #include <unistd.h> #include <libcamera/base/event_notifier.h> +#include <libcamera/base/object.h> #include <libcamera/base/thread.h> #include <libcamera/base/timer.h> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index 051ef96e..56f3cd6d 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -16,6 +16,7 @@ #include <libcamera/base/event_dispatcher.h> #include <libcamera/base/event_notifier.h> +#include <libcamera/base/object.h> #include <libcamera/base/thread.h> #include <libcamera/base/timer.h> diff --git a/test/message.cpp b/test/message.cpp index d148a13d..0e76f323 100644 --- a/test/message.cpp +++ b/test/message.cpp @@ -11,6 +11,7 @@ #include <thread> #include <libcamera/base/message.h> +#include <libcamera/base/object.h> #include <libcamera/base/thread.h> #include "test.h" diff --git a/test/signal-threads.cpp b/test/signal-threads.cpp index d5e2eb66..8c550eb0 100644 --- a/test/signal-threads.cpp +++ b/test/signal-threads.cpp @@ -10,6 +10,7 @@ #include <thread> #include <libcamera/base/message.h> +#include <libcamera/base/object.h> #include <libcamera/base/thread.h> #include <libcamera/base/utils.h> diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp index 61821753..0bcd0d8c 100644 --- a/test/timer-thread.cpp +++ b/test/timer-thread.cpp @@ -9,6 +9,7 @@ #include <iostream> #include <libcamera/base/event_dispatcher.h> +#include <libcamera/base/object.h> #include <libcamera/base/thread.h> #include <libcamera/base/timer.h> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl index ed270f5c..6e823598 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl @@ -18,6 +18,7 @@ #include <libcamera/ipa/ipa_interface.h> #include <libcamera/ipa/{{module_name}}_ipa_interface.h> +#include <libcamera/base/object.h> #include <libcamera/base/thread.h> #include "libcamera/internal/control_serializer.h" |