#include <sue_sel.hpp>
Inheritance diagram for SUETimeoutHandler:
Public Methods | |
SUETimeoutHandler (long a_sec, long a_usec) | |
Constructor of a full form. | |
SUETimeoutHandler () | |
Default constructor. | |
virtual | ~SUETimeoutHandler () |
Destructor. | |
void | Set (long a_sec, long a_usec) |
Set the timeout in absolute time. | |
void | SetFromNow (long a_sec, long a_usec=0) |
Set the timeout relative to the current time. | |
void | Get (long &a_sec, long &a_usec) const |
Read the value. Used primarily by SUEEventSelector. | |
void | GetRemainingTime (long &a_sec, long &a_usec) const |
Read the value, call gettimeofday(3) and return the difference. | |
bool | operator< (const SUETimeoutHandler &other) const |
Compare two timevalues. Used primarily by SUEEventSelector. | |
bool | IsBefore (long a_sec, long a_usec) const |
Is it before the given moment. | |
virtual void | TimeoutHandle ()=0 |
Callback function for notification. | |
Friends | |
class | SUEEventSelector |
When we wish the SUEEventSelector to notify us that a given time event happens, we create a sublcass of SUETimeoutHandler and register it with the SUEEventSelector object.
children.cpp, sitter.cpp, and sleep5.cpp.
|
Constructor of a full form. This form of constructor allows to pass the actual moment to notify us at. |
|
Default constructor. This form assumes we'll set the timeout value later with Set or SetFromNow methods |
|
Destructor.
|
|
Read the value. Used primarily by SUEEventSelector.
|
|
Read the value, call gettimeofday(3) and return the difference.
|
|
Is it before the given moment.
|
|
Compare two timevalues. Used primarily by SUEEventSelector.
|
|
Set the timeout in absolute time. Set the actual moment when we need to be notified.
|
|
Set the timeout relative to the current time. Set the time interval after which the timeout is to happen. The method actually calls gettimeofday(3) and adds the arguments to the values returned.
|
|
Callback function for notification. The SUEEventSelector calls this method when the specified moment comes. After that, we can assume the object is no longer registered so it is possible to set a new value and register it again, even from within the TimeoutHandle() function itself (because SUEEventSelector unregisters the handler before calling the method).
Implemented in SUEGenericDuplexSession.
|
|
|