Class LeaveRangeEvaluator
Defined in File condition_evaluator.hpp
Inheritance Relationships
Base Type
public ros2_medkit_gateway::ConditionEvaluator(Class ConditionEvaluator)
Class Documentation
-
class LeaveRangeEvaluator : public ros2_medkit_gateway::ConditionEvaluator
Fires when a numeric value transitions from inside [lower_bound, upper_bound] to outside the range. Both bounds are inclusive. First evaluation (no previous) returns false (needs transition). Requires params: {“lower_bound”: number, “upper_bound”: number}
Public Functions
-
inline virtual bool evaluate(const std::optional<nlohmann::json> &previous, const nlohmann::json ¤t, const nlohmann::json ¶ms) const override
Evaluate whether the condition is met.
- Parameters:
previous – The previous value (nullopt on first evaluation)
current – The current value
params – Condition-specific parameters (e.g., target_value, bounds)
- Pre:
validate_params(params) must have returned success before calling evaluate.
- Returns:
true if the condition is met and the trigger should fire
-
inline virtual tl::expected<void, std::string> validate_params(const nlohmann::json ¶ms) const override
Validate condition parameters before a trigger is created.
- Parameters:
params – The parameters to validate
- Returns:
void on success, error string on failure
-
inline virtual bool evaluate(const std::optional<nlohmann::json> &previous, const nlohmann::json ¤t, const nlohmann::json ¶ms) const override