devicesbus stage
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
// 功能 :定义有效载荷引用 包含数据块、偏移量、长度
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// 定义管道上下文 包含设备ID、端点、时间戳、协议提示、跟踪ID、有效载荷、有效载荷大小
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ void PipelineEngine::setPluginManager(std::shared_ptr<softbus::core::plugin_syst
|
||||
m_pluginManager = std::move(pluginManager);
|
||||
}
|
||||
|
||||
// 管道引擎运行线程 从 ingress 队列中取出数据 进行处理 然后推送到 egress 队列中
|
||||
void PipelineEngine::run()
|
||||
{
|
||||
while (m_running.load()) {
|
||||
@@ -77,9 +78,13 @@ void PipelineEngine::run()
|
||||
}
|
||||
|
||||
const bool framed = stage1Framer(ctx);
|
||||
// 帧解析
|
||||
const bool parsed = framed && stage2Parser(ctx);
|
||||
// 过滤
|
||||
const bool filtered = parsed && stage3Filter(ctx);
|
||||
// 验证
|
||||
const bool valid = filtered && stage4Validator(ctx);
|
||||
// 如果验证失败 则记录错误
|
||||
if (!valid) {
|
||||
++m_counters.error;
|
||||
continue;
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
// 定义管道引擎 包含队列、运行状态、工作线程、计数器、插件管理器
|
||||
// 队列是用来存储管道上下文的
|
||||
// 运行状态是用来控制引擎的运行和停止的
|
||||
// 工作线程是用来处理管道上下文的
|
||||
// 计数器是用来统计管道上下文的数量和错误数量的
|
||||
// 插件管理器是用来管理插件的
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
|
||||
Reference in New Issue
Block a user