libtasks Documentation  1.6
serial_io_task.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014 ADTECH GmbH
3  * Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING)
4  *
5  * Author: Andreas Pohl
6  */
7 
8 #ifndef _TASKS_SERIAL_IO_TASK_H_
9 #define _TASKS_SERIAL_IO_TASK_H_
10 
11 #include <tasks/io_task_base.h>
12 #include <tasks/serial/term.h>
13 
14 namespace tasks {
15 
20 class serial_io_task : public io_task_base {
21  public:
24  virtual ~serial_io_task();
25 
27  inline serial::term& term() { return m_term; }
29  inline const serial::term& term() const { return m_term; }
30 
31  protected:
33  io_base& iob() { return m_term; }
35  const io_base& iob() const { return m_term; }
38  m_auto_close = false;
39  }
40 
41  private:
43  bool m_auto_close = true;
44 };
45 
46 } // tasks
47 
48 #endif // _TASKS_SERIAL_IO_TASK_H_
const serial::term & term() const
Provide const access to the underlying term object.
void disable_auto_close()
Disable automatic closing of the term object in the desctructor.
int events() const
Return the monitored events.
Definition: io_task_base.h:38
serial::term & term()
Provide access to the underlying term object.
This is the base class for io event tasks. It controls an ev_io watcher that monitors io events on fi...
Definition: io_task_base.h:26
Base class for socket and term.
Definition: io_base.h:16
io_base & iob()
Grant socket access to the io_task_base.
serial_io_task(int events)
The serial_io_task implements the base tasks that implement serial communication. ...
A class that allows to read and write from/to terminal devices.
Definition: term.h:35
const io_base & iob() const
Grant const socket access to the io_task_base.