libxr 1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
LibXR::ApplicationManager Class Reference

应用模块管理器 More...

#include <app_framework.hpp>

Collaboration diagram for LibXR::ApplicationManager:

Public Member Functions

void Register (Application &app)
 注册一个应用模块
 
void MonitorAll ()
 调用所有模块的 OnMonitor
 
size_t Size ()
 获取模块数量
 

Data Fields

LibXR::List app_list_
 模块链表 / Module list
 

Detailed Description

应用模块管理器

Manager for registering and updating application modules

Definition at line 137 of file app_framework.hpp.

Member Function Documentation

◆ MonitorAll()

void LibXR::ApplicationManager::MonitorAll ( )
inline

调用所有模块的 OnMonitor

Call OnMonitor for all registered modules

Definition at line 158 of file app_framework.hpp.

159 {
160 app_list_.Foreach<Application*>(
161 [](Application* app)
162 {
163 app->OnMonitor();
164 return ErrorCode::OK;
165 });
166 }
LibXR::List app_list_
模块链表 / Module list
ErrorCode Foreach(Func func)
遍历链表中的每个节点,并应用回调函数。 Iterates over each node in the list and applies a callback function.
Definition list.hpp:214
constexpr auto min(T1 a, T2 b) -> typename std::common_type< T1, T2 >::type
计算两个数的最小值

◆ Register()

void LibXR::ApplicationManager::Register ( Application app)
inline

注册一个应用模块

Register an application module

Parameters
app模块实例引用 / Reference to an Application instance

Definition at line 148 of file app_framework.hpp.

149 {
152 }
数据节点模板,继承自 BaseNode,用于存储具体数据类型。 Template data node that inherits from BaseNode to store specific data...
Definition list.hpp:60
void Add(BaseNode &data)
向链表添加一个节点。 Adds a node to the linked list.
Definition list.hpp:143

◆ Size()

size_t LibXR::ApplicationManager::Size ( )
inline

获取模块数量

Get number of registered modules

Returns
模块总数 / Total module count

Definition at line 174 of file app_framework.hpp.

174{ return app_list_.Size(); }
uint32_t Size() noexcept
获取链表中的节点数量。 Gets the number of nodes in the linked list.
Definition list.hpp:158

Field Documentation

◆ app_list_

LibXR::List LibXR::ApplicationManager::app_list_

模块链表 / Module list

Definition at line 140 of file app_framework.hpp.


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