55 void IfHigh(std::function<
void()> action);
57 operator std::function<bool()>();
70 [](
EventLoop* loop, std::function<
bool()> condition) {
71 return T(loop, condition);
73 return ctor(m_loop, [
state = m_state] {
return *
state; });
132 frc::Debouncer::DebounceType::kRising);
136 std::function<bool()> m_condition;
137 std::shared_ptr<bool> m_state;
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 as of the last loop poll.
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:69
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
Type of debouncing to perform.
Definition: Debouncer.h:23
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition: EventLoop.h:15
state
Definition: core.h:2271
type
Definition: core.h:556
Definition: AprilTagPoseEstimator.h:15