~ubuntu-branches/ubuntu/breezy/ace/breezy

« back to all changes in this revision

Viewing changes to examples/Reactor/Misc/test_event_handler_t.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad, Benjamin Montgomery, Adam Conrad
  • Date: 2005-09-18 22:51:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge) (0.1.2 woody)
  • Revision ID: james.westby@ubuntu.com-20050918225138-seav22q6fyylb536
Tags: 5.4.7-3ubuntu1
[ Benjamin Montgomery ]
* Added a patch for amd64 and powerpc that disables the compiler
  option -fvisibility-inlines-hidden

[ Adam Conrad ]
* Added DPATCH_OPTION_CPP=1 to debian/patches/00options to make
  Benjamin's above changes work correctly with dpatch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// test_event_handler_t.cpp,v 4.9 2003/04/09 17:14:23 jwillemsen Exp
2
 
 
3
 
#include "ace/Event_Handler_T.h"
4
 
#include "ace/Log_Msg.h"
5
 
 
6
 
ACE_RCSID(Misc, test_event_handler_t, "test_event_handler_t.cpp,v 4.9 2003/04/09 17:14:23 jwillemsen Exp")
7
 
 
8
 
#if defined (ACE_HAS_TEMPLATE_TYPEDEFS)
9
 
 
10
 
class ACE_Test_Sig_Handler
11
 
{
12
 
public:
13
 
  ACE_Test_Sig_Handler (void) {}
14
 
  virtual ACE_HANDLE get_handle (void) const { return 0; }
15
 
  virtual void set_handle (ACE_HANDLE) {}
16
 
  virtual int handle_async_io (ACE_HANDLE) { return 0; }
17
 
  virtual int shutdown (ACE_HANDLE, ACE_Reactor_Mask) { return 0; }
18
 
  virtual int signal_handler (int /* signum */,
19
 
                              siginfo_t * = 0,
20
 
                              ucontext_t * = 0)
21
 
  {
22
 
    return 0;
23
 
  }
24
 
};
25
 
 
26
 
int
27
 
main (int, char *[])
28
 
{
29
 
  typedef ACE_Event_Handler_T<ACE_Test_Sig_Handler> EH_SH;
30
 
 
31
 
  // Tie the ACE_Event_Handler_T together with the methods from ACE_Test_Sig_Handler.
32
 
  EH_SH tied_sh (new ACE_Test_Sig_Handler, 1,
33
 
                 &ACE_Test_Sig_Handler::get_handle,
34
 
                 &ACE_Test_Sig_Handler::handle_async_io,
35
 
                 &ACE_Test_Sig_Handler::shutdown,
36
 
                 &ACE_Test_Sig_Handler::signal_handler);
37
 
  return 0;
38
 
}
39
 
 
40
 
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)  || \
41
 
    defined (ACE_HAS_GNU_REPO)
42
 
  // The explicit instantiation is necessary with g++ 2.91.66 with
43
 
  // -frepo, because it misses it.
44
 
template class ACE_Event_Handler_T<ACE_Test_Sig_Handler>;
45
 
#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
46
 
#pragma instantiate ACE_Event_Handler_T<ACE_Test_Sig_Handler>
47
 
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
48
 
 
49
 
#else
50
 
int
51
 
main (int, char *[])
52
 
{
53
 
  ACE_ERROR_RETURN ((LM_ERROR, "your platform does not support template typedefs\n"), 1);
54
 
}
55
 
#endif /* ACE_HAS_TEMPLATE_TYPEDEFS */