#include <PhosphorChannel/Ring.h>
|
| static std::unique_ptr< RingReader > | attach (int memoryFd, int wakeFd, std::string codec, std::size_t maxCapacity, std::string *error) |
| | Maps the ring of a writer.
|
◆ ~RingReader()
| PhosphorChannel::RingReader::~RingReader |
( |
| ) |
|
◆ RingReader()
| PhosphorChannel::RingReader::RingReader |
( |
const RingReader & | | ) |
|
|
delete |
◆ attach()
| std::unique_ptr< RingReader > PhosphorChannel::RingReader::attach |
( |
int | memoryFd, |
|
|
int | wakeFd, |
|
|
std::string | codec, |
|
|
std::size_t | maxCapacity, |
|
|
std::string * | error ) |
|
static |
Maps the ring of a writer.
Takes both fds, also on a failure. Refuses a memfd that is not plain shared memory, lacks the size seals, is larger than maxCapacity, or does not match its header, and a wake fd that is not a Unix stream socket. codec is what the handshake said.
◆ capacity()
| std::size_t PhosphorChannel::RingReader::capacity |
( |
| ) |
const |
|
inline |
◆ clearDataSignal()
| void PhosphorChannel::RingReader::clearDataSignal |
( |
| ) |
|
◆ close()
| void PhosphorChannel::RingReader::close |
( |
| ) |
|
Tells the writer that nothing reads any more: its writes return Closed.
Later reads return Closed too.
◆ codec()
| const std::string & PhosphorChannel::RingReader::codec |
( |
| ) |
const |
|
inline |
◆ dataFd()
| int PhosphorChannel::RingReader::dataFd |
( |
| ) |
const |
|
inline |
Readable when the writer wrote after a read() returned Empty, closed the ring, or went away.
Only Empty asks the writer for a signal: a reader that stops before Empty while frames wait gets no signal for them, so it reads until Empty before it waits. Call clearDataSignal() before the reads that drain the ring.
◆ operator=()
◆ read()
| ReadResult PhosphorChannel::RingReader::read |
( |
std::string & | frame | ) |
|
The next frame in frame, without waiting.
Closed once the writer closed the ring, or this end saw it go away (see dataFd()), and every frame was read, and after close().
The documentation for this class was generated from the following file:
- phosphor-channel/include/PhosphorChannel/Ring.h