|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
Trigger that runs its actions when its predicate holds for the state: the general trigger, of which WhenEss and WhenSize are two. More...
#include <EmrysFilter/Distributions/Upkeep.h>
Public Member Functions | |
| When (Predicate test, Actions... toRun) | |
| Runs toRun, in order, when test holds for the state. | |
| template<typename State> requires internal::UpkeepTest<Predicate, State const &> && (UpkeepOperation<Actions, State> && ...) | |
| std::expected< bool, WeightError > | operator() (State &state) const |
| Tests state and runs the actions on it if the test holds. | |
Public Attributes | |
| Predicate | predicate |
| the test of the state | |
| std::tuple< Actions... > | actions |
| run in order when the test holds | |
Trigger that runs its actions when its predicate holds for the state: the general trigger, of which WhenEss and WhenSize are two.
The predicate is called with the state, as a const reference, and returns a bool, or an std::expected<bool, WeightError> for a test that can fail, whose error the trigger returns without running anything. The actions are called with the state alone, in order, and stop at the first error, which the trigger returns; actions that ran before it keep their effect.
|
inlinenodiscard |
Tests state and runs the actions on it if the test holds.