Skip to content

Commit cda73b4

Browse files
committed
feat(flow): 给ActionExecutor也加上util::Variables变量
1 parent 2516bd7 commit cda73b4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/flow/action_executor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ActionExecutor::ActionId ActionExecutor::append(Action *action, int prio) {
4747
};
4848
action_deque_array_.at(prio).push_back(item);
4949
action->setFinishCallback([this](bool, const Action::Reason &, const Action::Trace &) { schedule(); });
50+
action->vars().setParent(&vars_);
5051
schedule();
5152
return item.id;
5253
}

modules/flow/action_executor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <array>
2525
#include <tbox/base/defines.h>
2626
#include <tbox/event/loop.h>
27+
#include <tbox/util/variables.h>
2728

2829
namespace tbox {
2930
namespace flow {
@@ -81,6 +82,8 @@ class ActionExecutor {
8182
void setActionFinishedCallback(const ActionCallback &cb) { action_finished_cb_ = cb; }
8283
void setAllFinishedCallback(const Callback &cb) { all_finished_cb_ = cb; }
8384

85+
inline util::Variables& vars() { return vars_; }
86+
8487
private:
8588
ActionId allocActionId();
8689
void schedule();
@@ -100,6 +103,8 @@ class ActionExecutor {
100103
Callback all_finished_cb_;
101104

102105
int cb_level_ = 0;
106+
107+
util::Variables vars_;
103108
};
104109

105110
}

0 commit comments

Comments
 (0)