[v3,0/5] libcamera: controls: Move constructor/assignment + swap
mbox series

Message ID 20260903091843.85548-1-barnabas.pocze@ideasonboard.com
Headers show
Series
  • libcamera: controls: Move constructor/assignment + swap
Related show

Message

Barnabás Pőcze Sept. 3, 2026, 9:18 a.m. UTC
Implement move constructor / assignment operator for `ControlValue`
since the type already has an "empty" state that can be used for
this purpose. Also add `swap()` since that can also be implemented
more efficiently than the default move construction + 2 move assignment
that `std::swap()` implements. And lastly add an rvalue overload
for `ControlList::set()` to make use of move assignment.

changes in v3:
  * remove `type_` bitfield as well

changes in v2:
  * remove `numElements_` bit field to simplify swap
  * add `ControlList::set(unsigned int, ControlValue&&)` overload

v2: https://patchwork.libcamera.org/cover/23190/
v1: https://patchwork.libcamera.org/project/libcamera/list/?series=5131

Barnabás Pőcze (5):
  libcamera: controls: Give name to the union containing storage
  libcamera: controls: Remove bit fields
  libcamera: controls: Implement move ctor/assignment
  libcamera: controls: Implement `swap()`
  libcamera: controls: Add rvalue overload for `ControlList::set()`

 include/libcamera/controls.h | 49 +++++++++++++++++++++++++----
 src/libcamera/controls.cpp   | 61 +++++++++++++++++++++++++++++++-----
 2 files changed, 96 insertions(+), 14 deletions(-)

--
2.55.0