From ef5f5c4db05e5d88d58b0d565f7716c59751b991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Thu, 6 Aug 2020 14:32:33 +0200 Subject: libcamera: pipeline_handler: Add const version of cameraData() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a version of cameraData() that returns a const pointer and mark it as a const operation. The assert in the non-const version of the function already enforces that a std::map::at() operation would always succeed so there is no change in operation from the non-const version. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- src/libcamera/pipeline_handler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/libcamera/pipeline_handler.cpp') diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index ccd45edc..73c51972 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -601,6 +601,19 @@ CameraData *PipelineHandler::cameraData(const Camera *camera) return cameraData_[camera].get(); } +/** + * \brief Retrieve the pipeline-specific data associated with a Camera + * \param[in] camera The camera whose data to retrieve + * \sa cameraData() + * \return A const pointer to the pipeline-specific data passed to + * registerCamera(). + */ +const CameraData *PipelineHandler::cameraData(const Camera *camera) const +{ + ASSERT(cameraData_.count(camera)); + return cameraData_.at(camera).get(); +} + /** * \var PipelineHandler::manager_ * \brief The Camera manager associated with the pipeline handler -- cgit v1.2.1