xref: /onnv-gate/usr/src/cmd/man/src/util/nsgmls.src/lib/EventQueue.h (revision 0:68f95e015346)
1 // Copyright (c) 1994 James Clark
2 // See the file COPYING for copying permission.
3 #pragma ident	"%Z%%M%	%I%	%E% SMI"
4 
5 #ifndef EventQueue_INCLUDED
6 #define EventQueue_INCLUDED 1
7 
8 #include "IQueue.h"
9 #include "Event.h"
10 
11 #ifdef SP_NAMESPACE
12 namespace SP_NAMESPACE {
13 #endif
14 
15 class EventQueue : public EventHandler, public IQueue<Event> {
16 public:
17   EventQueue();
18 private:
19 #define EVENT(c, f) void f(c *);
20 #include "events.h"
21 #undef EVENT
22   void append(Event *);
23 };
24 
25 class Pass1EventHandler : public EventQueue {
26 public:
27   Pass1EventHandler();
28   void init(EventHandler *origHandler);
29   void message(MessageEvent *);
30   Boolean hadError() const;
31   EventHandler *origHandler() const;
32 private:
33   Boolean hadError_;
34   EventHandler *origHandler_;
35 };
36 
37 inline
append(Event * event)38 void EventQueue::append(Event *event)
39 {
40   IQueue<Event>::append(event);
41 }
42 
43 inline
hadError()44 Boolean Pass1EventHandler::hadError() const
45 {
46   return hadError_;
47 }
48 
49 inline
origHandler()50 EventHandler *Pass1EventHandler::origHandler() const
51 {
52   return origHandler_;
53 }
54 
55 #ifdef SP_NAMESPACE
56 }
57 #endif
58 
59 #endif /* not EventQueue_INCLUDED */
60