summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-22 14:35:12 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-02-12 14:35:21 +0000
commitf9c0cf2a3a32ff9306da9931218909fa222e8295 (patch)
treef6c65279e3ffa966aae9b59a3590650cb8d2b024 /include
parent640f48d60399fe63f549f6cb5fa8623a6b6b2810 (diff)
libcamera: MappedBuffer: Disable copy and assignment
MappedBuffers have a custom move constructor and assignment operator to ensure that memory is not unmapped during object manipulation. Because of the user-defined move constructor, the implicitly-declared copy-constructor will already be deleted, however delete it explicitly to help readability of the code, and make it clear that the object can not be copied. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/internal/buffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libcamera/internal/buffer.h b/include/libcamera/internal/buffer.h
index b7b0173f..9da1fbd1 100644
--- a/include/libcamera/internal/buffer.h
+++ b/include/libcamera/internal/buffer.h
@@ -10,6 +10,7 @@
#include <sys/mman.h>
#include <vector>
+#include <libcamera/class.h>
#include <libcamera/buffer.h>
#include <libcamera/span.h>
@@ -34,6 +35,9 @@ protected:
int error_;
std::vector<Plane> maps_;
+
+private:
+ LIBCAMERA_DISABLE_COPY(MappedBuffer)
};
class MappedFrameBuffer : public MappedBuffer