| Line | Branch | Decision | Call | Exec | Source |
|---|---|---|---|---|---|
| 1 | #ifndef CHRYSALIS_CONDITIONALARGUMENT_H | ||||
| 2 | #define CHRYSALIS_CONDITIONALARGUMENT_H | ||||
| 3 | |||||
| 4 | #include "arguments/BaseArgument.h" | ||||
| 5 | #include "arguments/BaseCalculatedArgument.h" | ||||
| 6 | |||||
| 7 | /** @defgroup Arguments Arguments | ||||
| 8 | * @{ | ||||
| 9 | */ | ||||
| 10 | namespace Chrysalis { | ||||
| 11 | class ConditionalArgument: public BaseCalculatedArgument<double> { | ||||
| 12 | PROVIDE_SERIALIZATION_ACCESS(ConditionalArgument) | ||||
| 13 | public: | ||||
| 14 | explicit ConditionalArgument(const args::condition* condition, | ||||
| 15 | args::number&& positive, args::number&& negative); | ||||
| 16 | ~ConditionalArgument() override; | ||||
| 17 | protected: | ||||
| 18 | std::expected<double, Error> calculate() const override; | ||||
| 19 | private: | ||||
| 20 | const args::condition* condition_; | ||||
| 21 | args::number positive_; | ||||
| 22 | args::number negative_; | ||||
| 23 | }; | ||||
| 24 | 20 | SERIALIZE_DERIVED_CONSTRUCTION(ConditionalArgument, BaseCalculatedArgument<double>, condition_, positive_, negative_) | |||
| 25 | namespace args { | ||||
| 26 | using conditional = ConditionalArgument; | ||||
| 27 | } | ||||
| 28 | } | ||||
| 29 | /**@}*/ | ||||
| 30 | |||||
| 31 | #endif //CHRYSALIS_CONDITIONALARGUMENT_H | ||||
| 32 |