31#if !defined(MICRO_OS_PLUS_DIAG_TRACE_H_)
32#error "Do not include this file directly; use micro-os-plus/diag/trace.h."
37#ifndef MICRO_OS_PLUS_DIAG_TRACE_CPP_API_H_
38#define MICRO_OS_PLUS_DIAG_TRACE_CPP_API_H_
42#if defined(__cplusplus)
98#pragma GCC diagnostic push
100#if defined(__clang__)
101#pragma clang diagnostic ignored "-Wpre-c++17-compat"
108#pragma GCC diagnostic push
110#if defined(__clang__)
111#pragma clang diagnostic ignored "-Wc++98-compat"
112#pragma clang diagnostic ignored "-Wc++98-c++11-c++14-compat"
148 write (
const void* buf, std::size_t nbyte)
noexcept;
163 flush (
void)
noexcept;
182 printf (
const char* format, ...)
noexcept;
200 vprintf (
const char* format, std::va_list arguments)
noexcept;
215 puts (
const char* s =
"")
noexcept;
248 dump_args (
int argc,
char* argv[],
const char* name =
"main")
noexcept;
251#pragma GCC diagnostic pop
257#if defined(MICRO_OS_PLUS_DIAG_TRACE_ENABLED)
264#pragma GCC diagnostic push
266#if defined(__clang__)
267#pragma clang diagnostic ignored "-Wc++98-compat"
333 write (
const void* buf, std::size_t nbyte)
noexcept;
372 template <
typename T>
374 { T::initialise () }
noexcept -> std::same_as<void>;
375 { T::write (buf, n) }
noexcept -> std::same_as<ssize_t>;
376 { T::flush () }
noexcept -> std::same_as<void>;
402 template <trace_policy T>
453 write (
const void* buf, std::size_t nbyte)
noexcept
455 return T::write (buf, nbyte);
500 printf (
const char* format, ...) noexcept
501 __attribute__ ((format (
printf, 1, 2)));
522 vprintf (const
char* format, std::va_list arguments) noexcept;
539 puts (const
char* s =
"") noexcept;
573 dump_args (
int argc,
char* argv[], const
char* name =
"main") noexcept;
583#pragma GCC diagnostic push
585#if defined(__clang__)
586#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
593#pragma GCC diagnostic pop
598#pragma GCC diagnostic pop
609#pragma GCC diagnostic pop
Policy class for the production trace instance.
static void initialise(void) noexcept
Initialise the trace output channel.
static ssize_t write(const void *buf, std::size_t nbyte) noexcept
Write the given number of bytes to the trace output channel.
static void flush(void) noexcept
Flush the trace output channel.
Tracing API bound to a given policy class.
static void initialise(void) noexcept
Initialise the trace output channel.
tracer()=delete
Deleted default constructor.
static int printf(const char *format,...) noexcept
Write a formatted string to the trace output channel.
static ssize_t write(const void *buf, std::size_t nbyte) noexcept
Write the given number of bytes to the trace output channel.
static void flush(void) noexcept
Flush the trace output channel.
Concept constraining the policy class T used by tracer<T>.
C++ header file with the inline implementations for the tracer class template.
void initialise(void) noexcept
Initialise the trace output channel.
ssize_t write(const void *buf, std::size_t nbyte) noexcept
Write the given number of bytes to the trace output channel.
void flush(void) noexcept
Flush the trace output channel.
int printf(const char *format,...) noexcept
Write a formatted string to the trace output channel.
int puts(const char *s="") noexcept
Write the string and a line terminator to the trace output channel.
int putchar(int c) noexcept
Write the single character to the trace output channel.
int vprintf(const char *format, std::va_list arguments) noexcept
Write a formatted variable arguments list to the trace output channel.
Implementation details namespace.
Tracing support namespace.