[ntcore] Rename constants to all caps style (#8676)

This commit is contained in:
Peter Johnson
2026-03-15 20:44:45 -07:00
committed by GitHub
parent 86dd3ca2b7
commit ab7e4766f6
99 changed files with 736 additions and 732 deletions

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables BooleanArray topic. */
public final class BooleanArrayTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "boolean[]";
public static final String TYPE_STRING = "boolean[]";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class BooleanArrayTopic extends Topic {
return new BooleanArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kBooleanArray.getValue(),
m_handle, NetworkTableType.BOOLEAN_ARRAY.getValue(),
"boolean[]", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class BooleanArrayTopic extends Topic {
return new BooleanArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kBooleanArray.getValue(),
m_handle, NetworkTableType.BOOLEAN_ARRAY.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class BooleanArrayTopic extends Topic {
return new BooleanArrayEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kBooleanArray.getValue(),
m_handle, NetworkTableType.BOOLEAN_ARRAY.getValue(),
"boolean[]", options),
new boolean[] {});
}
@@ -134,7 +134,7 @@ public final class BooleanArrayTopic extends Topic {
return new BooleanArrayEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kBooleanArray.getValue(),
m_handle, NetworkTableType.BOOLEAN_ARRAY.getValue(),
typeString, properties, options),
new boolean[] {});
}
@@ -165,7 +165,7 @@ public final class BooleanArrayTopic extends Topic {
return new BooleanArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kBooleanArray.getValue(),
m_handle, NetworkTableType.BOOLEAN_ARRAY.getValue(),
"boolean[]", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class BooleanArrayTopic extends Topic {
return new BooleanArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kBooleanArray.getValue(),
m_handle, NetworkTableType.BOOLEAN_ARRAY.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables Boolean topic. */
public final class BooleanTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "boolean";
public static final String TYPE_STRING = "boolean";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class BooleanTopic extends Topic {
return new BooleanEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kBoolean.getValue(),
m_handle, NetworkTableType.BOOLEAN.getValue(),
"boolean", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class BooleanTopic extends Topic {
return new BooleanEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kBoolean.getValue(),
m_handle, NetworkTableType.BOOLEAN.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class BooleanTopic extends Topic {
return new BooleanEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kBoolean.getValue(),
m_handle, NetworkTableType.BOOLEAN.getValue(),
"boolean", options),
false);
}
@@ -134,7 +134,7 @@ public final class BooleanTopic extends Topic {
return new BooleanEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kBoolean.getValue(),
m_handle, NetworkTableType.BOOLEAN.getValue(),
typeString, properties, options),
false);
}
@@ -165,7 +165,7 @@ public final class BooleanTopic extends Topic {
return new BooleanEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kBoolean.getValue(),
m_handle, NetworkTableType.BOOLEAN.getValue(),
"boolean", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class BooleanTopic extends Topic {
return new BooleanEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kBoolean.getValue(),
m_handle, NetworkTableType.BOOLEAN.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables DoubleArray topic. */
public final class DoubleArrayTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "double[]";
public static final String TYPE_STRING = "double[]";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class DoubleArrayTopic extends Topic {
return new DoubleArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kDoubleArray.getValue(),
m_handle, NetworkTableType.DOUBLE_ARRAY.getValue(),
"double[]", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class DoubleArrayTopic extends Topic {
return new DoubleArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kDoubleArray.getValue(),
m_handle, NetworkTableType.DOUBLE_ARRAY.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class DoubleArrayTopic extends Topic {
return new DoubleArrayEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kDoubleArray.getValue(),
m_handle, NetworkTableType.DOUBLE_ARRAY.getValue(),
"double[]", options),
new double[] {});
}
@@ -134,7 +134,7 @@ public final class DoubleArrayTopic extends Topic {
return new DoubleArrayEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kDoubleArray.getValue(),
m_handle, NetworkTableType.DOUBLE_ARRAY.getValue(),
typeString, properties, options),
new double[] {});
}
@@ -165,7 +165,7 @@ public final class DoubleArrayTopic extends Topic {
return new DoubleArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kDoubleArray.getValue(),
m_handle, NetworkTableType.DOUBLE_ARRAY.getValue(),
"double[]", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class DoubleArrayTopic extends Topic {
return new DoubleArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kDoubleArray.getValue(),
m_handle, NetworkTableType.DOUBLE_ARRAY.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables Double topic. */
public final class DoubleTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "double";
public static final String TYPE_STRING = "double";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class DoubleTopic extends Topic {
return new DoubleEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kDouble.getValue(),
m_handle, NetworkTableType.DOUBLE.getValue(),
"double", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class DoubleTopic extends Topic {
return new DoubleEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kDouble.getValue(),
m_handle, NetworkTableType.DOUBLE.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class DoubleTopic extends Topic {
return new DoubleEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kDouble.getValue(),
m_handle, NetworkTableType.DOUBLE.getValue(),
"double", options),
0);
}
@@ -134,7 +134,7 @@ public final class DoubleTopic extends Topic {
return new DoubleEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kDouble.getValue(),
m_handle, NetworkTableType.DOUBLE.getValue(),
typeString, properties, options),
0);
}
@@ -165,7 +165,7 @@ public final class DoubleTopic extends Topic {
return new DoubleEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kDouble.getValue(),
m_handle, NetworkTableType.DOUBLE.getValue(),
"double", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class DoubleTopic extends Topic {
return new DoubleEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kDouble.getValue(),
m_handle, NetworkTableType.DOUBLE.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables FloatArray topic. */
public final class FloatArrayTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "float[]";
public static final String TYPE_STRING = "float[]";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class FloatArrayTopic extends Topic {
return new FloatArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kFloatArray.getValue(),
m_handle, NetworkTableType.FLOAT_ARRAY.getValue(),
"float[]", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class FloatArrayTopic extends Topic {
return new FloatArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kFloatArray.getValue(),
m_handle, NetworkTableType.FLOAT_ARRAY.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class FloatArrayTopic extends Topic {
return new FloatArrayEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kFloatArray.getValue(),
m_handle, NetworkTableType.FLOAT_ARRAY.getValue(),
"float[]", options),
new float[] {});
}
@@ -134,7 +134,7 @@ public final class FloatArrayTopic extends Topic {
return new FloatArrayEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kFloatArray.getValue(),
m_handle, NetworkTableType.FLOAT_ARRAY.getValue(),
typeString, properties, options),
new float[] {});
}
@@ -165,7 +165,7 @@ public final class FloatArrayTopic extends Topic {
return new FloatArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kFloatArray.getValue(),
m_handle, NetworkTableType.FLOAT_ARRAY.getValue(),
"float[]", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class FloatArrayTopic extends Topic {
return new FloatArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kFloatArray.getValue(),
m_handle, NetworkTableType.FLOAT_ARRAY.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables Float topic. */
public final class FloatTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "float";
public static final String TYPE_STRING = "float";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class FloatTopic extends Topic {
return new FloatEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kFloat.getValue(),
m_handle, NetworkTableType.FLOAT.getValue(),
"float", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class FloatTopic extends Topic {
return new FloatEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kFloat.getValue(),
m_handle, NetworkTableType.FLOAT.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class FloatTopic extends Topic {
return new FloatEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kFloat.getValue(),
m_handle, NetworkTableType.FLOAT.getValue(),
"float", options),
0);
}
@@ -134,7 +134,7 @@ public final class FloatTopic extends Topic {
return new FloatEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kFloat.getValue(),
m_handle, NetworkTableType.FLOAT.getValue(),
typeString, properties, options),
0);
}
@@ -165,7 +165,7 @@ public final class FloatTopic extends Topic {
return new FloatEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kFloat.getValue(),
m_handle, NetworkTableType.FLOAT.getValue(),
"float", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class FloatTopic extends Topic {
return new FloatEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kFloat.getValue(),
m_handle, NetworkTableType.FLOAT.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -225,30 +225,30 @@ final class GenericEntryImpl extends EntryBase implements GenericEntry {
long time = value.getTime();
Object otherValue = value.getValue();
switch (value.getType()) {
case kBoolean:
case BOOLEAN:
return NetworkTablesJNI.setBoolean(m_handle, time, (Boolean) otherValue);
case kInteger:
case INTEGER:
return NetworkTablesJNI.setInteger(
m_handle, time, ((Number) otherValue).longValue());
case kFloat:
case FLOAT:
return NetworkTablesJNI.setFloat(
m_handle, time, ((Number) otherValue).floatValue());
case kDouble:
case DOUBLE:
return NetworkTablesJNI.setDouble(
m_handle, time, ((Number) otherValue).doubleValue());
case kString:
case STRING:
return NetworkTablesJNI.setString(m_handle, time, (String) otherValue);
case kRaw:
case RAW:
return NetworkTablesJNI.setRaw(m_handle, time, (byte[]) otherValue);
case kBooleanArray:
case BOOLEAN_ARRAY:
return NetworkTablesJNI.setBooleanArray(m_handle, time, (boolean[]) otherValue);
case kIntegerArray:
case INTEGER_ARRAY:
return NetworkTablesJNI.setIntegerArray(m_handle, time, (long[]) otherValue);
case kFloatArray:
case FLOAT_ARRAY:
return NetworkTablesJNI.setFloatArray(m_handle, time, (float[]) otherValue);
case kDoubleArray:
case DOUBLE_ARRAY:
return NetworkTablesJNI.setDoubleArray(m_handle, time, (double[]) otherValue);
case kStringArray:
case STRING_ARRAY:
return NetworkTablesJNI.setStringArray(m_handle, time, (String[]) otherValue);
default:
return true;
@@ -518,30 +518,30 @@ final class GenericEntryImpl extends EntryBase implements GenericEntry {
long time = defaultValue.getTime();
Object otherValue = defaultValue.getValue();
switch (defaultValue.getType()) {
case kBoolean:
case BOOLEAN:
return NetworkTablesJNI.setDefaultBoolean(m_handle, time, (Boolean) otherValue);
case kInteger:
case INTEGER:
return NetworkTablesJNI.setDefaultInteger(
m_handle, time, ((Number) otherValue).longValue());
case kFloat:
case FLOAT:
return NetworkTablesJNI.setDefaultFloat(
m_handle, time, ((Number) otherValue).floatValue());
case kDouble:
case DOUBLE:
return NetworkTablesJNI.setDefaultDouble(
m_handle, time, ((Number) otherValue).doubleValue());
case kString:
case STRING:
return NetworkTablesJNI.setDefaultString(m_handle, time, (String) otherValue);
case kRaw:
case RAW:
return NetworkTablesJNI.setDefaultRaw(m_handle, time, (byte[]) otherValue);
case kBooleanArray:
case BOOLEAN_ARRAY:
return NetworkTablesJNI.setDefaultBooleanArray(m_handle, time, (boolean[]) otherValue);
case kIntegerArray:
case INTEGER_ARRAY:
return NetworkTablesJNI.setDefaultIntegerArray(m_handle, time, (long[]) otherValue);
case kFloatArray:
case FLOAT_ARRAY:
return NetworkTablesJNI.setDefaultFloatArray(m_handle, time, (float[]) otherValue);
case kDoubleArray:
case DOUBLE_ARRAY:
return NetworkTablesJNI.setDefaultDoubleArray(m_handle, time, (double[]) otherValue);
case kStringArray:
case STRING_ARRAY:
return NetworkTablesJNI.setDefaultStringArray(m_handle, time, (String[]) otherValue);
default:
return true;

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables IntegerArray topic. */
public final class IntegerArrayTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "int[]";
public static final String TYPE_STRING = "int[]";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class IntegerArrayTopic extends Topic {
return new IntegerArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kIntegerArray.getValue(),
m_handle, NetworkTableType.INTEGER_ARRAY.getValue(),
"int[]", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class IntegerArrayTopic extends Topic {
return new IntegerArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kIntegerArray.getValue(),
m_handle, NetworkTableType.INTEGER_ARRAY.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class IntegerArrayTopic extends Topic {
return new IntegerArrayEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kIntegerArray.getValue(),
m_handle, NetworkTableType.INTEGER_ARRAY.getValue(),
"int[]", options),
new long[] {});
}
@@ -134,7 +134,7 @@ public final class IntegerArrayTopic extends Topic {
return new IntegerArrayEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kIntegerArray.getValue(),
m_handle, NetworkTableType.INTEGER_ARRAY.getValue(),
typeString, properties, options),
new long[] {});
}
@@ -165,7 +165,7 @@ public final class IntegerArrayTopic extends Topic {
return new IntegerArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kIntegerArray.getValue(),
m_handle, NetworkTableType.INTEGER_ARRAY.getValue(),
"int[]", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class IntegerArrayTopic extends Topic {
return new IntegerArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kIntegerArray.getValue(),
m_handle, NetworkTableType.INTEGER_ARRAY.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables Integer topic. */
public final class IntegerTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "int";
public static final String TYPE_STRING = "int";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class IntegerTopic extends Topic {
return new IntegerEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kInteger.getValue(),
m_handle, NetworkTableType.INTEGER.getValue(),
"int", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class IntegerTopic extends Topic {
return new IntegerEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kInteger.getValue(),
m_handle, NetworkTableType.INTEGER.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class IntegerTopic extends Topic {
return new IntegerEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kInteger.getValue(),
m_handle, NetworkTableType.INTEGER.getValue(),
"int", options),
0);
}
@@ -134,7 +134,7 @@ public final class IntegerTopic extends Topic {
return new IntegerEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kInteger.getValue(),
m_handle, NetworkTableType.INTEGER.getValue(),
typeString, properties, options),
0);
}
@@ -165,7 +165,7 @@ public final class IntegerTopic extends Topic {
return new IntegerEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kInteger.getValue(),
m_handle, NetworkTableType.INTEGER.getValue(),
"int", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class IntegerTopic extends Topic {
return new IntegerEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kInteger.getValue(),
m_handle, NetworkTableType.INTEGER.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -367,30 +367,30 @@ public final class NetworkTableEntry implements Publisher, Subscriber {
long time = ((NetworkTableValue) defaultValue).getTime();
Object otherValue = ((NetworkTableValue) defaultValue).getValue();
switch (((NetworkTableValue) defaultValue).getType()) {
case kBoolean:
case BOOLEAN:
return NetworkTablesJNI.setDefaultBoolean(m_handle, time, (Boolean) otherValue);
case kInteger:
case INTEGER:
return NetworkTablesJNI.setDefaultInteger(
m_handle, time, ((Number) otherValue).longValue());
case kFloat:
case FLOAT:
return NetworkTablesJNI.setDefaultFloat(
m_handle, time, ((Number) otherValue).floatValue());
case kDouble:
case DOUBLE:
return NetworkTablesJNI.setDefaultDouble(
m_handle, time, ((Number) otherValue).doubleValue());
case kString:
case STRING:
return NetworkTablesJNI.setDefaultString(m_handle, time, (String) otherValue);
case kRaw:
case RAW:
return NetworkTablesJNI.setDefaultRaw(m_handle, time, (byte[]) otherValue);
case kBooleanArray:
case BOOLEAN_ARRAY:
return NetworkTablesJNI.setDefaultBooleanArray(m_handle, time, (boolean[]) otherValue);
case kIntegerArray:
case INTEGER_ARRAY:
return NetworkTablesJNI.setDefaultIntegerArray(m_handle, time, (long[]) otherValue);
case kFloatArray:
case FLOAT_ARRAY:
return NetworkTablesJNI.setDefaultFloatArray(m_handle, time, (float[]) otherValue);
case kDoubleArray:
case DOUBLE_ARRAY:
return NetworkTablesJNI.setDefaultDoubleArray(m_handle, time, (double[]) otherValue);
case kStringArray:
case STRING_ARRAY:
return NetworkTablesJNI.setDefaultStringArray(m_handle, time, (String[]) otherValue);
default:
return true;
@@ -648,30 +648,30 @@ public final class NetworkTableEntry implements Publisher, Subscriber {
long time = ((NetworkTableValue) value).getTime();
Object otherValue = ((NetworkTableValue) value).getValue();
switch (((NetworkTableValue) value).getType()) {
case kBoolean:
case BOOLEAN:
return NetworkTablesJNI.setBoolean(m_handle, time, (Boolean) otherValue);
case kInteger:
case INTEGER:
return NetworkTablesJNI.setInteger(
m_handle, time, ((Number) otherValue).longValue());
case kFloat:
case FLOAT:
return NetworkTablesJNI.setFloat(
m_handle, time, ((Number) otherValue).floatValue());
case kDouble:
case DOUBLE:
return NetworkTablesJNI.setDouble(
m_handle, time, ((Number) otherValue).doubleValue());
case kString:
case STRING:
return NetworkTablesJNI.setString(m_handle, time, (String) otherValue);
case kRaw:
case RAW:
return NetworkTablesJNI.setRaw(m_handle, time, (byte[]) otherValue);
case kBooleanArray:
case BOOLEAN_ARRAY:
return NetworkTablesJNI.setBooleanArray(m_handle, time, (boolean[]) otherValue);
case kIntegerArray:
case INTEGER_ARRAY:
return NetworkTablesJNI.setIntegerArray(m_handle, time, (long[]) otherValue);
case kFloatArray:
case FLOAT_ARRAY:
return NetworkTablesJNI.setFloatArray(m_handle, time, (float[]) otherValue);
case kDoubleArray:
case DOUBLE_ARRAY:
return NetworkTablesJNI.setDoubleArray(m_handle, time, (double[]) otherValue);
case kStringArray:
case STRING_ARRAY:
return NetworkTablesJNI.setStringArray(m_handle, time, (String[]) otherValue);
default:
return true;

View File

@@ -47,16 +47,16 @@ public final class NetworkTableInstance implements AutoCloseable {
/** Client/server mode flag values (as returned by {@link #getNetworkMode()}). */
public enum NetworkMode {
/** Running in server mode. */
kServer(0x01),
SERVER(0x01),
/** Running in client mode. */
kClient(0x04),
CLIENT(0x04),
/** Currently starting up (either client or server). */
kStarting(0x08),
STARTING(0x08),
/** Running in local-only mode. */
kLocal(0x10);
LOCAL(0x10);
private final int value;
@@ -75,7 +75,7 @@ public final class NetworkTableInstance implements AutoCloseable {
}
/** The default port that network tables operates on. */
public static final int kDefaultPort = 5810;
public static final int DEFAULT_PORT = 5810;
/**
* Construct from native handle.
@@ -989,9 +989,9 @@ public final class NetworkTableInstance implements AutoCloseable {
*/
public int addConnectionListener(
boolean immediateNotify, Consumer<NetworkTableEvent> listener) {
EnumSet<NetworkTableEvent.Kind> eventKinds = EnumSet.of(NetworkTableEvent.Kind.kConnection);
EnumSet<NetworkTableEvent.Kind> eventKinds = EnumSet.of(NetworkTableEvent.Kind.CONNECTION);
if (immediateNotify) {
eventKinds.add(NetworkTableEvent.Kind.kImmediate);
eventKinds.add(NetworkTableEvent.Kind.IMMEDIATE);
}
return m_listeners.add(m_handle, eventKinds, listener);
}
@@ -1007,9 +1007,9 @@ public final class NetworkTableInstance implements AutoCloseable {
*/
public int addTimeSyncListener(
boolean immediateNotify, Consumer<NetworkTableEvent> listener) {
EnumSet<NetworkTableEvent.Kind> eventKinds = EnumSet.of(NetworkTableEvent.Kind.kTimeSync);
EnumSet<NetworkTableEvent.Kind> eventKinds = EnumSet.of(NetworkTableEvent.Kind.TIME_SYNC);
if (immediateNotify) {
eventKinds.add(NetworkTableEvent.Kind.kImmediate);
eventKinds.add(NetworkTableEvent.Kind.IMMEDIATE);
}
return m_listeners.add(m_handle, eventKinds, listener);
}
@@ -1193,7 +1193,7 @@ public final class NetworkTableInstance implements AutoCloseable {
* @param mdnsService the mDNS service name to advertise, or empty to not advertise
*/
public void startServer(String persistFilename, String listenAddress, String mdnsService) {
startServer(persistFilename, listenAddress, mdnsService, kDefaultPort);
startServer(persistFilename, listenAddress, mdnsService, DEFAULT_PORT);
}
/**

View File

@@ -76,7 +76,7 @@ public final class NetworkTableValue {
* @return True if the entry value contains a value.
*/
public boolean isValid() {
return m_type != NetworkTableType.kUnassigned;
return m_type != NetworkTableType.UNASSIGNED;
}
/**
@@ -85,7 +85,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of boolean type.
*/
public boolean isBoolean() {
return m_type == NetworkTableType.kBoolean;
return m_type == NetworkTableType.BOOLEAN;
}
/**
@@ -94,7 +94,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of long type.
*/
public boolean isInteger() {
return m_type == NetworkTableType.kInteger;
return m_type == NetworkTableType.INTEGER;
}
/**
@@ -103,7 +103,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of float type.
*/
public boolean isFloat() {
return m_type == NetworkTableType.kFloat;
return m_type == NetworkTableType.FLOAT;
}
/**
@@ -112,7 +112,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of double type.
*/
public boolean isDouble() {
return m_type == NetworkTableType.kDouble;
return m_type == NetworkTableType.DOUBLE;
}
/**
@@ -121,7 +121,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of String type.
*/
public boolean isString() {
return m_type == NetworkTableType.kString;
return m_type == NetworkTableType.STRING;
}
/**
@@ -130,7 +130,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of byte[] type.
*/
public boolean isRaw() {
return m_type == NetworkTableType.kRaw;
return m_type == NetworkTableType.RAW;
}
/**
@@ -139,7 +139,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of boolean[] type.
*/
public boolean isBooleanArray() {
return m_type == NetworkTableType.kBooleanArray;
return m_type == NetworkTableType.BOOLEAN_ARRAY;
}
/**
@@ -148,7 +148,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of long[] type.
*/
public boolean isIntegerArray() {
return m_type == NetworkTableType.kIntegerArray;
return m_type == NetworkTableType.INTEGER_ARRAY;
}
/**
@@ -157,7 +157,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of float[] type.
*/
public boolean isFloatArray() {
return m_type == NetworkTableType.kFloatArray;
return m_type == NetworkTableType.FLOAT_ARRAY;
}
/**
@@ -166,7 +166,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of double[] type.
*/
public boolean isDoubleArray() {
return m_type == NetworkTableType.kDoubleArray;
return m_type == NetworkTableType.DOUBLE_ARRAY;
}
/**
@@ -175,7 +175,7 @@ public final class NetworkTableValue {
* @return True if the entry value is of String[] type.
*/
public boolean isStringArray() {
return m_type == NetworkTableType.kStringArray;
return m_type == NetworkTableType.STRING_ARRAY;
}
/*
@@ -189,7 +189,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of boolean type.
*/
public boolean getBoolean() {
if (m_type != NetworkTableType.kBoolean) {
if (m_type != NetworkTableType.BOOLEAN) {
throw new ClassCastException("cannot convert " + m_type + " to boolean");
}
return (Boolean) m_value;
@@ -202,7 +202,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of long type.
*/
public long getInteger() {
if (m_type != NetworkTableType.kInteger) {
if (m_type != NetworkTableType.INTEGER) {
throw new ClassCastException("cannot convert " + m_type + " to long");
}
return ((Number) m_value).longValue();
@@ -215,7 +215,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of float type.
*/
public float getFloat() {
if (m_type != NetworkTableType.kFloat) {
if (m_type != NetworkTableType.FLOAT) {
throw new ClassCastException("cannot convert " + m_type + " to float");
}
return ((Number) m_value).floatValue();
@@ -228,7 +228,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of double type.
*/
public double getDouble() {
if (m_type != NetworkTableType.kDouble) {
if (m_type != NetworkTableType.DOUBLE) {
throw new ClassCastException("cannot convert " + m_type + " to double");
}
return ((Number) m_value).doubleValue();
@@ -241,7 +241,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of String type.
*/
public String getString() {
if (m_type != NetworkTableType.kString) {
if (m_type != NetworkTableType.STRING) {
throw new ClassCastException("cannot convert " + m_type + " to String");
}
return (String) m_value;
@@ -254,7 +254,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of byte[] type.
*/
public byte[] getRaw() {
if (m_type != NetworkTableType.kRaw) {
if (m_type != NetworkTableType.RAW) {
throw new ClassCastException("cannot convert " + m_type + " to byte[]");
}
return (byte[]) m_value;
@@ -267,7 +267,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of boolean[] type.
*/
public boolean[] getBooleanArray() {
if (m_type != NetworkTableType.kBooleanArray) {
if (m_type != NetworkTableType.BOOLEAN_ARRAY) {
throw new ClassCastException("cannot convert " + m_type + " to boolean[]");
}
return (boolean[]) m_value;
@@ -280,7 +280,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of long[] type.
*/
public long[] getIntegerArray() {
if (m_type != NetworkTableType.kIntegerArray) {
if (m_type != NetworkTableType.INTEGER_ARRAY) {
throw new ClassCastException("cannot convert " + m_type + " to long[]");
}
return (long[]) m_value;
@@ -293,7 +293,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of float[] type.
*/
public float[] getFloatArray() {
if (m_type != NetworkTableType.kFloatArray) {
if (m_type != NetworkTableType.FLOAT_ARRAY) {
throw new ClassCastException("cannot convert " + m_type + " to float[]");
}
return (float[]) m_value;
@@ -306,7 +306,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of double[] type.
*/
public double[] getDoubleArray() {
if (m_type != NetworkTableType.kDoubleArray) {
if (m_type != NetworkTableType.DOUBLE_ARRAY) {
throw new ClassCastException("cannot convert " + m_type + " to double[]");
}
return (double[]) m_value;
@@ -319,7 +319,7 @@ public final class NetworkTableValue {
* @throws ClassCastException if the entry value is not of String[] type.
*/
public String[] getStringArray() {
if (m_type != NetworkTableType.kStringArray) {
if (m_type != NetworkTableType.STRING_ARRAY) {
throw new ClassCastException("cannot convert " + m_type + " to String[]");
}
return (String[]) m_value;
@@ -336,7 +336,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeBoolean(boolean value) {
return new NetworkTableValue(NetworkTableType.kBoolean, Boolean.valueOf(value));
return new NetworkTableValue(NetworkTableType.BOOLEAN, Boolean.valueOf(value));
}
/**
@@ -347,7 +347,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeBoolean(boolean value, long time) {
return new NetworkTableValue(NetworkTableType.kBoolean, Boolean.valueOf(value), time);
return new NetworkTableValue(NetworkTableType.BOOLEAN, Boolean.valueOf(value), time);
}
/**
@@ -357,7 +357,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeInteger(long value) {
return new NetworkTableValue(NetworkTableType.kInteger, Long.valueOf(value));
return new NetworkTableValue(NetworkTableType.INTEGER, Long.valueOf(value));
}
/**
@@ -368,7 +368,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeInteger(long value, long time) {
return new NetworkTableValue(NetworkTableType.kInteger, Long.valueOf(value), time);
return new NetworkTableValue(NetworkTableType.INTEGER, Long.valueOf(value), time);
}
/**
@@ -378,7 +378,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeFloat(float value) {
return new NetworkTableValue(NetworkTableType.kFloat, Float.valueOf(value));
return new NetworkTableValue(NetworkTableType.FLOAT, Float.valueOf(value));
}
/**
@@ -389,7 +389,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeFloat(float value, long time) {
return new NetworkTableValue(NetworkTableType.kFloat, Float.valueOf(value), time);
return new NetworkTableValue(NetworkTableType.FLOAT, Float.valueOf(value), time);
}
/**
@@ -399,7 +399,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeDouble(double value) {
return new NetworkTableValue(NetworkTableType.kDouble, Double.valueOf(value));
return new NetworkTableValue(NetworkTableType.DOUBLE, Double.valueOf(value));
}
/**
@@ -410,7 +410,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeDouble(double value, long time) {
return new NetworkTableValue(NetworkTableType.kDouble, Double.valueOf(value), time);
return new NetworkTableValue(NetworkTableType.DOUBLE, Double.valueOf(value), time);
}
/**
@@ -420,7 +420,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeString(String value) {
return new NetworkTableValue(NetworkTableType.kString, (value));
return new NetworkTableValue(NetworkTableType.STRING, (value));
}
/**
@@ -431,7 +431,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeString(String value, long time) {
return new NetworkTableValue(NetworkTableType.kString, (value), time);
return new NetworkTableValue(NetworkTableType.STRING, (value), time);
}
/**
@@ -441,7 +441,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeRaw(byte[] value) {
return new NetworkTableValue(NetworkTableType.kRaw, (value));
return new NetworkTableValue(NetworkTableType.RAW, (value));
}
/**
@@ -452,7 +452,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeRaw(byte[] value, long time) {
return new NetworkTableValue(NetworkTableType.kRaw, (value), time);
return new NetworkTableValue(NetworkTableType.RAW, (value), time);
}
/**
@@ -462,7 +462,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeBooleanArray(boolean[] value) {
return new NetworkTableValue(NetworkTableType.kBooleanArray, (value));
return new NetworkTableValue(NetworkTableType.BOOLEAN_ARRAY, (value));
}
/**
@@ -473,7 +473,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeBooleanArray(boolean[] value, long time) {
return new NetworkTableValue(NetworkTableType.kBooleanArray, (value), time);
return new NetworkTableValue(NetworkTableType.BOOLEAN_ARRAY, (value), time);
}
/**
@@ -483,7 +483,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeBooleanArray(Boolean[] value) {
return new NetworkTableValue(NetworkTableType.kBooleanArray, toNativeBooleanArray(value));
return new NetworkTableValue(NetworkTableType.BOOLEAN_ARRAY, toNativeBooleanArray(value));
}
/**
@@ -494,7 +494,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeBooleanArray(Boolean[] value, long time) {
return new NetworkTableValue(NetworkTableType.kBooleanArray, toNativeBooleanArray(value), time);
return new NetworkTableValue(NetworkTableType.BOOLEAN_ARRAY, toNativeBooleanArray(value), time);
}
/**
@@ -504,7 +504,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeIntegerArray(long[] value) {
return new NetworkTableValue(NetworkTableType.kIntegerArray, (value));
return new NetworkTableValue(NetworkTableType.INTEGER_ARRAY, (value));
}
/**
@@ -515,7 +515,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeIntegerArray(long[] value, long time) {
return new NetworkTableValue(NetworkTableType.kIntegerArray, (value), time);
return new NetworkTableValue(NetworkTableType.INTEGER_ARRAY, (value), time);
}
/**
@@ -525,7 +525,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeIntegerArray(Long[] value) {
return new NetworkTableValue(NetworkTableType.kIntegerArray, toNativeIntegerArray(value));
return new NetworkTableValue(NetworkTableType.INTEGER_ARRAY, toNativeIntegerArray(value));
}
/**
@@ -536,7 +536,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeIntegerArray(Long[] value, long time) {
return new NetworkTableValue(NetworkTableType.kIntegerArray, toNativeIntegerArray(value), time);
return new NetworkTableValue(NetworkTableType.INTEGER_ARRAY, toNativeIntegerArray(value), time);
}
/**
@@ -546,7 +546,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeFloatArray(float[] value) {
return new NetworkTableValue(NetworkTableType.kFloatArray, (value));
return new NetworkTableValue(NetworkTableType.FLOAT_ARRAY, (value));
}
/**
@@ -557,7 +557,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeFloatArray(float[] value, long time) {
return new NetworkTableValue(NetworkTableType.kFloatArray, (value), time);
return new NetworkTableValue(NetworkTableType.FLOAT_ARRAY, (value), time);
}
/**
@@ -567,7 +567,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeFloatArray(Float[] value) {
return new NetworkTableValue(NetworkTableType.kFloatArray, toNativeFloatArray(value));
return new NetworkTableValue(NetworkTableType.FLOAT_ARRAY, toNativeFloatArray(value));
}
/**
@@ -578,7 +578,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeFloatArray(Float[] value, long time) {
return new NetworkTableValue(NetworkTableType.kFloatArray, toNativeFloatArray(value), time);
return new NetworkTableValue(NetworkTableType.FLOAT_ARRAY, toNativeFloatArray(value), time);
}
/**
@@ -588,7 +588,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeDoubleArray(double[] value) {
return new NetworkTableValue(NetworkTableType.kDoubleArray, (value));
return new NetworkTableValue(NetworkTableType.DOUBLE_ARRAY, (value));
}
/**
@@ -599,7 +599,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeDoubleArray(double[] value, long time) {
return new NetworkTableValue(NetworkTableType.kDoubleArray, (value), time);
return new NetworkTableValue(NetworkTableType.DOUBLE_ARRAY, (value), time);
}
/**
@@ -609,7 +609,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeDoubleArray(Double[] value) {
return new NetworkTableValue(NetworkTableType.kDoubleArray, toNativeDoubleArray(value));
return new NetworkTableValue(NetworkTableType.DOUBLE_ARRAY, toNativeDoubleArray(value));
}
/**
@@ -620,7 +620,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeDoubleArray(Double[] value, long time) {
return new NetworkTableValue(NetworkTableType.kDoubleArray, toNativeDoubleArray(value), time);
return new NetworkTableValue(NetworkTableType.DOUBLE_ARRAY, toNativeDoubleArray(value), time);
}
/**
@@ -630,7 +630,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeStringArray(String[] value) {
return new NetworkTableValue(NetworkTableType.kStringArray, (value));
return new NetworkTableValue(NetworkTableType.STRING_ARRAY, (value));
}
/**
@@ -641,7 +641,7 @@ public final class NetworkTableValue {
* @return The entry value
*/
public static NetworkTableValue makeStringArray(String[] value, long time) {
return new NetworkTableValue(NetworkTableType.kStringArray, (value), time);
return new NetworkTableValue(NetworkTableType.STRING_ARRAY, (value), time);
}
@Override

View File

@@ -52,7 +52,7 @@ public final class RawTopic extends Topic {
return new RawEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kRaw.getValue(),
m_handle, NetworkTableType.RAW.getValue(),
typeString, options),
defaultValue);
}
@@ -81,7 +81,7 @@ public final class RawTopic extends Topic {
return new RawEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kRaw.getValue(),
m_handle, NetworkTableType.RAW.getValue(),
typeString, options),
new byte[] {});
}
@@ -111,7 +111,7 @@ public final class RawTopic extends Topic {
return new RawEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kRaw.getValue(),
m_handle, NetworkTableType.RAW.getValue(),
typeString, properties, options),
new byte[] {});
}
@@ -146,7 +146,7 @@ public final class RawTopic extends Topic {
return new RawEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kRaw.getValue(),
m_handle, NetworkTableType.RAW.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables StringArray topic. */
public final class StringArrayTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "string[]";
public static final String TYPE_STRING = "string[]";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class StringArrayTopic extends Topic {
return new StringArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kStringArray.getValue(),
m_handle, NetworkTableType.STRING_ARRAY.getValue(),
"string[]", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class StringArrayTopic extends Topic {
return new StringArrayEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kStringArray.getValue(),
m_handle, NetworkTableType.STRING_ARRAY.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class StringArrayTopic extends Topic {
return new StringArrayEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kStringArray.getValue(),
m_handle, NetworkTableType.STRING_ARRAY.getValue(),
"string[]", options),
new String[] {});
}
@@ -134,7 +134,7 @@ public final class StringArrayTopic extends Topic {
return new StringArrayEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kStringArray.getValue(),
m_handle, NetworkTableType.STRING_ARRAY.getValue(),
typeString, properties, options),
new String[] {});
}
@@ -165,7 +165,7 @@ public final class StringArrayTopic extends Topic {
return new StringArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kStringArray.getValue(),
m_handle, NetworkTableType.STRING_ARRAY.getValue(),
"string[]", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class StringArrayTopic extends Topic {
return new StringArrayEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kStringArray.getValue(),
m_handle, NetworkTableType.STRING_ARRAY.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -9,7 +9,7 @@ package org.wpilib.networktables;
/** NetworkTables String topic. */
public final class StringTopic extends Topic {
/** The default type string for this topic type. */
public static final String kTypeString = "string";
public static final String TYPE_STRING = "string";
/**
* Construct from a generic topic.
@@ -51,7 +51,7 @@ public final class StringTopic extends Topic {
return new StringEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kString.getValue(),
m_handle, NetworkTableType.STRING.getValue(),
"string", options),
defaultValue);
}
@@ -79,7 +79,7 @@ public final class StringTopic extends Topic {
return new StringEntryImpl(
this,
NetworkTablesJNI.subscribe(
m_handle, NetworkTableType.kString.getValue(),
m_handle, NetworkTableType.STRING.getValue(),
typeString, options),
defaultValue);
}
@@ -104,7 +104,7 @@ public final class StringTopic extends Topic {
return new StringEntryImpl(
this,
NetworkTablesJNI.publish(
m_handle, NetworkTableType.kString.getValue(),
m_handle, NetworkTableType.STRING.getValue(),
"string", options),
"");
}
@@ -134,7 +134,7 @@ public final class StringTopic extends Topic {
return new StringEntryImpl(
this,
NetworkTablesJNI.publishEx(
m_handle, NetworkTableType.kString.getValue(),
m_handle, NetworkTableType.STRING.getValue(),
typeString, properties, options),
"");
}
@@ -165,7 +165,7 @@ public final class StringTopic extends Topic {
return new StringEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kString.getValue(),
m_handle, NetworkTableType.STRING.getValue(),
"string", options),
defaultValue);
}
@@ -198,7 +198,7 @@ public final class StringTopic extends Topic {
return new StringEntryImpl(
this,
NetworkTablesJNI.getEntry(
m_handle, NetworkTableType.kString.getValue(),
m_handle, NetworkTableType.STRING.getValue(),
typeString, options),
defaultValue);
}

View File

@@ -302,7 +302,7 @@ class BooleanArrayTopic final : public Topic {
using ParamType = std::span<const int>;
using TimestampedValueType = TimestampedBooleanArray;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "boolean[]";
static constexpr std::string_view TYPE_STRING = "boolean[]";
BooleanArrayTopic() = default;
@@ -339,7 +339,7 @@ class BooleanArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options),
defaultValue};
@@ -363,7 +363,7 @@ class BooleanArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN_ARRAY, typeString, options),
defaultValue};
@@ -385,7 +385,7 @@ class BooleanArrayTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanArrayPublisher{
::wpi::nt::Publish(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options)};
}
@@ -410,7 +410,7 @@ class BooleanArrayTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanArrayPublisher{
::wpi::nt::PublishEx(m_handle, NT_BOOLEAN_ARRAY, typeString, properties, options)};
}
@@ -437,7 +437,7 @@ class BooleanArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options),
defaultValue};
@@ -465,7 +465,7 @@ class BooleanArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN_ARRAY, typeString, options),
defaultValue};

View File

@@ -241,7 +241,7 @@ class BooleanTopic final : public Topic {
using ParamType = bool;
using TimestampedValueType = TimestampedBoolean;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "boolean";
static constexpr std::string_view TYPE_STRING = "boolean";
BooleanTopic() = default;
@@ -278,7 +278,7 @@ class BooleanTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanSubscriber{
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN, "boolean", options),
defaultValue};
@@ -302,7 +302,7 @@ class BooleanTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanSubscriber{
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN, typeString, options),
defaultValue};
@@ -324,7 +324,7 @@ class BooleanTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanPublisher{
::wpi::nt::Publish(m_handle, NT_BOOLEAN, "boolean", options)};
}
@@ -349,7 +349,7 @@ class BooleanTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanPublisher{
::wpi::nt::PublishEx(m_handle, NT_BOOLEAN, typeString, properties, options)};
}
@@ -376,7 +376,7 @@ class BooleanTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanEntry{
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN, "boolean", options),
defaultValue};
@@ -404,7 +404,7 @@ class BooleanTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return BooleanEntry{
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN, typeString, options),
defaultValue};

View File

@@ -302,7 +302,7 @@ class DoubleArrayTopic final : public Topic {
using ParamType = std::span<const double>;
using TimestampedValueType = TimestampedDoubleArray;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "double[]";
static constexpr std::string_view TYPE_STRING = "double[]";
DoubleArrayTopic() = default;
@@ -339,7 +339,7 @@ class DoubleArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_DOUBLE_ARRAY, "double[]", options),
defaultValue};
@@ -363,7 +363,7 @@ class DoubleArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_DOUBLE_ARRAY, typeString, options),
defaultValue};
@@ -385,7 +385,7 @@ class DoubleArrayTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleArrayPublisher{
::wpi::nt::Publish(m_handle, NT_DOUBLE_ARRAY, "double[]", options)};
}
@@ -410,7 +410,7 @@ class DoubleArrayTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleArrayPublisher{
::wpi::nt::PublishEx(m_handle, NT_DOUBLE_ARRAY, typeString, properties, options)};
}
@@ -437,7 +437,7 @@ class DoubleArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_DOUBLE_ARRAY, "double[]", options),
defaultValue};
@@ -465,7 +465,7 @@ class DoubleArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_DOUBLE_ARRAY, typeString, options),
defaultValue};

View File

@@ -241,7 +241,7 @@ class DoubleTopic final : public Topic {
using ParamType = double;
using TimestampedValueType = TimestampedDouble;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "double";
static constexpr std::string_view TYPE_STRING = "double";
DoubleTopic() = default;
@@ -278,7 +278,7 @@ class DoubleTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleSubscriber{
::wpi::nt::Subscribe(m_handle, NT_DOUBLE, "double", options),
defaultValue};
@@ -302,7 +302,7 @@ class DoubleTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleSubscriber{
::wpi::nt::Subscribe(m_handle, NT_DOUBLE, typeString, options),
defaultValue};
@@ -324,7 +324,7 @@ class DoubleTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoublePublisher{
::wpi::nt::Publish(m_handle, NT_DOUBLE, "double", options)};
}
@@ -349,7 +349,7 @@ class DoubleTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoublePublisher{
::wpi::nt::PublishEx(m_handle, NT_DOUBLE, typeString, properties, options)};
}
@@ -376,7 +376,7 @@ class DoubleTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleEntry{
::wpi::nt::GetEntry(m_handle, NT_DOUBLE, "double", options),
defaultValue};
@@ -404,7 +404,7 @@ class DoubleTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return DoubleEntry{
::wpi::nt::GetEntry(m_handle, NT_DOUBLE, typeString, options),
defaultValue};

View File

@@ -302,7 +302,7 @@ class FloatArrayTopic final : public Topic {
using ParamType = std::span<const float>;
using TimestampedValueType = TimestampedFloatArray;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "float[]";
static constexpr std::string_view TYPE_STRING = "float[]";
FloatArrayTopic() = default;
@@ -339,7 +339,7 @@ class FloatArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_FLOAT_ARRAY, "float[]", options),
defaultValue};
@@ -363,7 +363,7 @@ class FloatArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_FLOAT_ARRAY, typeString, options),
defaultValue};
@@ -385,7 +385,7 @@ class FloatArrayTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatArrayPublisher{
::wpi::nt::Publish(m_handle, NT_FLOAT_ARRAY, "float[]", options)};
}
@@ -410,7 +410,7 @@ class FloatArrayTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatArrayPublisher{
::wpi::nt::PublishEx(m_handle, NT_FLOAT_ARRAY, typeString, properties, options)};
}
@@ -437,7 +437,7 @@ class FloatArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_FLOAT_ARRAY, "float[]", options),
defaultValue};
@@ -465,7 +465,7 @@ class FloatArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_FLOAT_ARRAY, typeString, options),
defaultValue};

View File

@@ -241,7 +241,7 @@ class FloatTopic final : public Topic {
using ParamType = float;
using TimestampedValueType = TimestampedFloat;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "float";
static constexpr std::string_view TYPE_STRING = "float";
FloatTopic() = default;
@@ -278,7 +278,7 @@ class FloatTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatSubscriber{
::wpi::nt::Subscribe(m_handle, NT_FLOAT, "float", options),
defaultValue};
@@ -302,7 +302,7 @@ class FloatTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatSubscriber{
::wpi::nt::Subscribe(m_handle, NT_FLOAT, typeString, options),
defaultValue};
@@ -324,7 +324,7 @@ class FloatTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatPublisher{
::wpi::nt::Publish(m_handle, NT_FLOAT, "float", options)};
}
@@ -349,7 +349,7 @@ class FloatTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatPublisher{
::wpi::nt::PublishEx(m_handle, NT_FLOAT, typeString, properties, options)};
}
@@ -376,7 +376,7 @@ class FloatTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatEntry{
::wpi::nt::GetEntry(m_handle, NT_FLOAT, "float", options),
defaultValue};
@@ -404,7 +404,7 @@ class FloatTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return FloatEntry{
::wpi::nt::GetEntry(m_handle, NT_FLOAT, typeString, options),
defaultValue};

View File

@@ -302,7 +302,7 @@ class IntegerArrayTopic final : public Topic {
using ParamType = std::span<const int64_t>;
using TimestampedValueType = TimestampedIntegerArray;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "int[]";
static constexpr std::string_view TYPE_STRING = "int[]";
IntegerArrayTopic() = default;
@@ -339,7 +339,7 @@ class IntegerArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_INTEGER_ARRAY, "int[]", options),
defaultValue};
@@ -363,7 +363,7 @@ class IntegerArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_INTEGER_ARRAY, typeString, options),
defaultValue};
@@ -385,7 +385,7 @@ class IntegerArrayTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerArrayPublisher{
::wpi::nt::Publish(m_handle, NT_INTEGER_ARRAY, "int[]", options)};
}
@@ -410,7 +410,7 @@ class IntegerArrayTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerArrayPublisher{
::wpi::nt::PublishEx(m_handle, NT_INTEGER_ARRAY, typeString, properties, options)};
}
@@ -437,7 +437,7 @@ class IntegerArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_INTEGER_ARRAY, "int[]", options),
defaultValue};
@@ -465,7 +465,7 @@ class IntegerArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_INTEGER_ARRAY, typeString, options),
defaultValue};

View File

@@ -241,7 +241,7 @@ class IntegerTopic final : public Topic {
using ParamType = int64_t;
using TimestampedValueType = TimestampedInteger;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "int";
static constexpr std::string_view TYPE_STRING = "int";
IntegerTopic() = default;
@@ -278,7 +278,7 @@ class IntegerTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerSubscriber{
::wpi::nt::Subscribe(m_handle, NT_INTEGER, "int", options),
defaultValue};
@@ -302,7 +302,7 @@ class IntegerTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerSubscriber{
::wpi::nt::Subscribe(m_handle, NT_INTEGER, typeString, options),
defaultValue};
@@ -324,7 +324,7 @@ class IntegerTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerPublisher{
::wpi::nt::Publish(m_handle, NT_INTEGER, "int", options)};
}
@@ -349,7 +349,7 @@ class IntegerTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerPublisher{
::wpi::nt::PublishEx(m_handle, NT_INTEGER, typeString, properties, options)};
}
@@ -376,7 +376,7 @@ class IntegerTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerEntry{
::wpi::nt::GetEntry(m_handle, NT_INTEGER, "int", options),
defaultValue};
@@ -404,7 +404,7 @@ class IntegerTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return IntegerEntry{
::wpi::nt::GetEntry(m_handle, NT_INTEGER, typeString, options),
defaultValue};

View File

@@ -339,7 +339,7 @@ class RawTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return RawSubscriber{
::wpi::nt::Subscribe(m_handle, NT_RAW, typeString, options),
defaultValue};
@@ -362,7 +362,7 @@ class RawTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(std::string_view typeString, const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(std::string_view typeString, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return RawPublisher{
::wpi::nt::Publish(m_handle, NT_RAW, typeString, options)};
}
@@ -387,7 +387,7 @@ class RawTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return RawPublisher{
::wpi::nt::PublishEx(m_handle, NT_RAW, typeString, properties, options)};
}
@@ -416,7 +416,7 @@ class RawTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return RawEntry{
::wpi::nt::GetEntry(m_handle, NT_RAW, typeString, options),
defaultValue};

View File

@@ -241,7 +241,7 @@ class StringArrayTopic final : public Topic {
using ParamType = std::span<const std::string>;
using TimestampedValueType = TimestampedStringArray;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "string[]";
static constexpr std::string_view TYPE_STRING = "string[]";
StringArrayTopic() = default;
@@ -278,7 +278,7 @@ class StringArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_STRING_ARRAY, "string[]", options),
defaultValue};
@@ -302,7 +302,7 @@ class StringArrayTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringArraySubscriber{
::wpi::nt::Subscribe(m_handle, NT_STRING_ARRAY, typeString, options),
defaultValue};
@@ -324,7 +324,7 @@ class StringArrayTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringArrayPublisher{
::wpi::nt::Publish(m_handle, NT_STRING_ARRAY, "string[]", options)};
}
@@ -349,7 +349,7 @@ class StringArrayTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringArrayPublisher{
::wpi::nt::PublishEx(m_handle, NT_STRING_ARRAY, typeString, properties, options)};
}
@@ -376,7 +376,7 @@ class StringArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_STRING_ARRAY, "string[]", options),
defaultValue};
@@ -404,7 +404,7 @@ class StringArrayTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringArrayEntry{
::wpi::nt::GetEntry(m_handle, NT_STRING_ARRAY, typeString, options),
defaultValue};

View File

@@ -304,7 +304,7 @@ class StringTopic final : public Topic {
using ParamType = std::string_view;
using TimestampedValueType = TimestampedString;
/** The default type string for this topic type. */
static constexpr std::string_view kTypeString = "string";
static constexpr std::string_view TYPE_STRING = "string";
StringTopic() = default;
@@ -341,7 +341,7 @@ class StringTopic final : public Topic {
[[nodiscard]]
SubscriberType Subscribe(
ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringSubscriber{
::wpi::nt::Subscribe(m_handle, NT_STRING, "string", options),
defaultValue};
@@ -365,7 +365,7 @@ class StringTopic final : public Topic {
[[nodiscard]]
SubscriberType SubscribeEx(
std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringSubscriber{
::wpi::nt::Subscribe(m_handle, NT_STRING, typeString, options),
defaultValue};
@@ -387,7 +387,7 @@ class StringTopic final : public Topic {
* @return publisher
*/
[[nodiscard]]
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
PublisherType Publish(const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringPublisher{
::wpi::nt::Publish(m_handle, NT_STRING, "string", options)};
}
@@ -412,7 +412,7 @@ class StringTopic final : public Topic {
*/
[[nodiscard]]
PublisherType PublishEx(std::string_view typeString,
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
const wpi::util::json& properties, const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringPublisher{
::wpi::nt::PublishEx(m_handle, NT_STRING, typeString, properties, options)};
}
@@ -439,7 +439,7 @@ class StringTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntry(ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringEntry{
::wpi::nt::GetEntry(m_handle, NT_STRING, "string", options),
defaultValue};
@@ -467,7 +467,7 @@ class StringTopic final : public Topic {
*/
[[nodiscard]]
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
const PubSubOptions& options = kDefaultPubSubOptions) {
const PubSubOptions& options = DEFAULT_PUB_SUB_OPTIONS) {
return StringEntry{
::wpi::nt::GetEntry(m_handle, NT_STRING, typeString, options),
defaultValue};