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
href='#n107'>107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297