Chrysalis - Pattern Test Coverage


pattern/
File: pattern/include/Parameter.h
Date: 2026-08-27 18:35:18
Lines:
2/2
100.0%
Functions:
3/3
100.0%
Branches:
0/0
-%
Decisions:
0/0
-%
Calls:
32/32
100.0%

Line Branch Decision Call Exec Source
1 #ifndef CHRYSALIS_PARAMETER_H
2 #define CHRYSALIS_PARAMETER_H
3
4 #include "BaseNamedElement.h"
5 #include "NamedElementsContainer.h"
6 #include "observers/BaseObservable.h"
7 #include "observers/ParameterObserver.h"
8
9 namespace Chrysalis {
10 class Parameter: public BaseNamedElement, public BaseObservable<ParameterObserver> {
11
17/17
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
✓ Call 9 invoked.
✓ Call 10 invoked.
✓ Call 11 invoked.
✓ Call 12 invoked.
✓ Call 13 invoked.
✓ Call 14 invoked.
✓ Call 15 invoked.
✓ Call 16 invoked.
24 PROVIDE_DEFAULT_SERIALIZATION_ACCESS(Parameter)
12
15/15
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
✓ Call 5 invoked.
✓ Call 6 invoked.
✓ Call 7 invoked.
✓ Call 8 invoked.
✓ Call 9 invoked.
✓ Call 10 invoked.
✓ Call 11 invoked.
✓ Call 12 invoked.
✓ Call 13 invoked.
✓ Call 14 invoked.
96 SERIALIZE_DERIVED_FROM(BaseNamedElement, value_, defaultValue_)
13 public:
14 explicit Parameter(const std::string& name);
15
16 static Parameter* create(const std::string& name, double value);
17 static Parameter* createDefault(const std::string& name, double defaultValue);
18
19 [[nodiscard]] bool isValid() const;
20 [[nodiscard]] bool hasValue() const;
21 [[nodiscard]] bool hasDefaultValue() const;
22
23 [[nodiscard]] double getValue() const;
24 [[nodiscard]] double getDefaultValue() const;
25
26 void setValue(double value);
27 void setDefaultValue(double defaultValue);
28 private:
29 boost::optional<double> value_;
30 boost::optional<double> defaultValue_;
31 };
32 using ParametersContainer = NamedElementsContainer<Parameter>;
33 }
34
35 #endif //CHRYSALIS_PARAMETER_H
36