DUDS
Distributed Update of Data from Something
duds::hardware::display::TextDisplayBasicBufferedStream< Char, Traits > Class Template Reference

An output stream for buffering writes to TextDisplay objects. More...

#include <TextDisplayStream.hpp>

Inheritance diagram for duds::hardware::display::TextDisplayBasicBufferedStream< Char, Traits >:
Collaboration diagram for duds::hardware::display::TextDisplayBasicBufferedStream< Char, Traits >:

Public Member Functions

 TextDisplayBasicBufferedStream (const std::shared_ptr< TextDisplay > &d)
 Makes an output stream that writes to a buffer, and writes that buffer to the given display when flushed. More...
 
- Public Member Functions inherited from duds::hardware::display::TextDisplayBaseStream< Char, Traits >
 TextDisplayBaseStream (TextDisplayBasicStreambuf< Char, Traits > *tbuf)
 Makes an output stream that writes to the given display. More...
 
void clearDisplay ()
 Remove all text from the display and place the cursor in the upper left corner. More...
 
void clearTo (unsigned int c, unsigned int r)
 Clear text from the current cursor position to the given position, inclusive. More...
 
const std::shared_ptr< TextDisplay > & display () const
 Returns the output display. More...
 
void moveCursor (unsigned int c, unsigned int r)
 Moves the display's cursor to the given location. More...
 
void startLine ()
 Moves the cursor to the start of a line clearing text along the way. More...
 

Private Attributes

TextDisplayBasicBufferedStreambuf< Char, Traits > buff
 The buffer handling the output. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from duds::hardware::display::TextDisplayBaseStream< Char, Traits >
static int xallocIndex ()
 Returns the index from xalloc(); needed by the stream manipulators. More...
 

Detailed Description

template<class Char, class Traits = std::char_traits<Char>>
class duds::hardware::display::TextDisplayBasicBufferedStream< Char, Traits >

An output stream for buffering writes to TextDisplay objects.

It supports the use of stream modifiers intended specifically for use with TextDisplay. Stream seeking is supported, but repositioning the display's cursor may be easier to manage. Data is not written to the display until the stream is flushed.

Note
Output to this stream may be incorrect unless all output to the display is done through this stream. None of the TextDisplay::write() functions should be called on the display except through this stream's TextDisplayBufferedStreambuf object.
Thread safety (from TextDisplayBufferedStreambuf)
Objects of this type are thread-safe for the case of exactly two threads: one writing new text, and another thread that flushes the stream. The thread that flushes will handle outputing text changes to the display. The other thread that writes new text will not be stalled by the display output. Using two threads is not a requirement.
Author
Jeff Jackowski

Definition at line 542 of file TextDisplayStream.hpp.

Constructor & Destructor Documentation

◆ TextDisplayBasicBufferedStream()

template<class Char , class Traits = std::char_traits<Char>>
duds::hardware::display::TextDisplayBasicBufferedStream< Char, Traits >::TextDisplayBasicBufferedStream ( const std::shared_ptr< TextDisplay > &  d)
inline

Makes an output stream that writes to a buffer, and writes that buffer to the given display when flushed.

Parameters
dThe display that will receive output.
Precondition
The display is initialzied and ready to accept data.

Definition at line 554 of file TextDisplayStream.hpp.

Member Data Documentation

◆ buff

template<class Char , class Traits = std::char_traits<Char>>
TextDisplayBasicBufferedStreambuf<Char, Traits> duds::hardware::display::TextDisplayBasicBufferedStream< Char, Traits >::buff
private

The buffer handling the output.

Definition at line 546 of file TextDisplayStream.hpp.


The documentation for this class was generated from the following file: