|
libxr
1.0
Want to be the best embedded framework
|
#include <hardware.hpp>
Data Structures | |
| struct | AliasEntry |
| 一条硬件别名记录 One registered hardware-alias record More... | |
Public Member Functions | |
| template<typename... Entries> | |
| constexpr | HardwareContainer (Entries &&... entries) |
| template<typename T > | |
| T * | Find (const char *alias) const |
| template<typename T > | |
| T * | Find (const std::initializer_list< const char * > ALIASES) const |
| template<typename T > | |
| T * | FindOrExit (std::initializer_list< const char * > aliases) const |
| template<typename T > | |
| void | Register (const Entry< T > &entry) |
| 注册一个硬件条目 | |
Protected Attributes | |
| LibXR::LockFreeList | alias_list_ |
| 当前已注册的全部别名链表 / List of all currently registered aliases. | |
硬件容器类 / Hardware container
Each registered alias is stored together with the object's erased pointer and its TypeID, so name lookup and type filtering happen in one pass. 每个注册别名都会连同对象的擦除指针和对应 TypeID 一起存储,因此名称匹配和类型过滤 会在一次遍历里同时完成。
Definition at line 44 of file hardware.hpp.
|
inlineconstexpr |
构造并注册所有别名 / Construct and register aliases
| entries | 硬件条目列表 / Hardware entry list |
Definition at line 52 of file hardware.hpp.
|
inline |
查找设备(单个别名) / Find device by alias
alias 必须非空。 alias must be non-null. Definition at line 63 of file hardware.hpp.
|
inline |
查找设备(多个别名) / Find device with fallback aliases
ALIASES 中的每个别名都必须非空。 Every alias in ALIASES must be non-null. Definition at line 87 of file hardware.hpp.
|
inline |
查找或强约束失败 / Find or REQUIRE if not found
aliases 中的每个别名都必须非空。 Every alias in aliases must be non-null. Definition at line 106 of file hardware.hpp.
|
inline |
注册一个硬件条目
Register a hardware entry
entry.aliases 中的每个别名都必须非空。 Every alias in entry.aliases must be non-null. Definition at line 123 of file hardware.hpp.
|
mutableprotected |
当前已注册的全部别名链表 / List of all currently registered aliases.
Definition at line 147 of file hardware.hpp.