mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Trigger was refactored to use BooleanEvent when it was introduced in #4104. This reverts to the original implementation until edge-based BooleanEvents can be fixed.
24 lines
548 B
C++
24 lines
548 B
C++
// Copyright (c) FIRST and other WPILib contributors.
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
#include "frc/event/EventLoop.h"
|
|
|
|
using namespace frc;
|
|
|
|
EventLoop::EventLoop() {}
|
|
|
|
void EventLoop::Bind(wpi::unique_function<void()> action) {
|
|
m_bindings.emplace_back(std::move(action));
|
|
}
|
|
|
|
void EventLoop::Poll() {
|
|
for (wpi::unique_function<void()>& action : m_bindings) {
|
|
action();
|
|
}
|
|
}
|
|
|
|
void EventLoop::Clear() {
|
|
m_bindings.clear();
|
|
}
|