28#ifndef CMSIS_PLUS_POSIX_IO_DEVICE_REGISTRY_H_
29#define CMSIS_PLUS_POSIX_IO_DEVICE_REGISTRY_H_
33#if defined(__cplusplus)
37#if defined(OS_USE_OS_APP_CONFIG_H)
38#include <cmsis-plus/os-app-config.h>
50#pragma GCC diagnostic push
53#pragma clang diagnostic ignored "-Wc++98-compat"
145 static device_list registry_list__;
169 for (
auto&& d : registry_list__)
172 if (std::strcmp (
device->
name (), d.name ()) == 0)
180 registry_list__.link (*
device);
182 trace::printf (
"Device '%s%s' linked.\n", value_type::device_prefix (),
193 assert(path !=
nullptr);
195 auto prefix = value_type::device_prefix ();
196 if (std::strncmp (prefix, path, std::strlen (prefix)) != 0)
203 auto name = path + std::strlen (prefix);
205 for (
auto&& p : registry_list__)
207 if (p.match_name (name))
221#pragma GCC diagnostic push
222#if defined(__clang__)
223#pragma clang diagnostic ignored "-Wexit-time-destructors"
224#pragma clang diagnostic ignored "-Wglobal-constructors"
231#pragma GCC diagnostic pop
241#pragma GCC diagnostic pop
Devices registry static class.
static value_type * identify_device(const char *path)
~device_registry()=delete
static void link(value_type *device)
const char * name(void) const
The core of a double linked list, pointers to next, previous.
int puts(const char *s)
Write the string and a line terminator to the trace device.
int printf(const char *format,...)
Write a formatted string to the trace device.