Package edu.wpi.first.wpilibj
Class InterruptHandlerFunction<T>
- java.lang.Object
-
- edu.wpi.first.wpilibj.InterruptHandlerFunction<T>
-
- Type Parameters:
T
- The type of the parameter that should be returned to the the methodinterruptFired(int, Object)
public abstract class InterruptHandlerFunction<T> extends Object
It is recommended that you use this class in conjunction with classes fromjava.util.concurrent.atomic
as these objects are all thread safe.
-
-
Constructor Summary
Constructors Constructor Description InterruptHandlerFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
interruptFired(int interruptAssertedMask, T param)
This method is run every time an interrupt is fired.T
overridableParameter()
Override this method if you would like to pass a specific parameter to theinterruptFired(int, Object)
when it is fired by the interrupt.
-
-
-
Method Detail
-
interruptFired
public abstract void interruptFired(int interruptAssertedMask, T param)
This method is run every time an interrupt is fired.- Parameters:
interruptAssertedMask
- Interrupt Maskparam
- The parameter provided by overriding theoverridableParameter()
method.
-
overridableParameter
public T overridableParameter()
Override this method if you would like to pass a specific parameter to theinterruptFired(int, Object)
when it is fired by the interrupt. This method is called once whenInterruptableSensorBase.requestInterrupts(InterruptHandlerFunction)
is run.- Returns:
- The object that should be passed to the interrupt when it runs
-
-