54 void IfHigh(std::function<
void()> action);
56 operator std::function<bool()>();
69 [](
EventLoop* loop, std::function<
bool()> condition) {
70 return T(loop, condition);
72 return ctor(m_loop, m_condition);
129 frc::Debouncer::DebounceType::kRising);
133 std::function<bool()> m_condition;
This class provides an easy way to link actions to inputs.
Definition: BooleanEvent.h:31
BooleanEvent Falling()
Get a new event that triggers only when this one newly changes to false.
bool GetAsBoolean() const
Check whether this event is active or not.
BooleanEvent operator!()
Creates a new event that is active when this event is inactive, i.e.
BooleanEvent operator&&(std::function< bool()> rhs)
Composes this event with another event, returning a new event that is active when both events are act...
BooleanEvent Debounce(units::second_t debounceTime, frc::Debouncer::DebounceType type=frc::Debouncer::DebounceType::kRising)
Creates a new debounced event from this event - it will become active when this event has been active...
void IfHigh(std::function< void()> action)
Bind an action to this event.
T CastTo(std::function< T(EventLoop *, std::function< bool()>)> ctor=[](EventLoop *loop, std::function< bool()> condition) { return T(loop, condition);})
A method to "downcast" a BooleanEvent instance to a subclass (for example, to a command-based version...
Definition: BooleanEvent.h:68
BooleanEvent Rising()
Get a new event that events only when this one newly changes to true.
BooleanEvent(EventLoop *loop, std::function< bool()> condition)
Creates a new event with the given condition determining whether it is active.
BooleanEvent operator||(std::function< bool()> rhs)
Composes this event with another event, returning a new event that is active when either event is act...
DebounceType
Definition: Debouncer.h:20
The loop polling BooleanEvent objects and executing the actions bound to them.
Definition: EventLoop.h:15
type
Definition: core.h:575
Definition: AprilTagPoseEstimator.h:15