![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This concrete class implements extends the StreamDecoder implementation to be more efficient with respect to outputting data to a Stream. More...
This concrete class implements extends the StreamDecoder implementation to be more efficient with respect to outputting data to a Stream.
The encoded output data is temporarily cached in RAM and then written to the Stream.
#include <BlockEncoder.h>
Public Member Functions | |
| BlockEncoder (void *blockBuffer, size_t blockSizeInBytes, Cpl::Io::Output *dstPtr, char startOfFrame, char endOfFrame, char escapeChar, bool appendNewline=true) | |
| Constructor. | |
| bool | endFrame () noexcept |
| See Cpl::Text::Frame::Encoder_. | |
Public Member Functions inherited from Cpl::Text::Frame::StreamEncoder | |
| StreamEncoder (Cpl::Io::Output *dstPtr, char startOfFrame, char endOfFrame, char escapeChar, bool appendNewline=true) | |
| Constructor. | |
| void | setOutput (Cpl::Io::Output &newOutfd) noexcept |
| Allow the consumer to change/Set the Output stream handle. Note: No guarantees on what happens if this method is called in the 'middle of a frame'. | |
Public Member Functions inherited from Cpl::Text::Frame::Encoder_ | |
| bool | startFrame (void) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | output (char src) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | output (const char *src) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | output (const char *src, size_t numBytes) noexcept |
| See Cpl::Text::Frame::Encoder. | |
| bool | endFrame (void) noexcept |
| See Cpl::Text::Frame::Encoder. | |
Public Member Functions inherited from Cpl::Text::Frame::Encoder | |
| virtual | ~Encoder () |
| Virtual Destructor. | |
Protected Member Functions | |
| bool | start (char src) noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | start () noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | append (char src) noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | appendToBlock (char src) noexcept |
| Helper method. | |
Protected Member Functions inherited from Cpl::Text::Frame::StreamEncoder | |
| bool | start (char src) noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | start () noexcept |
| See Cpl::Text::Frame::Encoder_. | |
| bool | append (char src) noexcept |
| See Cpl::Text::Frame::Encoder_. | |
Protected Member Functions inherited from Cpl::Text::Frame::Encoder_ | |
| Encoder_ (char startOfFrame, char endOfFrame, char escapeChar, bool appendNewline=true) | |
| Constructor. | |
| virtual char | encodeChar (char charToBeEscaped) |
| Returns the encoded/escaped value for the specified special character. | |
Protected Attributes | |
| uint8_t * | m_buffer |
| Point to the client supplied buffer for a block. | |
| size_t | m_bufferSize |
| Size, in bytes, of the block buffer. | |
| size_t | m_bufferCount |
| Number of bytes currently stored in the block buffer. | |
Protected Attributes inherited from Cpl::Text::Frame::StreamEncoder | |
| Cpl::Io::Output * | m_dstPtr |
| Output stream. | |
Protected Attributes inherited from Cpl::Text::Frame::Encoder_ | |
| bool | m_inFrame |
| Output/Frame state. | |
| const char | m_sof |
| SOF character. | |
| const char | m_eof |
| EOF character. | |
| const char | m_esc |
| Escape character. | |
| const bool | m_appendNewline |
| Remember my newline option. | |
| Cpl::Text::Frame::BlockEncoder::BlockEncoder | ( | void * | blockBuffer, |
| size_t | blockSizeInBytes, | ||
| Cpl::Io::Output * | dstPtr, | ||
| char | startOfFrame, | ||
| char | endOfFrame, | ||
| char | escapeChar, | ||
| bool | appendNewline = true ) |
Constructor.
The Output Stream is not required to be specified at construction time (i.e. 'dstPtr' can be zero). However, the encoder must have a valid Output Stream handle BEFORE the start() method is called. When 'appendNewline' argument is set to true - the encoder will append a newline character to the output stream AFTER the EOF character (this can make for more human readable output stream).
NOTE: If 'startOfFrame' is '\0', then Encoder will begin the frame WITHOUT inserting a SOF character. This is useful when there application desires/has multiple start-of-frame characters for a given frame.
|
protectedvirtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder_.
|
protectednoexcept |
Helper method.
|
virtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder.
|
protectedvirtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder_.
|
protectedvirtualnoexcept |
See Cpl::Text::Frame::Encoder_.
Implements Cpl::Text::Frame::Encoder_.
|
protected |
Point to the client supplied buffer for a block.
|
protected |
Number of bytes currently stored in the block buffer.
|
protected |
Size, in bytes, of the block buffer.