OpenMPTL - Helper Library
C++ Microprocessor Template Library
|
Simple vt100-like terminal. More...
#include <terminal.hpp>
Public Types | |
using | stream_device_type = Tp |
using | char_type = typename stream_device_type::fifo_type::char_type |
using | tx_stream_type = fifo_stream< typename stream_device_type::fifo_type, stream_device_type > |
using | resources = typename stream_device_type::resources |
Public Member Functions | |
terminal () | |
void | open () const |
void | close () |
template<typename cmd_hooks > | |
void | process_input (void) |
Public Attributes | |
tx_stream_type | tx_stream |
Static Public Attributes | |
static constexpr bool | terminal_echo = _terminal_echo |
static constexpr const char * | newline = "\r\n" |
static constexpr const char * | prompt = "# " |
static constexpr std::size_t | cmd_buf_size = 80 |
Parses and executes commands from mptl::terminal_hook_list<...>, and accepts simple single-word commands (see process_input()).
Operates on mptl::fifo_stream<> for input/output, and provides a very basic stream interface from poorman::ostream<>:
mptl::terminal<...> term; term.tx_stream << "hello, var=" << myvar << poorman::endl;
Template arguments:
using mptl::terminal< Tp, _terminal_echo >::char_type = typename stream_device_type::fifo_type::char_type |
using mptl::terminal< Tp, _terminal_echo >::resources = typename stream_device_type::resources |
using mptl::terminal< Tp, _terminal_echo >::stream_device_type = Tp |
using mptl::terminal< Tp, _terminal_echo >::tx_stream_type = fifo_stream< typename stream_device_type::fifo_type, stream_device_type > |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
static |
|
static |
|
static |
tx_stream_type mptl::terminal< Tp, _terminal_echo >::tx_stream |