|
DUDS
|
Distributed Update of Data from Something
|
Writes output from a stream into an internal buffer, and writes that buffer to the display when sync() is called. More...
#include <TextDisplayStream.hpp>
Public Member Functions | |
| TextDisplayBasicBufferedStreambuf (const std::shared_ptr< TextDisplay > &d) | |
| Makes the stream buffer with a display for output. More... | |
| virtual void | clearDisplay () |
| Remove all text from the display and place the cursor in the upper left corner. More... | |
| virtual void | clearTo (unsigned int c, unsigned int r) |
| Clear text from the current cursor position to the given position, inclusive. More... | |
| virtual unsigned int | column () const |
| Returns the cursos's column position. More... | |
| virtual void | moveCursor (unsigned int c, unsigned int r) |
| Moves the display's cursor to the given location. More... | |
| virtual unsigned int | row () const |
| Returns the cursos's row position. More... | |
| virtual void | startLine () |
| Moves the cursor to the start of a line clearing text along the way. More... | |
Public Member Functions inherited from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits > | |
| TextDisplayBasicStreambuf (const std::shared_ptr< TextDisplay > &d) | |
| Makes the stream buffer with a display for output. More... | |
| const std::shared_ptr< TextDisplay > & | display () const |
| Returns the output display. More... | |
Protected Member Functions | |
| virtual Traits::int_type | overflow (typename Traits::int_type c=Traits::eof()) |
| Writes a character to the start of the display after wrapping around from the end. More... | |
| virtual base::pos_type | seekoff (typename base::off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which=std::ios_base::out) |
| virtual base::pos_type | seekpos (typename base::pos_type pos, std::ios_base::openmode which=std::ios_base::out) |
| virtual int | sync () |
| virtual std::streamsize | xsputn (const Char *s, std::streamsize count) |
Private Types | |
| using | base = TextDisplayBasicStreambuf< Char, Traits > |
Private Member Functions | |
| void | bufWrite (Char c) |
| Handles writing a character into the buffer or moving the cursor for new lines and carriage returns. More... | |
| void | clearToImpl (unsigned int c, unsigned int r) |
| Clears a portion of the buffer with spaces from the current cursor position to the indicated position. More... | |
| void | write (Char c) |
| Internal function to write a printable character to the buffer. More... | |
Private Attributes | |
| std::uint8_t | columnsize |
| Number of columns on the display. More... | |
| std::uint8_t | cpos |
| Cursor column position. More... | |
| std::uint8_t | rowsize |
| Number of rows on the display. More... | |
| std::uint8_t | rpos |
| Cursor row position. More... | |
| std::vector< Char > | shown |
| The buffer currently shown by the display. More... | |
| std::vector< Char > | update |
| The buffer that is being written to the display. More... | |
| duds::general::Spinlock | wblock |
| Write block. More... | |
| std::vector< Char > | working |
| The buffer that accepts new data. More... | |
Writes output from a stream into an internal buffer, and writes that buffer to the display when sync() is called.
Only changes are written to the display, and the display is only updated when sync() is called. Using std::endl with the output stream, or calling flush on the stream, will cause a call to sync().
Definition at line 155 of file TextDisplayStream.hpp.
|
private |
Definition at line 157 of file TextDisplayStream.hpp.
|
inline |
Makes the stream buffer with a display for output.
| d | The display that will take the output. |
Definition at line 356 of file TextDisplayStream.hpp.
|
inlineprivate |
Handles writing a character into the buffer or moving the cursor for new lines and carriage returns.
Definition at line 232 of file TextDisplayStream.hpp.
|
inlinevirtual |
Remove all text from the display and place the cursor in the upper left corner.
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 387 of file TextDisplayStream.hpp.
|
inlinevirtual |
Clear text from the current cursor position to the given position, inclusive.
The cursor will be moved to the spot immediately after the given position.
| c | The end column. |
| r | The end row. |
| TextDisplayRangeError | The requested position is beyond the display's boundries. |
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 395 of file TextDisplayStream.hpp.
|
inlineprivate |
Clears a portion of the buffer with spaces from the current cursor position to the indicated position.
The cursor will be moved to the spot immediately after the given position.
| c | The end column. |
| r | The end row. |
Definition at line 222 of file TextDisplayStream.hpp.
|
inlinevirtual |
Returns the cursos's column position.
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 367 of file TextDisplayStream.hpp.
|
inlinevirtual |
Moves the display's cursor to the given location.
| c | The destination column. |
| r | The destination row. |
| TextDisplayRangeError | The requested position is beyond the display's boundries. |
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 373 of file TextDisplayStream.hpp.
|
inlineprotectedvirtual |
Writes a character to the start of the display after wrapping around from the end.
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 255 of file TextDisplayStream.hpp.
|
inlinevirtual |
Returns the cursos's row position.
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 370 of file TextDisplayStream.hpp.
|
inlineprotectedvirtual |
Definition at line 306 of file TextDisplayStream.hpp.
|
inlineprotectedvirtual |
Definition at line 344 of file TextDisplayStream.hpp.
|
inlinevirtual |
Moves the cursor to the start of a line clearing text along the way.
If the cursor is already at the start of a line, it will not move and no text will be cleared.
Reimplemented from duds::hardware::display::TextDisplayBasicStreambuf< Char, Traits >.
Definition at line 406 of file TextDisplayStream.hpp.
|
inlineprotectedvirtual |
Definition at line 272 of file TextDisplayStream.hpp.
|
inlineprivate |
Internal function to write a printable character to the buffer.
Definition at line 199 of file TextDisplayStream.hpp.
|
inlineprotectedvirtual |
Definition at line 265 of file TextDisplayStream.hpp.
|
private |
Number of columns on the display.
Sizes included here because they reduce calls to the display through a shared pointer, and 4 byte memory alignment prevents their inclusion from needing more memory.
Definition at line 180 of file TextDisplayStream.hpp.
|
private |
Cursor column position.
Definition at line 191 of file TextDisplayStream.hpp.
|
private |
Number of rows on the display.
Sizes included here because they reduce calls to the display through a shared pointer, and 4 byte memory alignment prevents their inclusion from needing more memory.
Definition at line 187 of file TextDisplayStream.hpp.
|
private |
Cursor row position.
Definition at line 195 of file TextDisplayStream.hpp.
|
private |
The buffer currently shown by the display.
Definition at line 161 of file TextDisplayStream.hpp.
|
private |
The buffer that is being written to the display.
Definition at line 165 of file TextDisplayStream.hpp.
|
private |
Write block.
Definition at line 173 of file TextDisplayStream.hpp.
|
private |
The buffer that accepts new data.
Definition at line 169 of file TextDisplayStream.hpp.