Skip to content

Commit 053ca5c

Browse files
committed
Update documentation
1 parent cba7551 commit 053ca5c

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Common/SimConfig/doc/ConfigurableParam.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ of an algorithm in order to be able to change/configure their value without reco
1717

1818
Imagine some algorithms `algorithmA` depends on 2 parameters `p1` and `p2` which you want to be able to configure.
1919

20-
You would do two steps:
20+
You would do the following steps:
2121
1. Declare a parameter class listing the parameters and their default values.
2222
```c++
2323
struct ParamA : ConfigurableParamHelper<ParamA> {
@@ -26,15 +26,21 @@ You would do two steps:
2626
// boilerplate stuff + make parameters known under key "A"
2727
O2ParamDef(ParamA, "A");
2828
};
29-
2. Access and use the parameters in the code.
30-
```c++
31-
void algorithmA() {
32-
// get the parameter singleton object
33-
auto& pa = ParamA::Instance();
34-
// access the variables in your code
35-
doSomething(pa.p1, pa.p2);
36-
}
37-
```
29+
```
30+
2. Put
31+
```
32+
O2ParamImpl(ParamA);
33+
```
34+
in some source file, to generate necessay symbols needed for linking.
35+
3. Access and use the parameters in the code.
36+
```c++
37+
void algorithmA() {
38+
// get the parameter singleton object
39+
auto& pa = ParamA::Instance();
40+
// access the variables in your code
41+
doSomething(pa.p1, pa.p2);
42+
}
43+
```
3844
3945
Thereafter, the parameter `ParamA` is automatically registered in a parameter registry and can be read/influenced/serialized through this. The main influencing functions are implemented as static functions on the `ConfigurableParam` class. For example, the following things will be possible:
4046
* get a value by string key, addressing a specific parameter:

0 commit comments

Comments
 (0)