@@ -9,46 +9,40 @@ using namespace sdk;
9
9
10
10
class MainReactor : public Reactor {
11
11
public:
12
-
13
- struct DefaultParameters {
12
+ struct Parameters {
14
13
string alias = " Src-Sink-Example" ;
15
14
int n_sinks = 2 ;
16
15
};
17
-
18
- struct Parameters : public SystemParameterWithDefault <DefaultParameters , string, int > {
16
+ private:
17
+ struct PublishParameters : public SystemParameters <Parameters , string, int > {
19
18
REACTOR_PARAMETER (string, alias, " Alternate name" , " another" , " another" , defaults.alias);
20
19
REACTOR_PARAMETER (int , n_sinks, " Sink reactors bank width" , 1 , 10 , defaults.n_sinks);
21
20
22
- // Parameters(Reactor *container)
23
- // : SystemParameter<string, int>(container) {
24
- // register_parameters (alias, n_sinks);
25
- // }
26
-
27
- Parameters (Reactor *container, DefaultParameters &¶m)
28
- : SystemParameterWithDefault<DefaultParameters, string, int >(container, std::forward<DefaultParameters>(param)) {
21
+ PublishParameters (Reactor *container, Parameters &¶m)
22
+ : SystemParameters<Parameters, string, int >(container, std::forward<Parameters>(param)) {
29
23
register_parameters (alias, n_sinks);
30
24
}
31
25
};
26
+ PublishParameters parameters;
32
27
33
- private:
34
- Parameters parameters;
28
+ REACTION_SCOPE_START (MainReactor, PublishParameters)
29
+ void add_reactions (MainReactor *reactor);
30
+ REACTION_SCOPE_END (this , parameters)
35
31
36
32
std::unique_ptr<SourceReactor> src;
37
33
ReactorBank<SinkReactor> snk{" Sink" , this };
38
34
39
35
public:
40
36
MainReactor (const std::string &name, Environment *env)
41
- : Reactor(name, env), parameters{this , DefaultParameters {}} {}
37
+ : Reactor(name, env), parameters{this , Parameters {}} {}
42
38
MainReactor (const std::string &name, Reactor *container)
43
- : Reactor(name, container), parameters{this , DefaultParameters {}} {}
39
+ : Reactor(name, container), parameters{this , Parameters {}} {}
44
40
45
- MainReactor (const std::string &name, Environment *env, DefaultParameters && param)
46
- : Reactor(name, env), parameters{this , std::forward<DefaultParameters >(param)} {}
47
- MainReactor (const std::string &name, Reactor *container, DefaultParameters && param)
48
- : Reactor(name, container), parameters{this , std::forward<DefaultParameters >(param)} {}
41
+ MainReactor (const std::string &name, Environment *env, Parameters && param)
42
+ : Reactor(name, env), parameters{this , std::forward<Parameters >(param)} {}
43
+ MainReactor (const std::string &name, Reactor *container, Parameters && param)
44
+ : Reactor(name, container), parameters{this , std::forward<Parameters >(param)} {}
49
45
50
46
void construction () override ;
51
- void assembling () override ;
52
- };
53
-
54
-
47
+ void wiring () override ;
48
+ };
0 commit comments