#include <handler.hpp>
Inherits std::enable_shared_from_this< handler >.
Inherited by matador::acceptor, matador::connector, and matador::stream_handler.
Public Member Functions | |
virtual | ~handler ()=default |
virtual void | open ()=0 |
virtual socket_type | handle () const =0 |
virtual void | on_input ()=0 |
virtual void | on_output ()=0 |
virtual void | on_except ()=0 |
virtual void | on_timeout ()=0 |
virtual void | on_close ()=0 |
virtual void | close ()=0 |
virtual bool | is_ready_write () const =0 |
virtual bool | is_ready_read () const =0 |
time_t | next_timeout () const |
time_t | interval () const |
virtual std::string | name () const =0 |
Protected Member Functions | |
reactor * | get_reactor () const |
Friends | |
class | reactor |
Base class for all handlers used with the reactor. The handler must implement its interface to handle input, output, exceptional and timeout data.
|
virtualdefault |
Virtual destructor
|
pure virtual |
Interface implementation should close the handle gracefully
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
protected |
Gets the underlying reactor
|
pure virtual |
Interface to returns the socket handle of the concrete handler implementation.
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
time_t matador::handler::interval | ( | ) | const |
Returns the timeout interval in seconds
|
pure virtual |
Interface should return true if there is incoming data
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Interface should return true if there is outgoing data
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Get the name of the handler. The name don't need to be unique. It has only an informational purpose.
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
time_t matador::handler::next_timeout | ( | ) | const |
Returns the next timeout scheduled in the reactor
|
pure virtual |
Interface called when the handler is closed
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Interface handling exceptional data
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Interface handling incoming data
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Interface handling outgoing data
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Interface handling timout data
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.
|
pure virtual |
Interface to open a handler. This is called when a handler is registered within the reactor
Implemented in matador::acceptor, matador::connector, and matador::stream_handler.