mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-17 01:15:06 +03:00
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>
This commit is contained in:
parent
640f48d603
commit
f9c0cf2a3a
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue