]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/include/kern/event.h
Random stuff.
[polintos/scott/priv.git] / kernel / include / kern / event.h
1 #ifndef _KERN_EVENT_H
2 #define _KERN_EVENT_H
3
4 #include <System/Events.h>
5
6 namespace Event {
7         using System::VStruct;
8         using System::Events::Event;
9         using namespace System::Notifiers;
10
11         class EventTrigger {
12         public:
13                 #include <servers/core/event/Event/EventTrigger.h>
14                 
15                 EventTrigger()
16                 {
17                         init_iface();
18                 }
19                 
20                 virtual ~EventTrigger()
21                 {
22                 }
23                 
24                 virtual void notify(VStruct *info) = 0;
25         };
26
27         class SyncEventTrigger {
28                 EventTrigger *real_trigger;
29         
30         public:
31                 #include <servers/core/event/Event/SyncEventTrigger.h>
32
33                 SyncEventTrigger(EventTrigger *real)
34                 {
35                         real_trigger = real;
36                         init_iface();
37                 }
38
39                 void notify(VStruct *info)
40                 {
41                         real_trigger->notify(info);
42                 }
43         };
44
45         class EventDispatcher {
46         public:
47                 #include <servers/core/event/Event/EventDispatcher.h>
48
49                 EventDispatcher()
50                 {
51                         init_iface();
52                 }
53
54                 void setup_trigger(Event *event, Notifier *trigger);
55                 void setup_sync_trigger(Event *event, SyncNotifier *trigger);
56                 
57                 typedef void (*KFunc)(VStruct *info);
58                 
59                 void setup_kfunc_event(KFunc func, SyncNotifier *trigger);
60         };
61 }
62
63 #include <servers/core/event/footer.cc>
64
65 #endif