[libcamera-devel,0/4] Object lifetime management
mbox series

Message ID 20190117235916.1906-1-laurent.pinchart@ideasonboard.com
Headers show
Series
  • Object lifetime management
Related show

Message

Laurent Pinchart Jan. 17, 2019, 11:59 p.m. UTC
Hello,

This patch series sets the foundations for object lifetime management in
libcamera. This is a complex topic that I expect will involve over time,
so this is in no way considered as complete and set-in-stone code.

Patch 1/4 documents the object lifetime management concept and
associated coding rules. Patches 2/4 then applies those rules to the
event dispatcher registration in CameraManager through
std::unique_ptr<>.

The last two patches apply the lifetime management rules to the Camera
objects, with patch 3/4 reworking how camera are registered to simplify
the code, and patch 4/4 implementing lifetime management through
std::shared_ptr<>.

Laurent Pinchart (4):
  Documentation: coding_style: Add object ownership rules
  libcamera: camera_manager: Use std::unique_ptr to store event
    dispatcher
  libcamera: camera_manager: Register cameras with the camera manager
  libcamera: camera: Handle camera objects through shared pointers

 Documentation/coding-style.rst           | 62 +++++++++++++++++++++
 include/libcamera/camera.h               | 13 +++--
 include/libcamera/camera_manager.h       | 11 ++--
 src/libcamera/camera.cpp                 | 46 ++++++++-------
 src/libcamera/camera_manager.cpp         | 71 ++++++++++++------------
 src/libcamera/include/pipeline_handler.h |  6 +-
 src/libcamera/pipeline/vimc.cpp          | 30 ++--------
 src/libcamera/pipeline_handler.cpp       | 21 ++-----
 test/list-cameras.cpp                    |  5 +-
 9 files changed, 153 insertions(+), 112 deletions(-)