RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
Event.java
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5package org.wpilib.util.concurrent;
6
7import org.wpilib.util.WPIUtilJNI;
8
17public final class Event implements AutoCloseable {
24 public Event(boolean manualReset, boolean initialState) {
25 m_handle = WPIUtilJNI.makeEvent(manualReset, initialState);
26 }
27
33 public Event(boolean manualReset) {
34 this(manualReset, false);
35 }
36
38 public Event() {
39 this(false, false);
40 }
41
42 @Override
43 public void close() {
44 if (m_handle != 0) {
45 WPIUtilJNI.destroyEvent(m_handle);
46 m_handle = 0;
47 }
48 }
49
55 public int getHandle() {
56 return m_handle;
57 }
58
60 public void set() {
61 WPIUtilJNI.setEvent(m_handle);
62 }
63
65 public void reset() {
66 WPIUtilJNI.resetEvent(m_handle);
67 }
68
69 private int m_handle;
70}
Event(boolean manualReset, boolean initialState)
Definition Event.java:24
Event(boolean manualReset)
Definition Event.java:33