27#ifndef ASYNC_PTY_INCLUDED
28#define ASYNC_PTY_INCLUDED
38#include <sigc++/sigc++.h>
124class Pty :
public sigc::trackable
130 Pty(
const std::string &slave_link=
"");
139 m_is_line_buffered = line_buffered;
140 m_line_buffer.clear();
181 ssize_t
write(
const void *buf,
size_t count);
187 bool isOpen(
void)
const {
return master >= 0; }
199 static const int POLLHUP_CHECK_INTERVAL = 100;
201 std::string slave_link;
205 bool m_is_line_buffered =
false;
206 std::string m_line_buffer;
209 Pty& operator=(
const Pty&);
211 void charactersReceived(
void);
212 short pollMaster(
void);
213 void checkIfSlaveEndOpen(
void);
Contains a single shot or periodic timer that emits a signal on timeout.
A class for watching file descriptors.
void setLineBuffered(bool line_buffered)
bool isOpen(void) const
Check if the PTY is open or not.
void close(void)
Close the PTY if it's open.
bool open(void)
Open the PTY.
ssize_t write(const void *buf, size_t count)
Write data to the PTY.
bool reopen(void)
Reopen the PTY.
Pty(const std::string &slave_link="")
Default constructor.
sigc::signal< void, const void *, size_t > dataReceived
Signal that is emitted when data has been received.
A class that produces timer events.
Namespace for the asynchronous programming classes.