1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2000-2015 Ericsson Telecom AB
3 // All rights reserved. This program and the accompanying materials
4 // are made available under the terms of the Eclipse Public License v1.0
5 // which accompanies this distribution, and is available at
6 // http://www.eclipse.org/legal/epl-v10.html
7 ///////////////////////////////////////////////////////////////////////////////
8 #ifndef EVENT_HANDLER_HH
9 #define EVENT_HANDLER_HH
14 * The definitions in this header file are needed for TITAN.
15 * These classes should not be used in user code.
16 * These classes are used as base classes for class PORT.
19 class Fd_Event_Handler {
20 virtual void Handle_Fd_Event(int fd,
21 boolean is_readable, boolean is_writeable, boolean is_error) = 0;
25 virtual ~Fd_Event_Handler() {}
26 virtual void log() const;
28 Fd_Event_Handler(const Fd_Event_Handler&);
29 const Fd_Event_Handler & operator= (const Fd_Event_Handler &);
30 friend class Fd_And_Timeout_User;
31 friend class Handler_List;
38 class Fd_And_Timeout_Event_Handler : public Fd_Event_Handler {
39 virtual void Handle_Fd_Event(int fd,
40 boolean is_readable, boolean is_writeable, boolean is_error);
41 virtual void Handle_Timeout(double time_since_last_call);
42 /// Copy constructor disabled
43 Fd_And_Timeout_Event_Handler(const Fd_And_Timeout_Event_Handler&);
44 /// Assignment disabled
45 Fd_And_Timeout_Event_Handler& operator=(const Fd_And_Timeout_Event_Handler&);
47 virtual void Event_Handler(const fd_set *read_fds, const fd_set *write_fds,
48 const fd_set *error_fds, double time_since_last_call);
51 inline Fd_And_Timeout_Event_Handler() :
52 callInterval(0.0), last_called(0.0), list(0), prev(0), next(0),
53 fdSets(0), fdCount(0),
54 isTimeout(TRUE), callAnyway(TRUE), isPeriodic(TRUE),
57 virtual ~Fd_And_Timeout_Event_Handler();
58 virtual void log() const;
60 friend class Fd_And_Timeout_User;
61 friend class Handler_List;
63 double callInterval, last_called;
65 Fd_And_Timeout_Event_Handler * prev, * next;
68 boolean isTimeout, callAnyway, isPeriodic;
71 boolean getIsOldApi() { return fdSets != 0; }