Sponge
CS144's user-space TCP library
|
Specifies a condition and callback that an EventLoop should handle. More...
Public Member Functions | |
unsigned int | service_count () const |
Public Attributes | |
CallbackT | callback |
A callback that reads or writes fd. More... | |
CallbackT | cancel |
A callback that is called when the rule is cancelled (e.g. on hangup) More... | |
Direction | direction |
Direction::In for reading from fd, Direction::Out for writing to fd. More... | |
FileDescriptor | fd |
FileDescriptor to monitor for activity. More... | |
InterestT | interest |
A callback that returns true whenever fd should be polled. More... | |
Specifies a condition and callback that an EventLoop should handle.
Created by calling EventLoop::add_rule() or EventLoop::add_cancelable_rule().
Definition at line 26 of file eventloop.hh.
unsigned int EventLoop::Rule::service_count | ( | ) | const |
Returns the number of times fd has been read or written, depending on the value of Rule::direction.
This function is used internally by EventLoop; you will not need to call it
Definition at line 13 of file eventloop.cc.
CallbackT EventLoop::Rule::callback |
A callback that reads or writes fd.
Definition at line 30 of file eventloop.hh.
CallbackT EventLoop::Rule::cancel |
A callback that is called when the rule is cancelled (e.g. on hangup)
Definition at line 32 of file eventloop.hh.
Direction EventLoop::Rule::direction |
Direction::In for reading from fd, Direction::Out for writing to fd.
Definition at line 29 of file eventloop.hh.
FileDescriptor EventLoop::Rule::fd |
FileDescriptor to monitor for activity.
Definition at line 28 of file eventloop.hh.
InterestT EventLoop::Rule::interest |
A callback that returns true
whenever fd should be polled.
Definition at line 31 of file eventloop.hh.