|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
10 #ifndef YARP_OS_IMPL_FAKETWOWAYSTREAM_H
11 #define YARP_OS_IMPL_FAKETWOWAYSTREAM_H
31 this->out.owner =
this;
32 this->target = target;
37 this->target = ⌖
73 if (target !=
nullptr) {
85 return out.toString();
114 ActiveStringOutputStream() :
131 StringInputStream in;
132 ActiveStringOutputStream out;
135 StringInputStream* target;
142 #endif // YARP_OS_IMPL_FAKETWOWAYSTREAM_H
A stream which can be asked to perform bidirectional communication.
void reset() override
Reset the stream.
virtual void write(char ch)
Write a single byte to the stream.
const Contact & getLocalAddress() const override
Get the address of the local side of the stream.
bool isOk() const override
Check if the stream is ok or in an error state.
Simple specification of the minimum functions needed from output streams.
const Contact & getRemoteAddress() const override
Get the address of the remote side of the stream.
InputStream & getInputStream() override
Get an InputStream to read from.
virtual void apply(const Bytes &b)
An OutputStream that produces a string.
std::string getOutputText() const
void endPacket() override
Mark the end of a logical packet (see beginPacket).
void setTarget(StringInputStream &target)
std::string getInputText() const
virtual StringInputStream & getStringInputStream()
A simple abstraction for a block of bytes.
void close() override
Terminate the stream.
A dummy two way stream for testing purposes.
void addInputText(const std::string &str)
OutputStream & getOutputStream() override
Get an OutputStream to write to.
The main, catch-all namespace for YARP.
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
virtual void write(char ch)
Write a single byte to the stream.
void beginPacket() override
Mark the beginning of a logical packet.
FakeTwoWayStream(StringInputStream *target=nullptr)