-
Notifications
You must be signed in to change notification settings - Fork 0
[Just for review]add dynamic reset node interface #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| Graph(Graph &&rhs) = default; | ||
|
|
||
| private: | ||
| private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这行不用改缩进
bmf/engine/connector/src/builder.cpp
Outdated
|
|
||
| void RealNode::SetAction(std::string const &action) { | ||
| action_ = action; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builder层应该不需要Set方法 直接修改变量值就可以 你看下相关代码确认下
bmf/engine/connector/src/builder.cpp
Outdated
| // 添加action字段输出 | ||
| if (!action_.empty()) { | ||
| info["action"] = action_; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只有一行逻辑可以不需要大括号 简化为
if (!action_.empty())
info["action"] = action_;
bmf/engine/connector/src/builder.cpp
Outdated
| // 获取更新图的配置 | ||
| auto graph_config = update_graph->Dump(); | ||
|
|
||
| std::string config_str = graph_config.dump(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该可以简化为
std::string config_str = to_string(update_graph->Dump());
bmf/engine/connector/src/builder.cpp
Outdated
| return 0; | ||
| } | ||
|
|
||
| void RealGraph::DynamicResetNode(const bmf_sdk::JsonParam& node_config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
接口名改成DynamicReset
bmf/engine/connector/src/builder.cpp
Outdated
| // 在当前图中创建重置节点 | ||
| std::vector<std::shared_ptr<RealStream>> empty_inputs; | ||
| auto reset_node = AddModule(alias, bmf_sdk::JsonParam(node_config.json_value_), | ||
| empty_inputs, "", Python, "", "", Immediate, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty_inputs看起来是多余的 可以直接用{}代替
No description provided.