#include <PhosphorChannel/Ring.h>
|
| static std::unique_ptr< RingWriter > | create (std::size_t capacity, std::string codec, std::string *error) |
| | A ring of capacity bytes (rounded up to 8) for codec.
|
|
| static constexpr std::size_t | MinCapacity = 4096 |
| | The smallest and the largest data area, in bytes.
|
| static constexpr std::size_t | MaxCapacity = std::size_t(1) << 30 |
◆ ~RingWriter()
| PhosphorChannel::RingWriter::~RingWriter |
( |
| ) |
|
◆ RingWriter()
| PhosphorChannel::RingWriter::RingWriter |
( |
const RingWriter & | | ) |
|
|
delete |
◆ capacity()
| std::size_t PhosphorChannel::RingWriter::capacity |
( |
| ) |
const |
|
inline |
◆ clearSpaceSignal()
| void PhosphorChannel::RingWriter::clearSpaceSignal |
( |
| ) |
|
◆ close()
| void PhosphorChannel::RingWriter::close |
( |
| ) |
|
Tells the reader that no frame follows.
Frames written before still reach it.
◆ codec()
| const std::string & PhosphorChannel::RingWriter::codec |
( |
| ) |
const |
|
inline |
◆ create()
| std::unique_ptr< RingWriter > PhosphorChannel::RingWriter::create |
( |
std::size_t | capacity, |
|
|
std::string | codec, |
|
|
std::string * | error ) |
|
static |
A ring of capacity bytes (rounded up to 8) for codec.
Nullptr with error for a bad codec or capacity, or a failed memfd.
◆ maxFrame()
| std::size_t PhosphorChannel::RingWriter::maxFrame |
( |
| ) |
const |
The largest frame that the ring takes.
◆ memoryFd()
| int PhosphorChannel::RingWriter::memoryFd |
( |
| ) |
const |
|
inline |
The memfd of the ring.
The ring owns it: never close it. A mapping of a dup() of it sees the ring, which the tests use to break the layout.
◆ operator=()
◆ spaceFd()
| int PhosphorChannel::RingWriter::spaceFd |
( |
| ) |
const |
|
inline |
Readable when the reader freed the space that a WouldBlock asked for, closed the ring, or went away.
Call clearSpaceSignal() before the tryWrite() that it wakes: a signal cleared after that retry can be the one that its WouldBlock asked for, and then nothing wakes the writer.
◆ tryWrite()
| WriteResult PhosphorChannel::RingWriter::tryWrite |
( |
std::string_view | frame | ) |
|
Writes one frame without waiting.
Closed once the reader closed the ring, or once this end saw it go away (see spaceFd()).
◆ write()
| WriteResult PhosphorChannel::RingWriter::write |
( |
std::string_view | frame, |
|
|
int | timeoutMs ) |
Waits up to timeoutMs (-1: no limit) for space.
WouldBlock after the timeout. A reader that exits ends the wait with Closed.
◆ MaxCapacity
| std::size_t PhosphorChannel::RingWriter::MaxCapacity = std::size_t(1) << 30 |
|
staticconstexpr |
◆ MinCapacity
| std::size_t PhosphorChannel::RingWriter::MinCapacity = 4096 |
|
staticconstexpr |
The smallest and the largest data area, in bytes.
The documentation for this class was generated from the following file:
- phosphor-channel/include/PhosphorChannel/Ring.h