8 #ifndef _TASKS_IO_TASK_BASE_H_
9 #define _TASKS_IO_TASK_BASE_H_
32 std::ostringstream os;
33 os <<
"io_task_base(" <<
this <<
")";
65 std::unique_ptr<ev_io>
m_io;
73 #endif // _TASKS_IO_TASK_BASE_H_
virtual void dispose(worker *worker)
Stop the watcher before being deleted.
std::unique_ptr< ev_io > m_io
Base class for objects/tasks that can be deleted.
virtual void init_watcher()
Initialize the watcher.
int events() const
Return the monitored events.
This is the base class for io event tasks. It controls an ev_io watcher that monitors io events on fi...
virtual void update_watcher(worker *worker)
Udate a watcher in the context of the given worker.
Base class for socket and term.
bool m_watcher_initialized
virtual void stop_watcher(worker *worker)
Stop a watcher in the context of the given worker.
virtual void start_watcher(worker *worker)
Start a watcher in the context of the given worker.
void set_events(int events)
Update the events the object monitors.
std::string get_string() const
virtual io_base & iob()=0
Return the io_base object.
ev_io * watcher() const
Return the io watcher object.