diag-trace 5.0.0
µOS++ Tracing Infrastructure
Loading...
Searching...
No Matches
micro_os_plus::trace::detail::implementation Class Reference

Policy class for the production trace instance. More...

#include <micro-os-plus/diag/trace.h>

Static Public Member Functions

static void flush (void) noexcept
 Flush the trace output channel.
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.

Detailed Description

The user must provide a definition of initialise(), write(), and flush() for this class (typically in a single .cpp file, once per application/platform).

implementation is not a template; it has no member data and is never instantiated as an object. Its static methods are looked up by tracer<implementation> and are otherwise ordinary, non-template member functions, so there is no instantiation-order hazard between their declaration here and their definition elsewhere.

Definition at line 289 of file trace-cpp-api.h.

Member Function Documentation

◆ flush()

void micro_os_plus::trace::detail::implementation::flush ( void )
staticnoexcept
Parameters
None.
Returns
Nothing.

The user must provide a definition of this method. For buffered output channels, it must drain any internally buffered data to the output device. For unbuffered or character-mode channels (e.g. ITM), the body can be left empty.

◆ initialise()

void micro_os_plus::trace::detail::implementation::initialise ( void )
staticnoexcept
Parameters
None.
Returns
Nothing.

The user must provide a definition of this method, called once during startup to configure the underlying output device (e.g. a semihosting channel, or ITM port).

◆ write()

ssize_t micro_os_plus::trace::detail::implementation::write ( const void * buf,
std::size_t nbyte )
staticnoexcept
Parameters
bufAn array of bytes.
nbyteThe number of bytes in the array.
Returns
The number of bytes actually transferred, or -1 if error. May be less than nbyte if the device is full.

The user must provide a definition of this method. It is the core output primitive; all higher-level functions (printf, puts, putchar) ultimately delegate to it.


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