27 std::string inputCache;
28 std::string outputCache;
32 needInterrupt =
false;
33 inputCache = outputCache =
"";
37 std::cout <<
"Bye bye" << std::endl;
40 bool isOk()
const override {
46 while (needInterrupt) {
47 std::cout <<
"*** INTERRUPT: Please hit enter ***" << std::endl;
48 for (
int i=0; i<10 && needInterrupt; i++) {
83 inputCache = outputCache =
"";
84 std::cout <<
"Stream reset" << std::endl;
88 std::cout <<
"Packet begins" << std::endl;
94 std::cout <<
"Packet ends" << std::endl;
void write(const Bytes &b) override
Write a block of bytes to the stream.
InputStream & getInputStream() override
Get an InputStream to read from.
void endPacket() override
Mark the end of a logical packet (see beginPacket).
void beginPacket() override
Mark the beginning of a logical packet.
const yarp::os::Contact & getLocalAddress() const override
Get the address of the local side of the stream.
void reset() override
Reset the stream.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
void close() override
Terminate the stream.
const yarp::os::Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
void interrupt() override
Interrupt the stream.
bool isOk() const override
Check if the stream is ok or in an error state.
A simple abstraction for a block of bytes.
Simple specification of the minimum functions needed from output streams.
virtual void write(char ch)
Write a single byte to the stream.
static void delaySystem(double seconds)
A stream which can be asked to perform bidirectional communication.
An interface to the operating system, including Port based communication.