13#ifndef CMSIS_PLUS_POSIX_IO_TTY_H_
14#define CMSIS_PLUS_POSIX_IO_TTY_H_
18#if defined (__cplusplus)
22#if defined(OS_USE_OS_APP_CONFIG_H)
23#include <cmsis-plus/os-app-config.h>
32#pragma GCC diagnostic push
34#pragma clang diagnostic ignored "-Wc++98-compat"
49#pragma GCC diagnostic push
51#elif defined(__GNUC__)
52#pragma GCC diagnostic ignored "-Wsuggest-final-methods"
53#pragma GCC diagnostic ignored "-Wsuggest-final-types"
76 operator= (
const tty&) =
delete;
78 operator= (
tty&&) =
delete;
85 ~tty ()
noexcept override;
125#pragma GCC diagnostic pop
129#pragma GCC diagnostic push
130#if defined(__clang__)
131#pragma clang diagnostic ignored "-Wpadded"
132#elif defined(__GNUC__)
133#pragma GCC diagnostic ignored "-Wpadded"
159 operator= (
const tty_impl&) =
delete;
205#pragma GCC diagnostic pop
227 template<
typename ... Args>
299 return static_cast<tty_impl&
> (impl_);
305 template<
typename ... Args>
309 { impl_instance_,
name },
311 { std::forward<Args>(args)... }
313#if defined(OS_TRACE_POSIX_IO_TTY)
314 trace::printf (
"tty_implementable::%s(\"%s\")=@%p\n", __func__, name_,
322#if defined(OS_TRACE_POSIX_IO_TTY)
323 trace::printf (
"tty_implementable::%s() @%p %s\n", __func__,
this,
339#pragma GCC diagnostic pop
const char * name(void) const
virtual ~tty_impl() override
virtual int do_tcsendbreak(int duration)=0
virtual int do_tcgetattr(termios *ptio)=0
virtual int do_tcflush(int queue_selector)=0
virtual int do_isatty(void) final
virtual int do_tcsetattr(int options, const termios *ptio)=0
virtual int do_tcdrain(void)=0
tty_implementable(const char *name, Args &&... args)
virtual ~tty_implementable()
value_type & impl(void) const
virtual int tcdrain(void)
virtual int tcsendbreak(int duration)
virtual int tcgetattr(termios *ptio)
virtual int tcflush(int queue_selector)
virtual int tcsetattr(int options, const termios *ptio)
tty_impl & impl(void) const
virtual ~tty() noexcept override
int printf(const char *format,...)
Write a formatted string to the trace device.
Single file µOS++ RTOS definitions.