From 1554d0b6e645da7b3345436f8c7264823cbe0151 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 12 Aug 2019 14:37:38 +0300 Subject: libcamera: Add parent argument to constructors of Object-derived classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that the Object class implements parent-child relationships, make it possible to create EventNotifier and Timer instances with a parent by adding a parent argument to their constructors. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/event_notifier.cpp | 5 +++-- src/libcamera/timer.cpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/libcamera') diff --git a/src/libcamera/event_notifier.cpp b/src/libcamera/event_notifier.cpp index 96be2760..687969b0 100644 --- a/src/libcamera/event_notifier.cpp +++ b/src/libcamera/event_notifier.cpp @@ -61,9 +61,10 @@ namespace libcamera { * \brief Construct an event notifier with a file descriptor and event type * \param[in] fd The file descriptor to monitor * \param[in] type The event type to monitor + * \param[in] parent The parent Object */ -EventNotifier::EventNotifier(int fd, Type type) - : fd_(fd), type_(type), enabled_(false) +EventNotifier::EventNotifier(int fd, Type type, Object *parent) + : Object(parent), fd_(fd), type_(type), enabled_(false) { setEnabled(true); } diff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp index f45061d4..c61d77e5 100644 --- a/src/libcamera/timer.cpp +++ b/src/libcamera/timer.cpp @@ -39,9 +39,10 @@ LOG_DEFINE_CATEGORY(Timer) /** * \brief Construct a timer + * \param[in] parent The parent Object */ -Timer::Timer() - : interval_(0), deadline_(0) +Timer::Timer(Object *parent) + : Object(parent), interval_(0), deadline_(0) { } -- cgit v1.2.1