[libcamera-devel] [PATCH v3 0/4] libcamera: Implement d-pointer design pattern

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Nov 3 02:02:47 CET 2020


Hello,

This patch series implements the d-pointer design pattern in a base
class, generalizing the custom implementations from the Camera and
CameraManager classes. This was mostly developed as a base for the
reprocessing API (the reworked camera configuration API will make use of
d-pointers), but I believe it makes sense on its own.

The series is quite straightforward. Patch 1/4 adds a formatter to
checkstyle.py to ensure consistent naming of variables related to this
design pattern. This stems from patch 2/4, which implements the
framework, not hiding variable declarations in the LIBCAMERA_D_PTR() and
LIBCAMERA_O_PTR() macros anymore. Patches 4/5 and 5/5 replace the manual
implementations. Please see individual patches for details.

Laurent Pinchart (4):
  utils: checkstyle.py: Add d-pointer formatter
  libcamera: Add a base class to implement the d-pointer design pattern
  libcamera: camera_manager: Inherit from Extensible
  libcamera: camera: Inherit from Extensible

 include/libcamera/camera.h         |   9 +-
 include/libcamera/camera_manager.h |   7 +-
 include/libcamera/extensible.h     |  87 +++++++++++++++++++
 include/libcamera/meson.build      |   1 +
 src/libcamera/camera.cpp           | 123 +++++++++++++++-----------
 src/libcamera/camera_manager.cpp   |  55 +++++++-----
 src/libcamera/extensible.cpp       | 134 +++++++++++++++++++++++++++++
 src/libcamera/meson.build          |   1 +
 utils/checkstyle.py                |  32 +++++++
 9 files changed, 373 insertions(+), 76 deletions(-)
 create mode 100644 include/libcamera/extensible.h
 create mode 100644 src/libcamera/extensible.cpp

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list