| Line |
Branch |
Decision |
Call |
Exec |
Source |
| 1 |
|
|
|
|
#ifndef CHRYSALIS_EXPRESSION_H |
| 2 |
|
|
|
|
#define CHRYSALIS_EXPRESSION_H |
| 3 |
|
|
|
|
|
| 4 |
|
|
|
|
#include "BaseNamedElement.h" |
| 5 |
|
|
|
|
#include "ScopedNamedElementsContainer.h" |
| 6 |
|
|
|
|
#include "arguments/BaseCalculatedArgument.h" |
| 7 |
|
|
|
|
|
| 8 |
|
|
|
|
namespace Chrysalis { |
| 9 |
|
|
|
|
struct ExpressionValue { |
| 10 |
|
|
|
|
explicit operator double() const; |
| 11 |
|
|
|
|
double value; |
| 12 |
|
|
|
|
}; |
| 13 |
|
|
|
|
class Expression: public BaseNamedElement, public BaseCalculatedArgument<ExpressionValue> { |
| 14 |
|
|
13/13
✓ 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.
|
6 |
PROVIDE_DEFAULT_SERIALIZATION_ACCESS(Expression) |
| 15 |
|
|
10/10
✓ 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.
|
24 |
SERIALIZE_DERIVED_FROM(BaseNamedElement, expression_) |
| 16 |
|
|
|
|
public: |
| 17 |
|
|
|
|
explicit Expression(const std::string& name, args::number&& expression); |
| 18 |
|
|
|
|
protected: |
| 19 |
|
|
|
|
std::expected<ExpressionValue, Error> calculate() const override; |
| 20 |
|
|
|
|
private: |
| 21 |
|
|
|
|
args::number expression_; |
| 22 |
|
|
|
|
}; |
| 23 |
|
|
|
|
using ExpressionsContainer = ScopedNamedElementsContainer<Expression>; |
| 24 |
|
|
|
|
} |
| 25 |
|
|
|
|
|
| 26 |
|
|
|
|
#endif //CHRYSALIS_EXPRESSION_H |
| 27 |
|
|
|
|
|