mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Move HAL classes to their own base package (#1317)
Needed for modularization.
This commit is contained in:
committed by
Peter Johnson
parent
0068b6aea3
commit
e210073044
34
hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java
Normal file
34
hal/src/main/java/edu/wpi/first/hal/JNIWrapper.java
Normal file
@@ -0,0 +1,34 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
package edu.wpi.first.hal;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import edu.wpi.first.wpiutil.RuntimeLoader;
|
||||
|
||||
/**
|
||||
* Base class for all JNI wrappers.
|
||||
*/
|
||||
public class JNIWrapper {
|
||||
static boolean libraryLoaded = false;
|
||||
static RuntimeLoader<JNIWrapper> loader = null;
|
||||
|
||||
static {
|
||||
if (!libraryLoaded) {
|
||||
try {
|
||||
loader = new RuntimeLoader<>("wpiHal", RuntimeLoader.getDefaultExtractionRoot(), JNIWrapper.class);
|
||||
loader.loadLibrary();
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
libraryLoaded = true;
|
||||
libraryLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user