@@ -23,7 +23,7 @@ public:
Exception,
};
- EventNotifier(int fd, Type type);
+ EventNotifier(int fd, Type type, Object *parent = nullptr);
virtual ~EventNotifier();
Type type() const { return type_; }
@@ -19,7 +19,7 @@ class Message;
class Timer : public Object
{
public:
- Timer();
+ Timer(Object *parent = nullptr);
~Timer();
void start(unsigned int msec);
@@ -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);
}
@@ -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)
{
}