libcamera: base: object,thread: Disable copy/move

Objects of type `Object` and `Thread` have address identities, so they
should not be just moved/copied. And the special member functions
generated by the compiler do not do the right thing. So delete them.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze 2025-01-30 19:54:33 +00:00
parent 2ae569dad2
commit 9a7fce1b51
2 changed files with 6 additions and 0 deletions

View file

@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include <libcamera/base/bound_method.h> #include <libcamera/base/bound_method.h>
#include <libcamera/base/class.h>
namespace libcamera { namespace libcamera {
@ -52,6 +53,8 @@ protected:
bool assertThreadBound(const char *message); bool assertThreadBound(const char *message);
private: private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(Object)
friend class SignalBase; friend class SignalBase;
friend class Thread; friend class Thread;

View file

@ -13,6 +13,7 @@
#include <libcamera/base/private.h> #include <libcamera/base/private.h>
#include <libcamera/base/class.h>
#include <libcamera/base/message.h> #include <libcamera/base/message.h>
#include <libcamera/base/signal.h> #include <libcamera/base/signal.h>
#include <libcamera/base/span.h> #include <libcamera/base/span.h>
@ -54,6 +55,8 @@ protected:
virtual void run(); virtual void run();
private: private:
LIBCAMERA_DISABLE_COPY_AND_MOVE(Thread)
void startThread(); void startThread();
void finishThread(); void finishThread();