File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
examples/sdk-WorkersParams Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -56,16 +56,12 @@ class Relay : public Reactor {
5656 Relay (const std::string &name, Reactor *container, Parameters &¶m)
5757 : Reactor(name, container), parameters{std::forward<Parameters>(param)} {}
5858
59- class Internals : public ReactionInternals < Relay, Parameters> {
59+ REACTION_SCOPE_START ( Relay, Parameters)
6060 const int &n_outputs = parameters.n_outputs;
6161
6262 int index = 0 ;
6363 int *busy = 0 ;
6464
65- public:
66- Internals (Reactor *reactor, Parameters ¶ms)
67- : ReactionInternals<Relay, Parameters>(reactor, params) {}
68-
6965 void add_reactions (Relay *reactor) override {
7066 reaction (" reaction_1" ).
7167 triggers (&reactor->startup ).
@@ -134,9 +130,7 @@ class Relay : public Reactor {
134130 }
135131 );
136132 }
137- };
138-
139- Internals reaction_internals{this , parameters};
133+ REACTION_SCOPE_END (this , parameters)
140134
141135 void construction () override {
142136 out_req.set_width (n_outputs);
Original file line number Diff line number Diff line change @@ -300,4 +300,15 @@ public:
300300 void request_stop () { reactor_->environment ()->sync_shutdown (); }
301301};
302302
303+ #define REACTION_SCOPE_START (ReactorType, ParamType ) \
304+ class Internals : public ReactionInternals <ReactorType, ParamType> { \
305+ public: \
306+ Internals (Reactor *reactor, ParamType ¶ms) \
307+ : ReactionInternals<ReactorType, ParamType>(reactor, params) {} \
308+ private:
309+
310+ #define REACTION_SCOPE_END (reactor, param ) \
311+ }; \
312+ Internals reaction_internals{reactor, param};
313+
303314} // namespace sdk
You can’t perform that action at this time.
0 commit comments