|
| byte_terminated ()=delete |
| Default constructor (deleted)
|
virtual | ~byte_terminated ()=default |
| Virtual destructor.
|
| byte_terminated (_IO_ &io) noexcept |
| Constructor with I/O reference.
|
std::size_t | shiftSize (std::size_t const size) const noexcept |
| Calculates the message size without the delimiter.
|
std::size_t | getMessageSize () noexcept final |
| Determines the size of the next complete message.
|
void | reset () noexcept final |
| Resets the protocol state.
|
virtual | ~IProtocol ()=default |
| Virtual destructor.
|
bool | ok () const noexcept |
| Checks if the protocol is in a valid operational state.
|
void | not_ok () noexcept |
| Marks the protocol as being in an invalid or non-operational state.
|
void | set_should_flush (bool should_flush) noexcept |
| Sets the flag indicating whether the protocol should flush the input buffer after processing a message.
|
bool | should_flush () const noexcept |
| Gets the flag indicating whether the protocol should flush the input buffer after processing a message.
|
template<typename _IO_, char _EndByte = '\0'>
class qb::protocol::base::byte_terminated< _IO_, _EndByte >
Protocol for messages delimited by a specific single byte character.
This class implements a protocol where messages are framed by a specific termination byte (e.g., '\0' for null-terminated strings, '
' for line-based messages). It inherits from qb::io::async::AProtocol.
- Template Parameters
-
_IO_ | The I/O component type (e.g., a TCP session class) that will use this protocol. It needs to provide an in() method returning a reference to its input buffer (e.g., qb::allocator::pipe<char>). |
_EndByte | The single byte character that marks the end of a message. Defaults to '\0'. |