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

« back to all changes in this revision

Viewing changes to examples/C++NPv2/Logging_Event_Handler_Ex.h

  • 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
 
/*
2
 
** Logging_Event_Handler_Ex.h,v 1.4 2003/08/04 03:53:54 dhinton Exp
3
 
**
4
 
** Copyright 2002 Addison Wesley. All Rights Reserved.
5
 
*/
6
 
 
7
 
#ifndef _LOGGING_EVENT_HANDLER_EX_H
8
 
#define _LOGGING_EVENT_HANDLER_EX_H
9
 
 
10
 
#include "ace/Reactor.h"
11
 
#include "ace/Time_Value.h"
12
 
#include "ace/Recursive_Thread_Mutex.h"
13
 
 
14
 
#include "Logging_Event_Handler.h"
15
 
 
16
 
class Logging_Event_Handler_Ex : public Logging_Event_Handler
17
 
{
18
 
private:
19
 
  // Time when a client last sent a log record.
20
 
  ACE_Time_Value time_of_last_log_record_;
21
 
 
22
 
  // Maximum time to wait for a client log record.
23
 
  const ACE_Time_Value max_client_timeout_;
24
 
 
25
 
public:
26
 
  typedef Logging_Event_Handler PARENT;
27
 
 
28
 
  // 3600 seconds == one hour.
29
 
  enum { MAX_CLIENT_TIMEOUT = 3600 };
30
 
 
31
 
  Logging_Event_Handler_Ex 
32
 
    (ACE_Reactor *reactor,
33
 
     const ACE_Time_Value &max_client_timeout
34
 
       = ACE_Time_Value (MAX_CLIENT_TIMEOUT))
35
 
    : Logging_Event_Handler (reactor),
36
 
      time_of_last_log_record_ (0),
37
 
      max_client_timeout_ (max_client_timeout) {}
38
 
 
39
 
  virtual ~Logging_Event_Handler_Ex () {}
40
 
 
41
 
  virtual int open (); // Activate the event handler.
42
 
 
43
 
  // Called by a reactor when logging events arrive.
44
 
  virtual int handle_input (ACE_HANDLE);
45
 
 
46
 
  // Called when a timeout expires to check if the client has
47
 
  // been idle for an excessive amount of time.
48
 
  virtual int handle_timeout (const ACE_Time_Value &tv,
49
 
                              const void *act);
50
 
 
51
 
  // Called when this object is destroyed, e.g., when it's 
52
 
  // removed from a reactor.
53
 
  virtual int handle_close (ACE_HANDLE = ACE_INVALID_HANDLE,
54
 
                            ACE_Reactor_Mask = 0);
55
 
};
56
 
 
57
 
#endif /* _LOGGING_EVENT_HANDLER_EX_H */