File: test_event_handler_t.cpp

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 (39 lines) | stat: -rw-r--r-- 1,177 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
// $Id: test_event_handler_t.cpp 91685 2010-09-09 09:35:14Z johnnyw $

#include "ace/Event_Handler_T.h"
#include "ace/Log_Msg.h"

class ACE_Test_Sig_Handler
{
public:
  ACE_Test_Sig_Handler (void) {}
  virtual ~ACE_Test_Sig_Handler (void) {}
  virtual ACE_HANDLE get_handle (void) const { return 0; }
  virtual void set_handle (ACE_HANDLE) {}
  virtual int handle_async_io (ACE_HANDLE) { return 0; }

  //FUZZ: disable check_for_lack_ACE_OS
  virtual int shutdown (ACE_HANDLE, ACE_Reactor_Mask) { return 0; }
  //FUZZ: enable check_for_lack_ACE_OS

  virtual int signal_handler (int /* signum */,
                              siginfo_t * = 0,
                              ucontext_t * = 0)
  {
    return 0;
  }
};

int
ACE_TMAIN (int, ACE_TCHAR *[])
{
  typedef ACE_Event_Handler_T<ACE_Test_Sig_Handler> EH_SH;

  // Tie the ACE_Event_Handler_T together with the methods from ACE_Test_Sig_Handler.
  EH_SH tied_sh (new ACE_Test_Sig_Handler, 1,
                 &ACE_Test_Sig_Handler::get_handle,
                 &ACE_Test_Sig_Handler::handle_async_io,
                 &ACE_Test_Sig_Handler::shutdown,
                 &ACE_Test_Sig_Handler::signal_handler);
  return 0;
}