Chrysalis - Pattern Test Coverage


pattern/
File: pattern/include/Option.h
Date: 2026-08-27 18:35:18
Lines:
5/5
100.0%
Functions:
3/3
100.0%
Branches:
0/0
-%
Decisions:
0/0
-%
Calls:
22/22
100.0%

Line Branch Decision Call Exec Source
1 #ifndef CHRYSALIS_OPTION_H
2 #define CHRYSALIS_OPTION_H
3
4 #include "BaseNamedElement.h"
5 #include "arguments/Argument.h"
6 #include "ScopedNamedElementsContainer.h"
7
8 namespace Chrysalis {
9 struct OptionValue {
10 explicit operator bool() const;
11 bool value;
12 };
13 class Option: public BaseNamedElement, public Argument<OptionValue> {
14
12/12
✓ 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.
4 explicit Option(): Argument({false}) {};
15 friend boost::serialization::access;
16 template <class Archive>
17 16 void serialize(Archive& archive, const unsigned int) {
18
5/5
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
16 archive & boost::serialization::base_object<BaseNamedElement>(*this);
19
5/5
✓ Call 0 invoked.
✓ Call 1 invoked.
✓ Call 2 invoked.
✓ Call 3 invoked.
✓ Call 4 invoked.
16 archive & boost::serialization::base_object<Argument>(*this);
20 16 }
21 public:
22 explicit Option(const std::string& name);
23 static Option* createDefault(const std::string& name, bool isEnabled);
24
25 void toggle();
26 };
27 using OptionsContainer = ScopedNamedElementsContainer<Option>;
28 }
29
30 #endif //CHRYSALIS_OPTION_H
31