AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
A thread safe buffer that converts an IInputStream to IOutputStream (and otherwise). More...
A thread safe buffer that converts an IInputStream to IOutputStream (and otherwise).
APipe is similar to the unix pipes. It's capable to store up to 65,536 bytes. It's implemented like a ring buffer. If this limit is reached, a write() method blocks thread until buffer is read from.
If capacity may be not enough, consider to use ADynamicPipe instead.
Public Member Functions | |
size_t | read (char *dst, size_t size) override |
Reads up to size bytes from stream. Blocking (waiting for new data) is allowed. More... | |
void | write (const char *src, size_t size) override |
Writes exact size bytes to stream. Blocking (waiting for write all data) is allowed. More... | |
size_t | available () |
void | close () |
Public Member Functions inherited from IInputStream | |
size_t | read (std::span< std::byte > destination) |
Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed. More... | |
void | readExact (char *dst, size_t size) |
Reads exact size bytes from stream. Blocking (waiting for new data) is allowed. More... | |
template<typename T > | |
T | deserialize () |
template<typename T > | |
IInputStream & | operator>> (T &dst) |
template<typename T > | |
IInputStream & | operator>> (T &&dst) |
Public Member Functions inherited from IOutputStream | |
template<typename T > | |
void | write (const T &t) |
template<typename T > | |
IOutputStream & | operator<< (const T &t) |
|
overridevirtual |
Reads up to size
bytes from stream. Blocking (waiting for new data) is allowed.
dst | destination buffer |
size | destination buffer's size. > 0 |
Implements IInputStream.
|
overridevirtual |
Writes exact size
bytes to stream. Blocking (waiting for write all data) is allowed.
dst | source buffer |
size | source buffer's size. > 0 |
Implements IOutputStream.
#include <AUI/IO/APipe.h>