File: Event_Dispatcher.h

package info (click to toggle)
ace 6.0.3%2Bdfsg-0.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 49,368 kB
  • sloc: cpp: 341,826; perl: 30,850; ansic: 20,952; makefile: 10,144; sh: 4,744; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; csh: 48; tcl: 5
file content (52 lines) | stat: -rw-r--r-- 1,329 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* -*- c++ -*- */
// $Id: Event_Dispatcher.h 80826 2008-03-04 14:51:23Z wotte $

#ifndef JAWS_EVENT_DISPATCHER_H
#define JAWS_EVENT_DISPATCHER_H

#include "ace/Reactor.h"
#include "ace/Reactor_Token_T.h"
#include "ace/Select_Reactor.h"

#include "jaws3/Export.h"

// We are using the Reactor in a single threaded manner,
// so if we are using the Select Reactor, get rid of the
// big reactor lock.

typedef ACE_Reactor_Token_T<ACE_Noop_Token>
        ACE_Select_Reactor_Noop_Token;

typedef ACE_Select_Reactor_T<ACE_Select_Reactor_Noop_Token>
        ACE_Select_NULL_LOCK_Reactor;

#if !defined (ACE_WIN32) \
 || !defined (ACE_HAS_WINSOCK2) || (ACE_HAS_WINSOCK2 == 0) \
 || defined (ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL) \
 || defined (ACE_USE_TP_REACTOR_FOR_REACTOR_IMPL)

#define ACE_REACTOR_INSTANCE_INIT \
        do { \
        ACE_Select_NULL_LOCK_Reactor *select_reactor; \
        select_reactor = new ACE_Select_NULL_LOCK_Reactor; \
        ACE_Reactor::instance (new ACE_Reactor (select_reactor, 1), 1); \
        } while (0)

#else

#define ACE_REACTOR_INSTANCE_INIT ACE_Reactor::instance ()

#endif /* ACE_WIN32 */

class JAWS_Event_Dispatcher;

class JAWS_Export JAWS_Event_Dispatcher
{
public:

  static void end_event_loop (void);
  static void run_event_loop (void);

};

#endif /* JAWS_EVENT_DISPATCHER_H */