Line data Source code
1 :
2 : /* Copyright (c) 2013, Daniel Nachbaur <daniel.nachbaur@epfl.ch>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #ifndef EQ_DEFLECT_EVENTHANDLER_H
19 : #define EQ_DEFLECT_EVENTHANDLER_H
20 :
21 : #include <eq/eventHandler.h> // base class
22 : #include <eq/types.h> // basic typedefs
23 :
24 : #include <lunchbox/thread.h> // thread-safety macro
25 :
26 : namespace eq
27 : {
28 : namespace deflect
29 : {
30 : /** @internal The event handler for one Deflect stream. */
31 : class EventHandler : public eq::EventHandler
32 : {
33 : public:
34 : /** Construct a new Deflect event handler. @version 1.7.1 */
35 : explicit EventHandler(Proxy* proxy);
36 :
37 : /** Destruct the Deflect event handler. @version 1.7.1 */
38 : virtual ~EventHandler();
39 :
40 : /**
41 : * Dispatch all pending events on the current thread.
42 : *
43 : * If no event handlers have been constructed by the calling thread, this
44 : * function does nothing. This function does not block on events.
45 : *
46 : * @param proxy if not 0, limit processing to the given Proxy instance
47 : * @version 1.7.1
48 : */
49 : static void processEvents(const Proxy* proxy = 0);
50 :
51 : private:
52 : /** The corresponding Deflect proxy instance. */
53 : Proxy* const _proxy;
54 :
55 : void _processEvents(const Proxy* proxy);
56 :
57 0 : LB_TS_VAR(_thread);
58 : };
59 : }
60 : }
61 : #endif // EQ_DC_EVENTHANDLER_H
|