RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.event.EventLoop Class Reference

Public Member Functions

 EventLoop ()
void bind (Runnable action)
void bindWeak (Runnable action)
boolean isBound (Runnable action)
void unbind (Runnable action)
void poll ()
void clear ()

Detailed Description

A declarative way to bind a set of actions to a loop and execute them when the loop is polled.

Definition at line 14 of file EventLoop.java.

Constructor & Destructor Documentation

◆ EventLoop()

org.wpilib.event.EventLoop.EventLoop ( )

Default constructor.

Definition at line 22 of file EventLoop.java.

Member Function Documentation

◆ bind()

void org.wpilib.event.EventLoop.bind ( Runnable action)

Bind a new action to run when the loop is polled. The event loop keeps a reference to the action, which will prevent it from being garbage collected. If memory leaks are a concern, consider bindWeak(Runnable).

Parameters
actionthe action to run.

Definition at line 31 of file EventLoop.java.

◆ bindWeak()

void org.wpilib.event.EventLoop.bindWeak ( Runnable action)

Weakly binds a new action to run when the loop is polled. Unlike bind(Runnable), a weakly bound action will not be prevented from being garbage collected.

Parameters
actionthe action to run

Definition at line 45 of file EventLoop.java.

◆ clear()

void org.wpilib.event.EventLoop.clear ( )

Clear all bindings.

Definition at line 88 of file EventLoop.java.

◆ isBound()

boolean org.wpilib.event.EventLoop.isBound ( Runnable action)

Checks if an action is bound to the event loop.

Parameters
actionthe action to check
Returns
true if the action is bound, false if not

Definition at line 58 of file EventLoop.java.

◆ poll()

void org.wpilib.event.EventLoop.poll ( )

Poll all bindings.

Definition at line 78 of file EventLoop.java.

◆ unbind()

void org.wpilib.event.EventLoop.unbind ( Runnable action)

Unbind an action from running when the loop is polled. Has no effect if the given action is not already bound.

Parameters
actionthe action to unbind.

Definition at line 68 of file EventLoop.java.


The documentation for this class was generated from the following file: