libcamera  v0.0.0
Supporting cameras in Linux since 2019
event_dispatcher.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 /*
3  * Copyright (C) 2019, Google Inc.
4  *
5  * event_dispatcher.h - Event dispatcher
6  */
7 #ifndef __LIBCAMERA_EVENT_DISPATCHER_H__
8 #define __LIBCAMERA_EVENT_DISPATCHER_H__
9 
10 #include <vector>
11 
12 namespace libcamera {
13 
14 class EventNotifier;
15 class Timer;
16 
18 {
19 public:
20  virtual ~EventDispatcher();
21 
22  virtual void registerEventNotifier(EventNotifier *notifier) = 0;
23  virtual void unregisterEventNotifier(EventNotifier *notifier) = 0;
24 
25  virtual void registerTimer(Timer *timer) = 0;
26  virtual void unregisterTimer(Timer *timer) = 0;
27 
28  virtual void processEvents() = 0;
29 
30  virtual void interrupt() = 0;
31 };
32 
33 } /* namespace libcamera */
34 
35 #endif /* __LIBCAMERA_EVENT_DISPATCHER_H__ */
Interface to manage the libcamera events and timers.
Definition: event_dispatcher.h:18
virtual void processEvents()=0
Wait for and process pending events.
virtual void registerEventNotifier(EventNotifier *notifier)=0
Register an event notifier.
virtual void interrupt()=0
Interrupt any running processEvents() call as soon as possible.
virtual void unregisterTimer(Timer *timer)=0
Unregister a timer.
virtual void registerTimer(Timer *timer)=0
Register a timer.
virtual void unregisterEventNotifier(EventNotifier *notifier)=0
Unregister an event notifier.
Notify of activity on a file descriptor.
Definition: event_notifier.h:18
Single-shot timer interface.
Definition: timer.h:21