mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
SCRIPT namespace replacements
This commit is contained in:
committed by
Peter Johnson
parent
ae6c043632
commit
9aca8e0fd6
186
ntcore/src/generated/main/native/cpp/jni/types_jni.cpp
generated
186
ntcore/src/generated/main/native/cpp/jni/types_jni.cpp
generated
@@ -11,7 +11,7 @@
|
||||
#include "org_wpilib_networktables_NetworkTablesJNI.h"
|
||||
#include "wpi/nt/ntcore.h"
|
||||
|
||||
using namespace wpi::java;
|
||||
using namespace wpi::util::java;
|
||||
|
||||
//
|
||||
// Globals and load/unload
|
||||
@@ -64,7 +64,7 @@ static const JExceptionInit exceptions[] = {
|
||||
{"java/lang/NullPointerException", &nullPointerEx},
|
||||
};
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
bool JNI_LoadTypes(JNIEnv* env) {
|
||||
// Cache references to classes
|
||||
@@ -95,7 +95,7 @@ void JNI_UnloadTypes(JNIEnv* env) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
static std::vector<int> FromJavaBooleanArray(JNIEnv* env, jbooleanArray jarr) {
|
||||
CriticalJSpan<const jboolean> ref{env, jarr};
|
||||
@@ -128,7 +128,7 @@ static std::vector<std::string> FromJavaStringArray(JNIEnv* env, jobjectArray ja
|
||||
}
|
||||
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedBoolean value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedBoolean value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedBooleanCls, "<init>", "(JJZ)V");
|
||||
return env->NewObject(timestampedBooleanCls, constructor,
|
||||
@@ -137,7 +137,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedBoolean value) {
|
||||
static_cast<jboolean>(value.value));
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedInteger value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedInteger value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedIntegerCls, "<init>", "(JJJ)V");
|
||||
return env->NewObject(timestampedIntegerCls, constructor,
|
||||
@@ -146,7 +146,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedInteger value) {
|
||||
static_cast<jlong>(value.value));
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedFloat value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedFloat value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedFloatCls, "<init>", "(JJF)V");
|
||||
return env->NewObject(timestampedFloatCls, constructor,
|
||||
@@ -155,7 +155,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedFloat value) {
|
||||
static_cast<jfloat>(value.value));
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedDouble value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedDouble value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedDoubleCls, "<init>", "(JJD)V");
|
||||
return env->NewObject(timestampedDoubleCls, constructor,
|
||||
@@ -164,7 +164,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedDouble value) {
|
||||
static_cast<jdouble>(value.value));
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedString value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedString value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedStringCls, "<init>", "(JJLjava/lang/String;)V");
|
||||
JLocal<jstring> val{env, MakeJString(env, value.value)};
|
||||
@@ -173,7 +173,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedString value) {
|
||||
static_cast<jlong>(value.serverTime), val.obj());
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedRaw value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedRaw value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedRawCls, "<init>", "(JJ[B)V");
|
||||
JLocal<jbyteArray> val{env, MakeJByteArray(env, value.value)};
|
||||
@@ -182,7 +182,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedRaw value) {
|
||||
static_cast<jlong>(value.serverTime), val.obj());
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedBooleanArray value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedBooleanArray value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedBooleanArrayCls, "<init>", "(JJ[Z)V");
|
||||
JLocal<jbooleanArray> val{env, MakeJBooleanArray(env, value.value)};
|
||||
@@ -191,7 +191,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedBooleanArray value) {
|
||||
static_cast<jlong>(value.serverTime), val.obj());
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedIntegerArray value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedIntegerArray value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedIntegerArrayCls, "<init>", "(JJ[J)V");
|
||||
JLocal<jlongArray> val{env, MakeJLongArray(env, value.value)};
|
||||
@@ -200,7 +200,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedIntegerArray value) {
|
||||
static_cast<jlong>(value.serverTime), val.obj());
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedFloatArray value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedFloatArray value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedFloatArrayCls, "<init>", "(JJ[F)V");
|
||||
JLocal<jfloatArray> val{env, MakeJFloatArray(env, value.value)};
|
||||
@@ -209,7 +209,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedFloatArray value) {
|
||||
static_cast<jlong>(value.serverTime), val.obj());
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedDoubleArray value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedDoubleArray value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedDoubleArrayCls, "<init>", "(JJ[D)V");
|
||||
JLocal<jdoubleArray> val{env, MakeJDoubleArray(env, value.value)};
|
||||
@@ -218,7 +218,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedDoubleArray value) {
|
||||
static_cast<jlong>(value.serverTime), val.obj());
|
||||
}
|
||||
|
||||
static jobject MakeJObject(JNIEnv* env, nt::TimestampedStringArray value) {
|
||||
static jobject MakeJObject(JNIEnv* env, wpi::nt::TimestampedStringArray value) {
|
||||
static jmethodID constructor = env->GetMethodID(
|
||||
timestampedStringArrayCls, "<init>", "(JJ[Ljava/lang/Object;)V");
|
||||
JLocal<jobjectArray> val{env, MakeJStringArray(env, value.value)};
|
||||
@@ -228,7 +228,7 @@ static jobject MakeJObject(JNIEnv* env, nt::TimestampedStringArray value) {
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedBoolean> arr) {
|
||||
std::span<const wpi::nt::TimestampedBoolean> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedBooleanCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -242,7 +242,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedInteger> arr) {
|
||||
std::span<const wpi::nt::TimestampedInteger> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedIntegerCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -256,7 +256,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedFloat> arr) {
|
||||
std::span<const wpi::nt::TimestampedFloat> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedFloatCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -270,7 +270,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedDouble> arr) {
|
||||
std::span<const wpi::nt::TimestampedDouble> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedDoubleCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -284,7 +284,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedString> arr) {
|
||||
std::span<const wpi::nt::TimestampedString> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedStringCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -298,7 +298,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedRaw> arr) {
|
||||
std::span<const wpi::nt::TimestampedRaw> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedRawCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -312,7 +312,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedBooleanArray> arr) {
|
||||
std::span<const wpi::nt::TimestampedBooleanArray> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedBooleanArrayCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -326,7 +326,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedIntegerArray> arr) {
|
||||
std::span<const wpi::nt::TimestampedIntegerArray> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedIntegerArrayCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -340,7 +340,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedFloatArray> arr) {
|
||||
std::span<const wpi::nt::TimestampedFloatArray> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedFloatArrayCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -354,7 +354,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedDoubleArray> arr) {
|
||||
std::span<const wpi::nt::TimestampedDoubleArray> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedDoubleArrayCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -368,7 +368,7 @@ static jobjectArray MakeJObject(JNIEnv* env,
|
||||
}
|
||||
|
||||
static jobjectArray MakeJObject(JNIEnv* env,
|
||||
std::span<const nt::TimestampedStringArray> arr) {
|
||||
std::span<const wpi::nt::TimestampedStringArray> arr) {
|
||||
jobjectArray jarr =
|
||||
env->NewObjectArray(arr.size(), timestampedStringArrayCls, nullptr);
|
||||
if (!jarr) {
|
||||
@@ -471,7 +471,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicBoolean
|
||||
(JNIEnv* env, jclass, jint subentry, jboolean defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicBoolean(subentry, defaultValue != JNI_FALSE));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicBoolean(subentry, defaultValue != JNI_FALSE));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -483,7 +483,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueBoolean
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueBoolean(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueBoolean(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -495,7 +495,7 @@ JNIEXPORT jbooleanArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesBoolean
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJBooleanArray(env, nt::ReadQueueValuesBoolean(subentry));
|
||||
return MakeJBooleanArray(env, wpi::nt::ReadQueueValuesBoolean(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -507,7 +507,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setBoolean
|
||||
(JNIEnv*, jclass, jint entry, jlong time, jboolean value)
|
||||
{
|
||||
return nt::SetBoolean(entry, value != JNI_FALSE, time);
|
||||
return wpi::nt::SetBoolean(entry, value != JNI_FALSE, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -519,7 +519,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getBoolean
|
||||
(JNIEnv*, jclass, jint entry, jboolean defaultValue)
|
||||
{
|
||||
return nt::GetBoolean(entry, defaultValue);
|
||||
return wpi::nt::GetBoolean(entry, defaultValue);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -531,7 +531,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultBoolean
|
||||
(JNIEnv*, jclass, jint entry, jlong, jboolean defaultValue)
|
||||
{
|
||||
return nt::SetDefaultBoolean(entry, defaultValue != JNI_FALSE);
|
||||
return wpi::nt::SetDefaultBoolean(entry, defaultValue != JNI_FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -544,7 +544,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicInteger
|
||||
(JNIEnv* env, jclass, jint subentry, jlong defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicInteger(subentry, defaultValue));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicInteger(subentry, defaultValue));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -556,7 +556,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueInteger
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueInteger(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueInteger(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -568,7 +568,7 @@ JNIEXPORT jlongArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesInteger
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJLongArray(env, nt::ReadQueueValuesInteger(subentry));
|
||||
return MakeJLongArray(env, wpi::nt::ReadQueueValuesInteger(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -580,7 +580,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setInteger
|
||||
(JNIEnv*, jclass, jint entry, jlong time, jlong value)
|
||||
{
|
||||
return nt::SetInteger(entry, value, time);
|
||||
return wpi::nt::SetInteger(entry, value, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -592,7 +592,7 @@ JNIEXPORT jlong JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getInteger
|
||||
(JNIEnv*, jclass, jint entry, jlong defaultValue)
|
||||
{
|
||||
return nt::GetInteger(entry, defaultValue);
|
||||
return wpi::nt::GetInteger(entry, defaultValue);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -604,7 +604,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultInteger
|
||||
(JNIEnv*, jclass, jint entry, jlong, jlong defaultValue)
|
||||
{
|
||||
return nt::SetDefaultInteger(entry, defaultValue);
|
||||
return wpi::nt::SetDefaultInteger(entry, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -617,7 +617,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicFloat
|
||||
(JNIEnv* env, jclass, jint subentry, jfloat defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicFloat(subentry, defaultValue));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicFloat(subentry, defaultValue));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -629,7 +629,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueFloat
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueFloat(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueFloat(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -641,7 +641,7 @@ JNIEXPORT jfloatArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesFloat
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJFloatArray(env, nt::ReadQueueValuesFloat(subentry));
|
||||
return MakeJFloatArray(env, wpi::nt::ReadQueueValuesFloat(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -653,7 +653,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setFloat
|
||||
(JNIEnv*, jclass, jint entry, jlong time, jfloat value)
|
||||
{
|
||||
return nt::SetFloat(entry, value, time);
|
||||
return wpi::nt::SetFloat(entry, value, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -665,7 +665,7 @@ JNIEXPORT jfloat JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getFloat
|
||||
(JNIEnv*, jclass, jint entry, jfloat defaultValue)
|
||||
{
|
||||
return nt::GetFloat(entry, defaultValue);
|
||||
return wpi::nt::GetFloat(entry, defaultValue);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -677,7 +677,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultFloat
|
||||
(JNIEnv*, jclass, jint entry, jlong, jfloat defaultValue)
|
||||
{
|
||||
return nt::SetDefaultFloat(entry, defaultValue);
|
||||
return wpi::nt::SetDefaultFloat(entry, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicDouble
|
||||
(JNIEnv* env, jclass, jint subentry, jdouble defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicDouble(subentry, defaultValue));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicDouble(subentry, defaultValue));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -702,7 +702,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueDouble
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueDouble(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueDouble(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -714,7 +714,7 @@ JNIEXPORT jdoubleArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesDouble
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJDoubleArray(env, nt::ReadQueueValuesDouble(subentry));
|
||||
return MakeJDoubleArray(env, wpi::nt::ReadQueueValuesDouble(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -726,7 +726,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setDouble
|
||||
(JNIEnv*, jclass, jint entry, jlong time, jdouble value)
|
||||
{
|
||||
return nt::SetDouble(entry, value, time);
|
||||
return wpi::nt::SetDouble(entry, value, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -738,7 +738,7 @@ JNIEXPORT jdouble JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getDouble
|
||||
(JNIEnv*, jclass, jint entry, jdouble defaultValue)
|
||||
{
|
||||
return nt::GetDouble(entry, defaultValue);
|
||||
return wpi::nt::GetDouble(entry, defaultValue);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -750,7 +750,7 @@ JNIEXPORT jboolean JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultDouble
|
||||
(JNIEnv*, jclass, jint entry, jlong, jdouble defaultValue)
|
||||
{
|
||||
return nt::SetDefaultDouble(entry, defaultValue);
|
||||
return wpi::nt::SetDefaultDouble(entry, defaultValue);
|
||||
}
|
||||
|
||||
|
||||
@@ -763,7 +763,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicString
|
||||
(JNIEnv* env, jclass, jint subentry, jstring defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicString(subentry, JStringRef{env, defaultValue}));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicString(subentry, JStringRef{env, defaultValue}));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -775,7 +775,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueString
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueString(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueString(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -787,7 +787,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesString
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJStringArray(env, nt::ReadQueueValuesString(subentry));
|
||||
return MakeJStringArray(env, wpi::nt::ReadQueueValuesString(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -803,7 +803,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setString
|
||||
nullPointerEx.Throw(env, "value cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetString(entry, JStringRef{env, value}, time);
|
||||
return wpi::nt::SetString(entry, JStringRef{env, value}, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -815,7 +815,7 @@ JNIEXPORT jstring JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getString
|
||||
(JNIEnv* env, jclass, jint entry, jstring defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsString()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -835,7 +835,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultString
|
||||
nullPointerEx.Throw(env, "defaultValue cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultString(entry, JStringRef{env, defaultValue});
|
||||
return wpi::nt::SetDefaultString(entry, JStringRef{env, defaultValue});
|
||||
}
|
||||
|
||||
|
||||
@@ -848,7 +848,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicRaw
|
||||
(JNIEnv* env, jclass, jint subentry, jbyteArray defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicRaw(subentry, CriticalJSpan<const jbyte>{env, defaultValue}.uarray()));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicRaw(subentry, CriticalJSpan<const jbyte>{env, defaultValue}.uarray()));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -860,7 +860,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueRaw
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueRaw(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueRaw(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -872,7 +872,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesRaw
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObjectArray(env, nt::ReadQueueValuesRaw(subentry));
|
||||
return MakeJObjectArray(env, wpi::nt::ReadQueueValuesRaw(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -901,7 +901,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setRaw
|
||||
indexOobEx.Throw(env, "start + len must be smaller than array length");
|
||||
return false;
|
||||
}
|
||||
return nt::SetRaw(entry, cvalue.uarray().subspan(start, len), time);
|
||||
return wpi::nt::SetRaw(entry, cvalue.uarray().subspan(start, len), time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -930,7 +930,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setRawBuffer
|
||||
illegalArgEx.Throw(env, "value must be a native ByteBuffer");
|
||||
return false;
|
||||
}
|
||||
return nt::SetRaw(entry, cvalue.uarray().subspan(start, len), time);
|
||||
return wpi::nt::SetRaw(entry, cvalue.uarray().subspan(start, len), time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -942,7 +942,7 @@ JNIEXPORT jbyteArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getRaw
|
||||
(JNIEnv* env, jclass, jint entry, jbyteArray defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsRaw()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -975,7 +975,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultRaw
|
||||
indexOobEx.Throw(env, "start + len must be smaller than array length");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultRaw(entry, cvalue.uarray().subspan(start, len));
|
||||
return wpi::nt::SetDefaultRaw(entry, cvalue.uarray().subspan(start, len));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1004,7 +1004,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultRawBuffer
|
||||
illegalArgEx.Throw(env, "value must be a native ByteBuffer");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultRaw(entry, cvalue.uarray().subspan(start, len));
|
||||
return wpi::nt::SetDefaultRaw(entry, cvalue.uarray().subspan(start, len));
|
||||
}
|
||||
|
||||
|
||||
@@ -1017,7 +1017,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicBooleanArray
|
||||
(JNIEnv* env, jclass, jint subentry, jbooleanArray defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicBooleanArray(subentry, FromJavaBooleanArray(env, defaultValue)));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicBooleanArray(subentry, FromJavaBooleanArray(env, defaultValue)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1029,7 +1029,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueBooleanArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueBooleanArray(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueBooleanArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1041,7 +1041,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesBooleanArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObjectArray(env, nt::ReadQueueValuesBooleanArray(subentry));
|
||||
return MakeJObjectArray(env, wpi::nt::ReadQueueValuesBooleanArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1057,7 +1057,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setBooleanArray
|
||||
nullPointerEx.Throw(env, "value cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetBooleanArray(entry, FromJavaBooleanArray(env, value), time);
|
||||
return wpi::nt::SetBooleanArray(entry, FromJavaBooleanArray(env, value), time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1069,7 +1069,7 @@ JNIEXPORT jbooleanArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getBooleanArray
|
||||
(JNIEnv* env, jclass, jint entry, jbooleanArray defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsBooleanArray()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -1089,7 +1089,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultBooleanArray
|
||||
nullPointerEx.Throw(env, "defaultValue cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultBooleanArray(entry, FromJavaBooleanArray(env, defaultValue));
|
||||
return wpi::nt::SetDefaultBooleanArray(entry, FromJavaBooleanArray(env, defaultValue));
|
||||
}
|
||||
|
||||
|
||||
@@ -1102,7 +1102,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicIntegerArray
|
||||
(JNIEnv* env, jclass, jint subentry, jlongArray defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicIntegerArray(subentry, CriticalJSpan<const jlong>{env, defaultValue}));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicIntegerArray(subentry, CriticalJSpan<const jlong>{env, defaultValue}));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1114,7 +1114,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueIntegerArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueIntegerArray(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueIntegerArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1126,7 +1126,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesIntegerArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObjectArray(env, nt::ReadQueueValuesIntegerArray(subentry));
|
||||
return MakeJObjectArray(env, wpi::nt::ReadQueueValuesIntegerArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1142,7 +1142,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setIntegerArray
|
||||
nullPointerEx.Throw(env, "value cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetIntegerArray(entry, CriticalJSpan<const jlong>{env, value}, time);
|
||||
return wpi::nt::SetIntegerArray(entry, CriticalJSpan<const jlong>{env, value}, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1154,7 +1154,7 @@ JNIEXPORT jlongArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getIntegerArray
|
||||
(JNIEnv* env, jclass, jint entry, jlongArray defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsIntegerArray()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -1174,7 +1174,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultIntegerArray
|
||||
nullPointerEx.Throw(env, "defaultValue cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultIntegerArray(entry, CriticalJSpan<const jlong>{env, defaultValue});
|
||||
return wpi::nt::SetDefaultIntegerArray(entry, CriticalJSpan<const jlong>{env, defaultValue});
|
||||
}
|
||||
|
||||
|
||||
@@ -1187,7 +1187,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicFloatArray
|
||||
(JNIEnv* env, jclass, jint subentry, jfloatArray defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicFloatArray(subentry, CriticalJSpan<const jfloat>{env, defaultValue}));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicFloatArray(subentry, CriticalJSpan<const jfloat>{env, defaultValue}));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1199,7 +1199,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueFloatArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueFloatArray(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueFloatArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1211,7 +1211,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesFloatArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObjectArray(env, nt::ReadQueueValuesFloatArray(subentry));
|
||||
return MakeJObjectArray(env, wpi::nt::ReadQueueValuesFloatArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1227,7 +1227,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setFloatArray
|
||||
nullPointerEx.Throw(env, "value cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetFloatArray(entry, CriticalJSpan<const jfloat>{env, value}, time);
|
||||
return wpi::nt::SetFloatArray(entry, CriticalJSpan<const jfloat>{env, value}, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1239,7 +1239,7 @@ JNIEXPORT jfloatArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getFloatArray
|
||||
(JNIEnv* env, jclass, jint entry, jfloatArray defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsFloatArray()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultFloatArray
|
||||
nullPointerEx.Throw(env, "defaultValue cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultFloatArray(entry, CriticalJSpan<const jfloat>{env, defaultValue});
|
||||
return wpi::nt::SetDefaultFloatArray(entry, CriticalJSpan<const jfloat>{env, defaultValue});
|
||||
}
|
||||
|
||||
|
||||
@@ -1272,7 +1272,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicDoubleArray
|
||||
(JNIEnv* env, jclass, jint subentry, jdoubleArray defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicDoubleArray(subentry, CriticalJSpan<const jdouble>{env, defaultValue}));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicDoubleArray(subentry, CriticalJSpan<const jdouble>{env, defaultValue}));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1284,7 +1284,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueDoubleArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueDoubleArray(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueDoubleArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1296,7 +1296,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesDoubleArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObjectArray(env, nt::ReadQueueValuesDoubleArray(subentry));
|
||||
return MakeJObjectArray(env, wpi::nt::ReadQueueValuesDoubleArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1312,7 +1312,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDoubleArray
|
||||
nullPointerEx.Throw(env, "value cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDoubleArray(entry, CriticalJSpan<const jdouble>{env, value}, time);
|
||||
return wpi::nt::SetDoubleArray(entry, CriticalJSpan<const jdouble>{env, value}, time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1324,7 +1324,7 @@ JNIEXPORT jdoubleArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getDoubleArray
|
||||
(JNIEnv* env, jclass, jint entry, jdoubleArray defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsDoubleArray()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -1344,7 +1344,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultDoubleArray
|
||||
nullPointerEx.Throw(env, "defaultValue cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultDoubleArray(entry, CriticalJSpan<const jdouble>{env, defaultValue});
|
||||
return wpi::nt::SetDefaultDoubleArray(entry, CriticalJSpan<const jdouble>{env, defaultValue});
|
||||
}
|
||||
|
||||
|
||||
@@ -1357,7 +1357,7 @@ JNIEXPORT jobject JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getAtomicStringArray
|
||||
(JNIEnv* env, jclass, jint subentry, jobjectArray defaultValue)
|
||||
{
|
||||
return MakeJObject(env, nt::GetAtomicStringArray(subentry, FromJavaStringArray(env, defaultValue)));
|
||||
return MakeJObject(env, wpi::nt::GetAtomicStringArray(subentry, FromJavaStringArray(env, defaultValue)));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1369,7 +1369,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueStringArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObject(env, nt::ReadQueueStringArray(subentry));
|
||||
return MakeJObject(env, wpi::nt::ReadQueueStringArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1381,7 +1381,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_readQueueValuesStringArray
|
||||
(JNIEnv* env, jclass, jint subentry)
|
||||
{
|
||||
return MakeJObjectArray(env, nt::ReadQueueValuesStringArray(subentry));
|
||||
return MakeJObjectArray(env, wpi::nt::ReadQueueValuesStringArray(subentry));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1397,7 +1397,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setStringArray
|
||||
nullPointerEx.Throw(env, "value cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetStringArray(entry, FromJavaStringArray(env, value), time);
|
||||
return wpi::nt::SetStringArray(entry, FromJavaStringArray(env, value), time);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1409,7 +1409,7 @@ JNIEXPORT jobjectArray JNICALL
|
||||
Java_org_wpilib_networktables_NetworkTablesJNI_getStringArray
|
||||
(JNIEnv* env, jclass, jint entry, jobjectArray defaultValue)
|
||||
{
|
||||
auto val = nt::GetEntryValue(entry);
|
||||
auto val = wpi::nt::GetEntryValue(entry);
|
||||
if (!val || !val.IsStringArray()) {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -1429,7 +1429,7 @@ Java_org_wpilib_networktables_NetworkTablesJNI_setDefaultStringArray
|
||||
nullPointerEx.Throw(env, "defaultValue cannot be null");
|
||||
return false;
|
||||
}
|
||||
return nt::SetDefaultStringArray(entry, FromJavaStringArray(env, defaultValue));
|
||||
return wpi::nt::SetDefaultStringArray(entry, FromJavaStringArray(env, defaultValue));
|
||||
}
|
||||
|
||||
|
||||
|
||||
144
ntcore/src/generated/main/native/cpp/ntcore_c_types.cpp
generated
144
ntcore/src/generated/main/native/cpp/ntcore_c_types.cpp
generated
@@ -9,7 +9,7 @@
|
||||
#include "Value_internal.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
using namespace nt;
|
||||
using namespace wpi::nt;
|
||||
|
||||
template <typename T>
|
||||
static inline std::span<const T> ConvertFromC(const T* arr, size_t size) {
|
||||
@@ -17,7 +17,7 @@ static inline std::span<const T> ConvertFromC(const T* arr, size_t size) {
|
||||
}
|
||||
|
||||
static inline std::string_view ConvertFromC(const struct WPI_String* str) {
|
||||
return wpi::to_string_view(str);
|
||||
return wpi::util::to_string_view(str);
|
||||
}
|
||||
|
||||
static std::vector<std::string> ConvertFromC(const struct WPI_String* arr, size_t size) {
|
||||
@@ -30,67 +30,67 @@ static std::vector<std::string> ConvertFromC(const struct WPI_String* arr, size_
|
||||
}
|
||||
|
||||
|
||||
static void ConvertToC(const nt::TimestampedBoolean& in, NT_TimestampedBoolean* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedBoolean& in, NT_TimestampedBoolean* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = in.value;
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedInteger& in, NT_TimestampedInteger* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedInteger& in, NT_TimestampedInteger* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = in.value;
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedFloat& in, NT_TimestampedFloat* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedFloat& in, NT_TimestampedFloat* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = in.value;
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedDouble& in, NT_TimestampedDouble* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedDouble& in, NT_TimestampedDouble* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = in.value;
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedString& in, NT_TimestampedString* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedString& in, NT_TimestampedString* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
ConvertToC(in.value, &out->value);
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedRaw& in, NT_TimestampedRaw* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedRaw& in, NT_TimestampedRaw* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = ConvertToC<uint8_t>(in.value, &out->len);
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedBooleanArray& in, NT_TimestampedBooleanArray* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedBooleanArray& in, NT_TimestampedBooleanArray* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = ConvertToC<NT_Bool>(in.value, &out->len);
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedIntegerArray& in, NT_TimestampedIntegerArray* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedIntegerArray& in, NT_TimestampedIntegerArray* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = ConvertToC<int64_t>(in.value, &out->len);
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedFloatArray& in, NT_TimestampedFloatArray* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedFloatArray& in, NT_TimestampedFloatArray* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = ConvertToC<float>(in.value, &out->len);
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedDoubleArray& in, NT_TimestampedDoubleArray* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedDoubleArray& in, NT_TimestampedDoubleArray* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = ConvertToC<double>(in.value, &out->len);
|
||||
}
|
||||
|
||||
static void ConvertToC(const nt::TimestampedStringArray& in, NT_TimestampedStringArray* out) {
|
||||
static void ConvertToC(const wpi::nt::TimestampedStringArray& in, NT_TimestampedStringArray* out) {
|
||||
out->time = in.time;
|
||||
out->serverTime = in.serverTime;
|
||||
out->value = ConvertToC<struct WPI_String>(in.value, &out->len);
|
||||
@@ -100,19 +100,19 @@ static void ConvertToC(const nt::TimestampedStringArray& in, NT_TimestampedStrin
|
||||
extern "C" {
|
||||
|
||||
NT_Bool NT_SetBoolean(NT_Handle pubentry, int64_t time, NT_Bool value) {
|
||||
return nt::SetBoolean(pubentry, value, time);
|
||||
return wpi::nt::SetBoolean(pubentry, value, time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultBoolean(NT_Handle pubentry, NT_Bool defaultValue) {
|
||||
return nt::SetDefaultBoolean(pubentry, defaultValue);
|
||||
return wpi::nt::SetDefaultBoolean(pubentry, defaultValue);
|
||||
}
|
||||
|
||||
NT_Bool NT_GetBoolean(NT_Handle subentry, NT_Bool defaultValue) {
|
||||
return nt::GetBoolean(subentry, defaultValue);
|
||||
return wpi::nt::GetBoolean(subentry, defaultValue);
|
||||
}
|
||||
|
||||
void NT_GetAtomicBoolean(NT_Handle subentry, NT_Bool defaultValue, struct NT_TimestampedBoolean* value) {
|
||||
auto cppValue = nt::GetAtomicBoolean(subentry, defaultValue);
|
||||
auto cppValue = wpi::nt::GetAtomicBoolean(subentry, defaultValue);
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void NT_DisposeTimestampedBoolean(struct NT_TimestampedBoolean* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedBoolean* NT_ReadQueueBoolean(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueBoolean(subentry);
|
||||
auto arr = wpi::nt::ReadQueueBoolean(subentry);
|
||||
return ConvertToC<NT_TimestampedBoolean>(arr, len);
|
||||
}
|
||||
|
||||
@@ -131,25 +131,25 @@ void NT_FreeQueueBoolean(struct NT_TimestampedBoolean* arr, size_t len) {
|
||||
std::free(arr);
|
||||
}
|
||||
NT_Bool* NT_ReadQueueValuesBoolean(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueValuesBoolean(subentry);
|
||||
auto arr = wpi::nt::ReadQueueValuesBoolean(subentry);
|
||||
return ConvertToC<NT_Bool>(arr, len);
|
||||
}
|
||||
|
||||
|
||||
NT_Bool NT_SetInteger(NT_Handle pubentry, int64_t time, int64_t value) {
|
||||
return nt::SetInteger(pubentry, value, time);
|
||||
return wpi::nt::SetInteger(pubentry, value, time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultInteger(NT_Handle pubentry, int64_t defaultValue) {
|
||||
return nt::SetDefaultInteger(pubentry, defaultValue);
|
||||
return wpi::nt::SetDefaultInteger(pubentry, defaultValue);
|
||||
}
|
||||
|
||||
int64_t NT_GetInteger(NT_Handle subentry, int64_t defaultValue) {
|
||||
return nt::GetInteger(subentry, defaultValue);
|
||||
return wpi::nt::GetInteger(subentry, defaultValue);
|
||||
}
|
||||
|
||||
void NT_GetAtomicInteger(NT_Handle subentry, int64_t defaultValue, struct NT_TimestampedInteger* value) {
|
||||
auto cppValue = nt::GetAtomicInteger(subentry, defaultValue);
|
||||
auto cppValue = wpi::nt::GetAtomicInteger(subentry, defaultValue);
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ void NT_DisposeTimestampedInteger(struct NT_TimestampedInteger* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedInteger* NT_ReadQueueInteger(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueInteger(subentry);
|
||||
auto arr = wpi::nt::ReadQueueInteger(subentry);
|
||||
return ConvertToC<NT_TimestampedInteger>(arr, len);
|
||||
}
|
||||
|
||||
@@ -168,25 +168,25 @@ void NT_FreeQueueInteger(struct NT_TimestampedInteger* arr, size_t len) {
|
||||
std::free(arr);
|
||||
}
|
||||
int64_t* NT_ReadQueueValuesInteger(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueValuesInteger(subentry);
|
||||
auto arr = wpi::nt::ReadQueueValuesInteger(subentry);
|
||||
return ConvertToC<int64_t>(arr, len);
|
||||
}
|
||||
|
||||
|
||||
NT_Bool NT_SetFloat(NT_Handle pubentry, int64_t time, float value) {
|
||||
return nt::SetFloat(pubentry, value, time);
|
||||
return wpi::nt::SetFloat(pubentry, value, time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultFloat(NT_Handle pubentry, float defaultValue) {
|
||||
return nt::SetDefaultFloat(pubentry, defaultValue);
|
||||
return wpi::nt::SetDefaultFloat(pubentry, defaultValue);
|
||||
}
|
||||
|
||||
float NT_GetFloat(NT_Handle subentry, float defaultValue) {
|
||||
return nt::GetFloat(subentry, defaultValue);
|
||||
return wpi::nt::GetFloat(subentry, defaultValue);
|
||||
}
|
||||
|
||||
void NT_GetAtomicFloat(NT_Handle subentry, float defaultValue, struct NT_TimestampedFloat* value) {
|
||||
auto cppValue = nt::GetAtomicFloat(subentry, defaultValue);
|
||||
auto cppValue = wpi::nt::GetAtomicFloat(subentry, defaultValue);
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ void NT_DisposeTimestampedFloat(struct NT_TimestampedFloat* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedFloat* NT_ReadQueueFloat(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueFloat(subentry);
|
||||
auto arr = wpi::nt::ReadQueueFloat(subentry);
|
||||
return ConvertToC<NT_TimestampedFloat>(arr, len);
|
||||
}
|
||||
|
||||
@@ -205,25 +205,25 @@ void NT_FreeQueueFloat(struct NT_TimestampedFloat* arr, size_t len) {
|
||||
std::free(arr);
|
||||
}
|
||||
float* NT_ReadQueueValuesFloat(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueValuesFloat(subentry);
|
||||
auto arr = wpi::nt::ReadQueueValuesFloat(subentry);
|
||||
return ConvertToC<float>(arr, len);
|
||||
}
|
||||
|
||||
|
||||
NT_Bool NT_SetDouble(NT_Handle pubentry, int64_t time, double value) {
|
||||
return nt::SetDouble(pubentry, value, time);
|
||||
return wpi::nt::SetDouble(pubentry, value, time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultDouble(NT_Handle pubentry, double defaultValue) {
|
||||
return nt::SetDefaultDouble(pubentry, defaultValue);
|
||||
return wpi::nt::SetDefaultDouble(pubentry, defaultValue);
|
||||
}
|
||||
|
||||
double NT_GetDouble(NT_Handle subentry, double defaultValue) {
|
||||
return nt::GetDouble(subentry, defaultValue);
|
||||
return wpi::nt::GetDouble(subentry, defaultValue);
|
||||
}
|
||||
|
||||
void NT_GetAtomicDouble(NT_Handle subentry, double defaultValue, struct NT_TimestampedDouble* value) {
|
||||
auto cppValue = nt::GetAtomicDouble(subentry, defaultValue);
|
||||
auto cppValue = wpi::nt::GetAtomicDouble(subentry, defaultValue);
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ void NT_DisposeTimestampedDouble(struct NT_TimestampedDouble* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedDouble* NT_ReadQueueDouble(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueDouble(subentry);
|
||||
auto arr = wpi::nt::ReadQueueDouble(subentry);
|
||||
return ConvertToC<NT_TimestampedDouble>(arr, len);
|
||||
}
|
||||
|
||||
@@ -242,26 +242,26 @@ void NT_FreeQueueDouble(struct NT_TimestampedDouble* arr, size_t len) {
|
||||
std::free(arr);
|
||||
}
|
||||
double* NT_ReadQueueValuesDouble(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueValuesDouble(subentry);
|
||||
auto arr = wpi::nt::ReadQueueValuesDouble(subentry);
|
||||
return ConvertToC<double>(arr, len);
|
||||
}
|
||||
|
||||
|
||||
NT_Bool NT_SetString(NT_Handle pubentry, int64_t time, const struct WPI_String* value) {
|
||||
return nt::SetString(pubentry, ConvertFromC(value), time);
|
||||
return wpi::nt::SetString(pubentry, ConvertFromC(value), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultString(NT_Handle pubentry, const struct WPI_String* defaultValue) {
|
||||
return nt::SetDefaultString(pubentry, ConvertFromC(defaultValue));
|
||||
return wpi::nt::SetDefaultString(pubentry, ConvertFromC(defaultValue));
|
||||
}
|
||||
|
||||
void NT_GetString(NT_Handle subentry, const struct WPI_String* defaultValue, struct WPI_String* value) {
|
||||
auto cppValue = nt::GetString(subentry, ConvertFromC(defaultValue));
|
||||
auto cppValue = wpi::nt::GetString(subentry, ConvertFromC(defaultValue));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
void NT_GetAtomicString(NT_Handle subentry, const struct WPI_String* defaultValue, struct NT_TimestampedString* value) {
|
||||
auto cppValue = nt::GetAtomicString(subentry, ConvertFromC(defaultValue));
|
||||
auto cppValue = wpi::nt::GetAtomicString(subentry, ConvertFromC(defaultValue));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ void NT_DisposeTimestampedString(struct NT_TimestampedString* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedString* NT_ReadQueueString(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueString(subentry);
|
||||
auto arr = wpi::nt::ReadQueueString(subentry);
|
||||
return ConvertToC<NT_TimestampedString>(arr, len);
|
||||
}
|
||||
|
||||
@@ -283,20 +283,20 @@ void NT_FreeQueueString(struct NT_TimestampedString* arr, size_t len) {
|
||||
|
||||
|
||||
NT_Bool NT_SetRaw(NT_Handle pubentry, int64_t time, const uint8_t* value, size_t len) {
|
||||
return nt::SetRaw(pubentry, ConvertFromC(value, len), time);
|
||||
return wpi::nt::SetRaw(pubentry, ConvertFromC(value, len), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultRaw(NT_Handle pubentry, const uint8_t* defaultValue, size_t defaultValueLen) {
|
||||
return nt::SetDefaultRaw(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return wpi::nt::SetDefaultRaw(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
}
|
||||
|
||||
uint8_t* NT_GetRaw(NT_Handle subentry, const uint8_t* defaultValue, size_t defaultValueLen, size_t* len) {
|
||||
auto cppValue = nt::GetRaw(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetRaw(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return ConvertToC<uint8_t>(cppValue, len);
|
||||
}
|
||||
|
||||
void NT_GetAtomicRaw(NT_Handle subentry, const uint8_t* defaultValue, size_t defaultValueLen, struct NT_TimestampedRaw* value) {
|
||||
auto cppValue = nt::GetAtomicRaw(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetAtomicRaw(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ void NT_DisposeTimestampedRaw(struct NT_TimestampedRaw* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedRaw* NT_ReadQueueRaw(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueRaw(subentry);
|
||||
auto arr = wpi::nt::ReadQueueRaw(subentry);
|
||||
return ConvertToC<NT_TimestampedRaw>(arr, len);
|
||||
}
|
||||
|
||||
@@ -318,20 +318,20 @@ void NT_FreeQueueRaw(struct NT_TimestampedRaw* arr, size_t len) {
|
||||
|
||||
|
||||
NT_Bool NT_SetBooleanArray(NT_Handle pubentry, int64_t time, const NT_Bool* value, size_t len) {
|
||||
return nt::SetBooleanArray(pubentry, ConvertFromC(value, len), time);
|
||||
return wpi::nt::SetBooleanArray(pubentry, ConvertFromC(value, len), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultBooleanArray(NT_Handle pubentry, const NT_Bool* defaultValue, size_t defaultValueLen) {
|
||||
return nt::SetDefaultBooleanArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return wpi::nt::SetDefaultBooleanArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
}
|
||||
|
||||
NT_Bool* NT_GetBooleanArray(NT_Handle subentry, const NT_Bool* defaultValue, size_t defaultValueLen, size_t* len) {
|
||||
auto cppValue = nt::GetBooleanArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetBooleanArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return ConvertToC<NT_Bool>(cppValue, len);
|
||||
}
|
||||
|
||||
void NT_GetAtomicBooleanArray(NT_Handle subentry, const NT_Bool* defaultValue, size_t defaultValueLen, struct NT_TimestampedBooleanArray* value) {
|
||||
auto cppValue = nt::GetAtomicBooleanArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetAtomicBooleanArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ void NT_DisposeTimestampedBooleanArray(struct NT_TimestampedBooleanArray* value)
|
||||
}
|
||||
|
||||
struct NT_TimestampedBooleanArray* NT_ReadQueueBooleanArray(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueBooleanArray(subentry);
|
||||
auto arr = wpi::nt::ReadQueueBooleanArray(subentry);
|
||||
return ConvertToC<NT_TimestampedBooleanArray>(arr, len);
|
||||
}
|
||||
|
||||
@@ -353,20 +353,20 @@ void NT_FreeQueueBooleanArray(struct NT_TimestampedBooleanArray* arr, size_t len
|
||||
|
||||
|
||||
NT_Bool NT_SetIntegerArray(NT_Handle pubentry, int64_t time, const int64_t* value, size_t len) {
|
||||
return nt::SetIntegerArray(pubentry, ConvertFromC(value, len), time);
|
||||
return wpi::nt::SetIntegerArray(pubentry, ConvertFromC(value, len), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultIntegerArray(NT_Handle pubentry, const int64_t* defaultValue, size_t defaultValueLen) {
|
||||
return nt::SetDefaultIntegerArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return wpi::nt::SetDefaultIntegerArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
}
|
||||
|
||||
int64_t* NT_GetIntegerArray(NT_Handle subentry, const int64_t* defaultValue, size_t defaultValueLen, size_t* len) {
|
||||
auto cppValue = nt::GetIntegerArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetIntegerArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return ConvertToC<int64_t>(cppValue, len);
|
||||
}
|
||||
|
||||
void NT_GetAtomicIntegerArray(NT_Handle subentry, const int64_t* defaultValue, size_t defaultValueLen, struct NT_TimestampedIntegerArray* value) {
|
||||
auto cppValue = nt::GetAtomicIntegerArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetAtomicIntegerArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ void NT_DisposeTimestampedIntegerArray(struct NT_TimestampedIntegerArray* value)
|
||||
}
|
||||
|
||||
struct NT_TimestampedIntegerArray* NT_ReadQueueIntegerArray(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueIntegerArray(subentry);
|
||||
auto arr = wpi::nt::ReadQueueIntegerArray(subentry);
|
||||
return ConvertToC<NT_TimestampedIntegerArray>(arr, len);
|
||||
}
|
||||
|
||||
@@ -388,20 +388,20 @@ void NT_FreeQueueIntegerArray(struct NT_TimestampedIntegerArray* arr, size_t len
|
||||
|
||||
|
||||
NT_Bool NT_SetFloatArray(NT_Handle pubentry, int64_t time, const float* value, size_t len) {
|
||||
return nt::SetFloatArray(pubentry, ConvertFromC(value, len), time);
|
||||
return wpi::nt::SetFloatArray(pubentry, ConvertFromC(value, len), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultFloatArray(NT_Handle pubentry, const float* defaultValue, size_t defaultValueLen) {
|
||||
return nt::SetDefaultFloatArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return wpi::nt::SetDefaultFloatArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
}
|
||||
|
||||
float* NT_GetFloatArray(NT_Handle subentry, const float* defaultValue, size_t defaultValueLen, size_t* len) {
|
||||
auto cppValue = nt::GetFloatArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetFloatArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return ConvertToC<float>(cppValue, len);
|
||||
}
|
||||
|
||||
void NT_GetAtomicFloatArray(NT_Handle subentry, const float* defaultValue, size_t defaultValueLen, struct NT_TimestampedFloatArray* value) {
|
||||
auto cppValue = nt::GetAtomicFloatArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetAtomicFloatArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ void NT_DisposeTimestampedFloatArray(struct NT_TimestampedFloatArray* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedFloatArray* NT_ReadQueueFloatArray(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueFloatArray(subentry);
|
||||
auto arr = wpi::nt::ReadQueueFloatArray(subentry);
|
||||
return ConvertToC<NT_TimestampedFloatArray>(arr, len);
|
||||
}
|
||||
|
||||
@@ -423,20 +423,20 @@ void NT_FreeQueueFloatArray(struct NT_TimestampedFloatArray* arr, size_t len) {
|
||||
|
||||
|
||||
NT_Bool NT_SetDoubleArray(NT_Handle pubentry, int64_t time, const double* value, size_t len) {
|
||||
return nt::SetDoubleArray(pubentry, ConvertFromC(value, len), time);
|
||||
return wpi::nt::SetDoubleArray(pubentry, ConvertFromC(value, len), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultDoubleArray(NT_Handle pubentry, const double* defaultValue, size_t defaultValueLen) {
|
||||
return nt::SetDefaultDoubleArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return wpi::nt::SetDefaultDoubleArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
}
|
||||
|
||||
double* NT_GetDoubleArray(NT_Handle subentry, const double* defaultValue, size_t defaultValueLen, size_t* len) {
|
||||
auto cppValue = nt::GetDoubleArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetDoubleArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return ConvertToC<double>(cppValue, len);
|
||||
}
|
||||
|
||||
void NT_GetAtomicDoubleArray(NT_Handle subentry, const double* defaultValue, size_t defaultValueLen, struct NT_TimestampedDoubleArray* value) {
|
||||
auto cppValue = nt::GetAtomicDoubleArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetAtomicDoubleArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ void NT_DisposeTimestampedDoubleArray(struct NT_TimestampedDoubleArray* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedDoubleArray* NT_ReadQueueDoubleArray(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueDoubleArray(subentry);
|
||||
auto arr = wpi::nt::ReadQueueDoubleArray(subentry);
|
||||
return ConvertToC<NT_TimestampedDoubleArray>(arr, len);
|
||||
}
|
||||
|
||||
@@ -458,20 +458,20 @@ void NT_FreeQueueDoubleArray(struct NT_TimestampedDoubleArray* arr, size_t len)
|
||||
|
||||
|
||||
NT_Bool NT_SetStringArray(NT_Handle pubentry, int64_t time, const struct WPI_String* value, size_t len) {
|
||||
return nt::SetStringArray(pubentry, ConvertFromC(value, len), time);
|
||||
return wpi::nt::SetStringArray(pubentry, ConvertFromC(value, len), time);
|
||||
}
|
||||
|
||||
NT_Bool NT_SetDefaultStringArray(NT_Handle pubentry, const struct WPI_String* defaultValue, size_t defaultValueLen) {
|
||||
return nt::SetDefaultStringArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return wpi::nt::SetDefaultStringArray(pubentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
}
|
||||
|
||||
struct WPI_String* NT_GetStringArray(NT_Handle subentry, const struct WPI_String* defaultValue, size_t defaultValueLen, size_t* len) {
|
||||
auto cppValue = nt::GetStringArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetStringArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
return ConvertToC<struct WPI_String>(cppValue, len);
|
||||
}
|
||||
|
||||
void NT_GetAtomicStringArray(NT_Handle subentry, const struct WPI_String* defaultValue, size_t defaultValueLen, struct NT_TimestampedStringArray* value) {
|
||||
auto cppValue = nt::GetAtomicStringArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
auto cppValue = wpi::nt::GetAtomicStringArray(subentry, ConvertFromC(defaultValue, defaultValueLen));
|
||||
ConvertToC(cppValue, value);
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ void NT_DisposeTimestampedStringArray(struct NT_TimestampedStringArray* value) {
|
||||
}
|
||||
|
||||
struct NT_TimestampedStringArray* NT_ReadQueueStringArray(NT_Handle subentry, size_t* len) {
|
||||
auto arr = nt::ReadQueueStringArray(subentry);
|
||||
auto arr = wpi::nt::ReadQueueStringArray(subentry);
|
||||
return ConvertToC<NT_TimestampedStringArray>(arr, len);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#include "InstanceImpl.hpp"
|
||||
|
||||
namespace {
|
||||
template <nt::ValidType T>
|
||||
template <wpi::nt::ValidType T>
|
||||
struct ValuesType {
|
||||
using Vector =
|
||||
std::vector<typename nt::TypeInfo<std::remove_cvref_t<T>>::Value>;
|
||||
std::vector<typename wpi::nt::TypeInfo<std::remove_cvref_t<T>>::Value>;
|
||||
};
|
||||
|
||||
template <>
|
||||
@@ -22,7 +22,7 @@ struct ValuesType<bool> {
|
||||
};
|
||||
} // namespace
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
template <ValidType T>
|
||||
static inline bool Set(NT_Handle pubentry, typename TypeInfo<T>::View value,
|
||||
@@ -59,7 +59,7 @@ static inline Timestamped<typename TypeInfo<T>::Value> GetAtomic(
|
||||
template <ValidType T>
|
||||
inline Timestamped<typename TypeInfo<T>::SmallRet> GetAtomic(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<typename TypeInfo<T>::SmallElem>& buf,
|
||||
wpi::util::SmallVectorImpl<typename TypeInfo<T>::SmallElem>& buf,
|
||||
typename TypeInfo<T>::View defaultValue) {
|
||||
if (auto ii = InstanceImpl::Get(Handle{subentry}.GetInst())) {
|
||||
return ii->localStorage.GetAtomic<T>(subentry, buf, defaultValue);
|
||||
@@ -221,14 +221,14 @@ std::vector<std::string> ReadQueueValuesString(NT_Handle subentry) {
|
||||
|
||||
std::string_view GetString(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::util::SmallVectorImpl<char>& buf,
|
||||
std::string_view defaultValue) {
|
||||
return GetAtomic<std::string>(subentry, buf, defaultValue).value;
|
||||
}
|
||||
|
||||
TimestampedStringView GetAtomicString(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::util::SmallVectorImpl<char>& buf,
|
||||
std::string_view defaultValue) {
|
||||
return GetAtomic<std::string>(subentry, buf, defaultValue);
|
||||
}
|
||||
@@ -261,14 +261,14 @@ std::vector<std::vector<uint8_t>> ReadQueueValuesRaw(NT_Handle subentry) {
|
||||
|
||||
std::span<uint8_t> GetRaw(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<uint8_t>& buf,
|
||||
wpi::util::SmallVectorImpl<uint8_t>& buf,
|
||||
std::span<const uint8_t> defaultValue) {
|
||||
return GetAtomic<uint8_t[]>(subentry, buf, defaultValue).value;
|
||||
}
|
||||
|
||||
TimestampedRawView GetAtomicRaw(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<uint8_t>& buf,
|
||||
wpi::util::SmallVectorImpl<uint8_t>& buf,
|
||||
std::span<const uint8_t> defaultValue) {
|
||||
return GetAtomic<uint8_t[]>(subentry, buf, defaultValue);
|
||||
}
|
||||
@@ -301,14 +301,14 @@ std::vector<std::vector<int>> ReadQueueValuesBooleanArray(NT_Handle subentry) {
|
||||
|
||||
std::span<int> GetBooleanArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<int>& buf,
|
||||
wpi::util::SmallVectorImpl<int>& buf,
|
||||
std::span<const int> defaultValue) {
|
||||
return GetAtomic<bool[]>(subentry, buf, defaultValue).value;
|
||||
}
|
||||
|
||||
TimestampedBooleanArrayView GetAtomicBooleanArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<int>& buf,
|
||||
wpi::util::SmallVectorImpl<int>& buf,
|
||||
std::span<const int> defaultValue) {
|
||||
return GetAtomic<bool[]>(subentry, buf, defaultValue);
|
||||
}
|
||||
@@ -341,14 +341,14 @@ std::vector<std::vector<int64_t>> ReadQueueValuesIntegerArray(NT_Handle subentry
|
||||
|
||||
std::span<int64_t> GetIntegerArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<int64_t>& buf,
|
||||
wpi::util::SmallVectorImpl<int64_t>& buf,
|
||||
std::span<const int64_t> defaultValue) {
|
||||
return GetAtomic<int64_t[]>(subentry, buf, defaultValue).value;
|
||||
}
|
||||
|
||||
TimestampedIntegerArrayView GetAtomicIntegerArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<int64_t>& buf,
|
||||
wpi::util::SmallVectorImpl<int64_t>& buf,
|
||||
std::span<const int64_t> defaultValue) {
|
||||
return GetAtomic<int64_t[]>(subentry, buf, defaultValue);
|
||||
}
|
||||
@@ -381,14 +381,14 @@ std::vector<std::vector<float>> ReadQueueValuesFloatArray(NT_Handle subentry) {
|
||||
|
||||
std::span<float> GetFloatArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<float>& buf,
|
||||
wpi::util::SmallVectorImpl<float>& buf,
|
||||
std::span<const float> defaultValue) {
|
||||
return GetAtomic<float[]>(subentry, buf, defaultValue).value;
|
||||
}
|
||||
|
||||
TimestampedFloatArrayView GetAtomicFloatArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<float>& buf,
|
||||
wpi::util::SmallVectorImpl<float>& buf,
|
||||
std::span<const float> defaultValue) {
|
||||
return GetAtomic<float[]>(subentry, buf, defaultValue);
|
||||
}
|
||||
@@ -421,14 +421,14 @@ std::vector<std::vector<double>> ReadQueueValuesDoubleArray(NT_Handle subentry)
|
||||
|
||||
std::span<double> GetDoubleArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<double>& buf,
|
||||
wpi::util::SmallVectorImpl<double>& buf,
|
||||
std::span<const double> defaultValue) {
|
||||
return GetAtomic<double[]>(subentry, buf, defaultValue).value;
|
||||
}
|
||||
|
||||
TimestampedDoubleArrayView GetAtomicDoubleArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<double>& buf,
|
||||
wpi::util::SmallVectorImpl<double>& buf,
|
||||
std::span<const double> defaultValue) {
|
||||
return GetAtomic<double[]>(subentry, buf, defaultValue);
|
||||
}
|
||||
@@ -460,4 +460,4 @@ std::vector<std::vector<std::string>> ReadQueueValuesStringArray(NT_Handle suben
|
||||
}
|
||||
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class BooleanArrayTopic;
|
||||
|
||||
@@ -74,7 +74,7 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetBooleanArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetBooleanArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* @param buf storage for returned value
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return Get(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* @param defaultValue default value to return if no value has been published
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return nt::GetBooleanArray(m_subHandle, buf, defaultValue);
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return wpi::nt::GetBooleanArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicBooleanArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicBooleanArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return GetAtomic(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf,
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf,
|
||||
ParamType defaultValue) const {
|
||||
return nt::GetAtomicBooleanArray(m_subHandle, buf, defaultValue);
|
||||
return wpi::nt::GetAtomicBooleanArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ class BooleanArraySubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueBooleanArray(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueBooleanArray(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ class BooleanArrayPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetBooleanArray(m_pubHandle, value, time);
|
||||
::wpi::nt::SetBooleanArray(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ class BooleanArrayPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultBooleanArray(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultBooleanArray(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ class BooleanArrayEntry final : public BooleanArraySubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ class BooleanArrayTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -365,7 +365,7 @@ class BooleanArrayTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_BOOLEAN_ARRAY, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class BooleanArrayTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanArrayPublisher{
|
||||
::nt::Publish(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,9 +410,9 @@ class BooleanArrayTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanArrayPublisher{
|
||||
::nt::PublishEx(m_handle, NT_BOOLEAN_ARRAY, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_BOOLEAN_ARRAY, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,7 +439,7 @@ class BooleanArrayTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN_ARRAY, "boolean[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -467,22 +467,22 @@ class BooleanArrayTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_BOOLEAN_ARRAY, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline BooleanArrayTopic BooleanArraySubscriber::GetTopic() const {
|
||||
return BooleanArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return BooleanArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline BooleanArrayTopic BooleanArrayPublisher::GetTopic() const {
|
||||
return BooleanArrayTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return BooleanArrayTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline BooleanArrayTopic BooleanArrayEntry::GetTopic() const {
|
||||
return BooleanArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return BooleanArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class BooleanTopic;
|
||||
|
||||
@@ -70,7 +70,7 @@ class BooleanSubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetBoolean(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetBoolean(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@ class BooleanSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicBoolean(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicBoolean(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class BooleanSubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueBoolean(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueBoolean(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ class BooleanPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetBoolean(m_pubHandle, value, time);
|
||||
::wpi::nt::SetBoolean(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class BooleanPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultBoolean(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultBoolean(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@ class BooleanEntry final : public BooleanSubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ class BooleanTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_BOOLEAN, "boolean", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN, "boolean", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ class BooleanTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_BOOLEAN, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_BOOLEAN, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ class BooleanTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanPublisher{
|
||||
::nt::Publish(m_handle, NT_BOOLEAN, "boolean", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_BOOLEAN, "boolean", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,9 +349,9 @@ class BooleanTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanPublisher{
|
||||
::nt::PublishEx(m_handle, NT_BOOLEAN, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_BOOLEAN, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ class BooleanTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanEntry{
|
||||
::nt::GetEntry(m_handle, NT_BOOLEAN, "boolean", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN, "boolean", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -406,22 +406,22 @@ class BooleanTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return BooleanEntry{
|
||||
::nt::GetEntry(m_handle, NT_BOOLEAN, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_BOOLEAN, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline BooleanTopic BooleanSubscriber::GetTopic() const {
|
||||
return BooleanTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return BooleanTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline BooleanTopic BooleanPublisher::GetTopic() const {
|
||||
return BooleanTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return BooleanTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline BooleanTopic BooleanEntry::GetTopic() const {
|
||||
return BooleanTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return BooleanTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class DoubleArrayTopic;
|
||||
|
||||
@@ -74,7 +74,7 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetDoubleArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetDoubleArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* @param buf storage for returned value
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return Get(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* @param defaultValue default value to return if no value has been published
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return nt::GetDoubleArray(m_subHandle, buf, defaultValue);
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return wpi::nt::GetDoubleArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicDoubleArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicDoubleArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return GetAtomic(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf,
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf,
|
||||
ParamType defaultValue) const {
|
||||
return nt::GetAtomicDoubleArray(m_subHandle, buf, defaultValue);
|
||||
return wpi::nt::GetAtomicDoubleArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ class DoubleArraySubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueDoubleArray(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueDoubleArray(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ class DoubleArrayPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetDoubleArray(m_pubHandle, value, time);
|
||||
::wpi::nt::SetDoubleArray(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ class DoubleArrayPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultDoubleArray(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultDoubleArray(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ class DoubleArrayEntry final : public DoubleArraySubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ class DoubleArrayTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_DOUBLE_ARRAY, "double[]", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_DOUBLE_ARRAY, "double[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -365,7 +365,7 @@ class DoubleArrayTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_DOUBLE_ARRAY, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_DOUBLE_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class DoubleArrayTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleArrayPublisher{
|
||||
::nt::Publish(m_handle, NT_DOUBLE_ARRAY, "double[]", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_DOUBLE_ARRAY, "double[]", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,9 +410,9 @@ class DoubleArrayTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleArrayPublisher{
|
||||
::nt::PublishEx(m_handle, NT_DOUBLE_ARRAY, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_DOUBLE_ARRAY, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,7 +439,7 @@ class DoubleArrayTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_DOUBLE_ARRAY, "double[]", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_DOUBLE_ARRAY, "double[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -467,22 +467,22 @@ class DoubleArrayTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_DOUBLE_ARRAY, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_DOUBLE_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline DoubleArrayTopic DoubleArraySubscriber::GetTopic() const {
|
||||
return DoubleArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return DoubleArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline DoubleArrayTopic DoubleArrayPublisher::GetTopic() const {
|
||||
return DoubleArrayTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return DoubleArrayTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline DoubleArrayTopic DoubleArrayEntry::GetTopic() const {
|
||||
return DoubleArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return DoubleArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class DoubleTopic;
|
||||
|
||||
@@ -70,7 +70,7 @@ class DoubleSubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetDouble(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetDouble(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@ class DoubleSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicDouble(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicDouble(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class DoubleSubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueDouble(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueDouble(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ class DoublePublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetDouble(m_pubHandle, value, time);
|
||||
::wpi::nt::SetDouble(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class DoublePublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultDouble(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultDouble(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@ class DoubleEntry final : public DoubleSubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ class DoubleTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_DOUBLE, "double", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_DOUBLE, "double", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ class DoubleTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_DOUBLE, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_DOUBLE, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ class DoubleTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoublePublisher{
|
||||
::nt::Publish(m_handle, NT_DOUBLE, "double", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_DOUBLE, "double", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,9 +349,9 @@ class DoubleTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoublePublisher{
|
||||
::nt::PublishEx(m_handle, NT_DOUBLE, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_DOUBLE, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ class DoubleTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleEntry{
|
||||
::nt::GetEntry(m_handle, NT_DOUBLE, "double", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_DOUBLE, "double", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -406,22 +406,22 @@ class DoubleTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return DoubleEntry{
|
||||
::nt::GetEntry(m_handle, NT_DOUBLE, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_DOUBLE, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline DoubleTopic DoubleSubscriber::GetTopic() const {
|
||||
return DoubleTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return DoubleTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline DoubleTopic DoublePublisher::GetTopic() const {
|
||||
return DoubleTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return DoubleTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline DoubleTopic DoubleEntry::GetTopic() const {
|
||||
return DoubleTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return DoubleTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class FloatArrayTopic;
|
||||
|
||||
@@ -74,7 +74,7 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetFloatArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetFloatArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* @param buf storage for returned value
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return Get(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* @param defaultValue default value to return if no value has been published
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return nt::GetFloatArray(m_subHandle, buf, defaultValue);
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return wpi::nt::GetFloatArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicFloatArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicFloatArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return GetAtomic(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf,
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf,
|
||||
ParamType defaultValue) const {
|
||||
return nt::GetAtomicFloatArray(m_subHandle, buf, defaultValue);
|
||||
return wpi::nt::GetAtomicFloatArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ class FloatArraySubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueFloatArray(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueFloatArray(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ class FloatArrayPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetFloatArray(m_pubHandle, value, time);
|
||||
::wpi::nt::SetFloatArray(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ class FloatArrayPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultFloatArray(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultFloatArray(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ class FloatArrayEntry final : public FloatArraySubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ class FloatArrayTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_FLOAT_ARRAY, "float[]", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_FLOAT_ARRAY, "float[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -365,7 +365,7 @@ class FloatArrayTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_FLOAT_ARRAY, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_FLOAT_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class FloatArrayTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatArrayPublisher{
|
||||
::nt::Publish(m_handle, NT_FLOAT_ARRAY, "float[]", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_FLOAT_ARRAY, "float[]", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,9 +410,9 @@ class FloatArrayTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatArrayPublisher{
|
||||
::nt::PublishEx(m_handle, NT_FLOAT_ARRAY, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_FLOAT_ARRAY, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,7 +439,7 @@ class FloatArrayTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_FLOAT_ARRAY, "float[]", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_FLOAT_ARRAY, "float[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -467,22 +467,22 @@ class FloatArrayTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_FLOAT_ARRAY, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_FLOAT_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline FloatArrayTopic FloatArraySubscriber::GetTopic() const {
|
||||
return FloatArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return FloatArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline FloatArrayTopic FloatArrayPublisher::GetTopic() const {
|
||||
return FloatArrayTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return FloatArrayTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline FloatArrayTopic FloatArrayEntry::GetTopic() const {
|
||||
return FloatArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return FloatArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class FloatTopic;
|
||||
|
||||
@@ -70,7 +70,7 @@ class FloatSubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetFloat(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetFloat(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@ class FloatSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicFloat(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicFloat(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class FloatSubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueFloat(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueFloat(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ class FloatPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetFloat(m_pubHandle, value, time);
|
||||
::wpi::nt::SetFloat(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class FloatPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultFloat(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultFloat(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@ class FloatEntry final : public FloatSubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ class FloatTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_FLOAT, "float", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_FLOAT, "float", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ class FloatTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_FLOAT, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_FLOAT, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ class FloatTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatPublisher{
|
||||
::nt::Publish(m_handle, NT_FLOAT, "float", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_FLOAT, "float", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,9 +349,9 @@ class FloatTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatPublisher{
|
||||
::nt::PublishEx(m_handle, NT_FLOAT, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_FLOAT, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ class FloatTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatEntry{
|
||||
::nt::GetEntry(m_handle, NT_FLOAT, "float", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_FLOAT, "float", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -406,22 +406,22 @@ class FloatTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return FloatEntry{
|
||||
::nt::GetEntry(m_handle, NT_FLOAT, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_FLOAT, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline FloatTopic FloatSubscriber::GetTopic() const {
|
||||
return FloatTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return FloatTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline FloatTopic FloatPublisher::GetTopic() const {
|
||||
return FloatTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return FloatTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline FloatTopic FloatEntry::GetTopic() const {
|
||||
return FloatTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return FloatTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class IntegerArrayTopic;
|
||||
|
||||
@@ -74,7 +74,7 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetIntegerArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetIntegerArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* @param buf storage for returned value
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return Get(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* @param defaultValue default value to return if no value has been published
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return nt::GetIntegerArray(m_subHandle, buf, defaultValue);
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return wpi::nt::GetIntegerArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicIntegerArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicIntegerArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return GetAtomic(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf,
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf,
|
||||
ParamType defaultValue) const {
|
||||
return nt::GetAtomicIntegerArray(m_subHandle, buf, defaultValue);
|
||||
return wpi::nt::GetAtomicIntegerArray(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ class IntegerArraySubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueIntegerArray(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueIntegerArray(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ class IntegerArrayPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetIntegerArray(m_pubHandle, value, time);
|
||||
::wpi::nt::SetIntegerArray(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ class IntegerArrayPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultIntegerArray(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultIntegerArray(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ class IntegerArrayEntry final : public IntegerArraySubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ class IntegerArrayTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_INTEGER_ARRAY, "int[]", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_INTEGER_ARRAY, "int[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -365,7 +365,7 @@ class IntegerArrayTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_INTEGER_ARRAY, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_INTEGER_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class IntegerArrayTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerArrayPublisher{
|
||||
::nt::Publish(m_handle, NT_INTEGER_ARRAY, "int[]", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_INTEGER_ARRAY, "int[]", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -410,9 +410,9 @@ class IntegerArrayTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerArrayPublisher{
|
||||
::nt::PublishEx(m_handle, NT_INTEGER_ARRAY, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_INTEGER_ARRAY, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -439,7 +439,7 @@ class IntegerArrayTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_INTEGER_ARRAY, "int[]", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_INTEGER_ARRAY, "int[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -467,22 +467,22 @@ class IntegerArrayTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_INTEGER_ARRAY, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_INTEGER_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline IntegerArrayTopic IntegerArraySubscriber::GetTopic() const {
|
||||
return IntegerArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return IntegerArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline IntegerArrayTopic IntegerArrayPublisher::GetTopic() const {
|
||||
return IntegerArrayTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return IntegerArrayTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline IntegerArrayTopic IntegerArrayEntry::GetTopic() const {
|
||||
return IntegerArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return IntegerArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class IntegerTopic;
|
||||
|
||||
@@ -70,7 +70,7 @@ class IntegerSubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetInteger(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetInteger(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@ class IntegerSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicInteger(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicInteger(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class IntegerSubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueInteger(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueInteger(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ class IntegerPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetInteger(m_pubHandle, value, time);
|
||||
::wpi::nt::SetInteger(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class IntegerPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultInteger(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultInteger(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@ class IntegerEntry final : public IntegerSubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ class IntegerTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_INTEGER, "int", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_INTEGER, "int", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ class IntegerTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_INTEGER, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_INTEGER, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ class IntegerTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerPublisher{
|
||||
::nt::Publish(m_handle, NT_INTEGER, "int", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_INTEGER, "int", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,9 +349,9 @@ class IntegerTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerPublisher{
|
||||
::nt::PublishEx(m_handle, NT_INTEGER, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_INTEGER, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ class IntegerTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerEntry{
|
||||
::nt::GetEntry(m_handle, NT_INTEGER, "int", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_INTEGER, "int", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -406,22 +406,22 @@ class IntegerTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return IntegerEntry{
|
||||
::nt::GetEntry(m_handle, NT_INTEGER, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_INTEGER, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline IntegerTopic IntegerSubscriber::GetTopic() const {
|
||||
return IntegerTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return IntegerTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline IntegerTopic IntegerPublisher::GetTopic() const {
|
||||
return IntegerTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return IntegerTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline IntegerTopic IntegerEntry::GetTopic() const {
|
||||
return IntegerTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return IntegerTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class RawTopic;
|
||||
|
||||
@@ -74,7 +74,7 @@ class RawSubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetRaw(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetRaw(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ class RawSubscriber : public Subscriber {
|
||||
* @param buf storage for returned value
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return Get(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -96,8 +96,8 @@ class RawSubscriber : public Subscriber {
|
||||
* @param defaultValue default value to return if no value has been published
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return nt::GetRaw(m_subHandle, buf, defaultValue);
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return wpi::nt::GetRaw(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ class RawSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicRaw(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicRaw(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ class RawSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return GetAtomic(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ class RawSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf,
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf,
|
||||
ParamType defaultValue) const {
|
||||
return nt::GetAtomicRaw(m_subHandle, buf, defaultValue);
|
||||
return wpi::nt::GetAtomicRaw(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,7 +162,7 @@ class RawSubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueRaw(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueRaw(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -207,7 +207,7 @@ class RawPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetRaw(m_pubHandle, value, time);
|
||||
::wpi::nt::SetRaw(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -218,7 +218,7 @@ class RawPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultRaw(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultRaw(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -286,7 +286,7 @@ class RawEntry final : public RawSubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -341,7 +341,7 @@ class RawTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return RawSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_RAW, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_RAW, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -364,7 +364,7 @@ class RawTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(std::string_view typeString, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return RawPublisher{
|
||||
::nt::Publish(m_handle, NT_RAW, typeString, options)};
|
||||
::wpi::nt::Publish(m_handle, NT_RAW, typeString, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -387,9 +387,9 @@ class RawTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return RawPublisher{
|
||||
::nt::PublishEx(m_handle, NT_RAW, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_RAW, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,21 +418,21 @@ class RawTopic final : public Topic {
|
||||
EntryType GetEntry(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return RawEntry{
|
||||
::nt::GetEntry(m_handle, NT_RAW, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_RAW, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
};
|
||||
|
||||
inline RawTopic RawSubscriber::GetTopic() const {
|
||||
return RawTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return RawTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline RawTopic RawPublisher::GetTopic() const {
|
||||
return RawTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return RawTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline RawTopic RawEntry::GetTopic() const {
|
||||
return RawTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return RawTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class StringArrayTopic;
|
||||
|
||||
@@ -70,7 +70,7 @@ class StringArraySubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetStringArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetStringArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,7 +93,7 @@ class StringArraySubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicStringArray(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicStringArray(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class StringArraySubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueStringArray(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueStringArray(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,7 +149,7 @@ class StringArrayPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetStringArray(m_pubHandle, value, time);
|
||||
::wpi::nt::SetStringArray(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -160,7 +160,7 @@ class StringArrayPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultStringArray(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultStringArray(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +225,7 @@ class StringArrayEntry final : public StringArraySubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -280,7 +280,7 @@ class StringArrayTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_STRING_ARRAY, "string[]", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_STRING_ARRAY, "string[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ class StringArrayTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringArraySubscriber{
|
||||
::nt::Subscribe(m_handle, NT_STRING_ARRAY, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_STRING_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ class StringArrayTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringArrayPublisher{
|
||||
::nt::Publish(m_handle, NT_STRING_ARRAY, "string[]", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_STRING_ARRAY, "string[]", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,9 +349,9 @@ class StringArrayTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringArrayPublisher{
|
||||
::nt::PublishEx(m_handle, NT_STRING_ARRAY, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_STRING_ARRAY, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -378,7 +378,7 @@ class StringArrayTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_STRING_ARRAY, "string[]", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_STRING_ARRAY, "string[]", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -406,22 +406,22 @@ class StringArrayTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringArrayEntry{
|
||||
::nt::GetEntry(m_handle, NT_STRING_ARRAY, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_STRING_ARRAY, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline StringArrayTopic StringArraySubscriber::GetTopic() const {
|
||||
return StringArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return StringArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline StringArrayTopic StringArrayPublisher::GetTopic() const {
|
||||
return StringArrayTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return StringArrayTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline StringArrayTopic StringArrayEntry::GetTopic() const {
|
||||
return StringArrayTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return StringArrayTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#include "wpi/nt/Topic.hpp"
|
||||
#include "wpi/nt/ntcore_cpp.hpp"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
|
||||
class StringTopic;
|
||||
|
||||
@@ -76,7 +76,7 @@ class StringSubscriber : public Subscriber {
|
||||
* @return value
|
||||
*/
|
||||
ValueType Get(ParamType defaultValue) const {
|
||||
return ::nt::GetString(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetString(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +86,7 @@ class StringSubscriber : public Subscriber {
|
||||
* @param buf storage for returned value
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return Get(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -98,8 +98,8 @@ class StringSubscriber : public Subscriber {
|
||||
* @param defaultValue default value to return if no value has been published
|
||||
* @return value
|
||||
*/
|
||||
SmallRetType Get(wpi::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return nt::GetString(m_subHandle, buf, defaultValue);
|
||||
SmallRetType Get(wpi::util::SmallVectorImpl<SmallElemType>& buf, ParamType defaultValue) const {
|
||||
return wpi::nt::GetString(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ class StringSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueType GetAtomic(ParamType defaultValue) const {
|
||||
return ::nt::GetAtomicString(m_subHandle, defaultValue);
|
||||
return ::wpi::nt::GetAtomicString(m_subHandle, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +134,7 @@ class StringSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf) const {
|
||||
return GetAtomic(buf, m_defaultValue);
|
||||
}
|
||||
|
||||
@@ -148,9 +148,9 @@ class StringSubscriber : public Subscriber {
|
||||
* @return timestamped value
|
||||
*/
|
||||
TimestampedValueViewType GetAtomic(
|
||||
wpi::SmallVectorImpl<SmallElemType>& buf,
|
||||
wpi::util::SmallVectorImpl<SmallElemType>& buf,
|
||||
ParamType defaultValue) const {
|
||||
return nt::GetAtomicString(m_subHandle, buf, defaultValue);
|
||||
return wpi::nt::GetAtomicString(m_subHandle, buf, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,7 +164,7 @@ class StringSubscriber : public Subscriber {
|
||||
* been published since the previous call.
|
||||
*/
|
||||
std::vector<TimestampedValueType> ReadQueue() {
|
||||
return ::nt::ReadQueueString(m_subHandle);
|
||||
return ::wpi::nt::ReadQueueString(m_subHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +209,7 @@ class StringPublisher : public Publisher {
|
||||
* @param time timestamp; 0 indicates current NT time should be used
|
||||
*/
|
||||
void Set(ParamType value, int64_t time = 0) {
|
||||
::nt::SetString(m_pubHandle, value, time);
|
||||
::wpi::nt::SetString(m_pubHandle, value, time);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -220,7 +220,7 @@ class StringPublisher : public Publisher {
|
||||
* @param value value
|
||||
*/
|
||||
void SetDefault(ParamType value) {
|
||||
::nt::SetDefaultString(m_pubHandle, value);
|
||||
::wpi::nt::SetDefaultString(m_pubHandle, value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,7 +288,7 @@ class StringEntry final : public StringSubscriber,
|
||||
* Stops publishing the entry if it's published.
|
||||
*/
|
||||
void Unpublish() {
|
||||
::nt::Unpublish(m_pubHandle);
|
||||
::wpi::nt::Unpublish(m_pubHandle);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -343,7 +343,7 @@ class StringTopic final : public Topic {
|
||||
ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_STRING, "string", options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_STRING, "string", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -367,7 +367,7 @@ class StringTopic final : public Topic {
|
||||
std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringSubscriber{
|
||||
::nt::Subscribe(m_handle, NT_STRING, typeString, options),
|
||||
::wpi::nt::Subscribe(m_handle, NT_STRING, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ class StringTopic final : public Topic {
|
||||
[[nodiscard]]
|
||||
PublisherType Publish(const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringPublisher{
|
||||
::nt::Publish(m_handle, NT_STRING, "string", options)};
|
||||
::wpi::nt::Publish(m_handle, NT_STRING, "string", options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -412,9 +412,9 @@ class StringTopic final : public Topic {
|
||||
*/
|
||||
[[nodiscard]]
|
||||
PublisherType PublishEx(std::string_view typeString,
|
||||
const wpi::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
const wpi::util::json& properties, const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringPublisher{
|
||||
::nt::PublishEx(m_handle, NT_STRING, typeString, properties, options)};
|
||||
::wpi::nt::PublishEx(m_handle, NT_STRING, typeString, properties, options)};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -441,7 +441,7 @@ class StringTopic final : public Topic {
|
||||
EntryType GetEntry(ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringEntry{
|
||||
::nt::GetEntry(m_handle, NT_STRING, "string", options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_STRING, "string", options),
|
||||
defaultValue};
|
||||
}
|
||||
/**
|
||||
@@ -469,22 +469,22 @@ class StringTopic final : public Topic {
|
||||
EntryType GetEntryEx(std::string_view typeString, ParamType defaultValue,
|
||||
const PubSubOptions& options = kDefaultPubSubOptions) {
|
||||
return StringEntry{
|
||||
::nt::GetEntry(m_handle, NT_STRING, typeString, options),
|
||||
::wpi::nt::GetEntry(m_handle, NT_STRING, typeString, options),
|
||||
defaultValue};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
inline StringTopic StringSubscriber::GetTopic() const {
|
||||
return StringTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return StringTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
inline StringTopic StringPublisher::GetTopic() const {
|
||||
return StringTopic{::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
return StringTopic{::wpi::nt::GetTopicFromHandle(m_pubHandle)};
|
||||
}
|
||||
|
||||
inline StringTopic StringEntry::GetTopic() const {
|
||||
return StringTopic{::nt::GetTopicFromHandle(m_subHandle)};
|
||||
return StringTopic{::wpi::nt::GetTopicFromHandle(m_subHandle)};
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
#include "wpi/nt/ntcore_c.h"
|
||||
|
||||
namespace wpi {
|
||||
namespace wpi::util {
|
||||
template <typename T>
|
||||
class SmallVectorImpl;
|
||||
} // namespace wpi
|
||||
|
||||
namespace nt {
|
||||
namespace wpi::nt {
|
||||
/**
|
||||
* Timestamped value.
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
@@ -371,7 +371,7 @@ std::vector<double> ReadQueueValuesDouble(NT_Handle subentry);
|
||||
using TimestampedString = Timestamped<std::string>;
|
||||
|
||||
/**
|
||||
* Timestamped String view (for SmallVector-taking functions).
|
||||
* Timestamped String view (for wpi::util::SmallVector-taking functions).
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
*/
|
||||
using TimestampedStringView = Timestamped<std::string_view>;
|
||||
@@ -447,11 +447,11 @@ std::vector<TimestampedString> ReadQueueString(NT_Handle subentry);
|
||||
*/
|
||||
std::vector<std::string> ReadQueueValuesString(NT_Handle subentry);
|
||||
|
||||
std::string_view GetString(NT_Handle subentry, wpi::SmallVectorImpl<char>& buf, std::string_view defaultValue);
|
||||
std::string_view GetString(NT_Handle subentry, wpi::util::SmallVectorImpl<char>& buf, std::string_view defaultValue);
|
||||
|
||||
TimestampedStringView GetAtomicString(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<char>& buf,
|
||||
wpi::util::SmallVectorImpl<char>& buf,
|
||||
std::string_view defaultValue);
|
||||
|
||||
/** @} */
|
||||
@@ -463,7 +463,7 @@ TimestampedStringView GetAtomicString(
|
||||
using TimestampedRaw = Timestamped<std::vector<uint8_t>>;
|
||||
|
||||
/**
|
||||
* Timestamped Raw view (for SmallVector-taking functions).
|
||||
* Timestamped Raw view (for wpi::util::SmallVector-taking functions).
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
*/
|
||||
using TimestampedRawView = Timestamped<std::span<uint8_t>>;
|
||||
@@ -539,11 +539,11 @@ std::vector<TimestampedRaw> ReadQueueRaw(NT_Handle subentry);
|
||||
*/
|
||||
std::vector<std::vector<uint8_t>> ReadQueueValuesRaw(NT_Handle subentry);
|
||||
|
||||
std::span<uint8_t> GetRaw(NT_Handle subentry, wpi::SmallVectorImpl<uint8_t>& buf, std::span<const uint8_t> defaultValue);
|
||||
std::span<uint8_t> GetRaw(NT_Handle subentry, wpi::util::SmallVectorImpl<uint8_t>& buf, std::span<const uint8_t> defaultValue);
|
||||
|
||||
TimestampedRawView GetAtomicRaw(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<uint8_t>& buf,
|
||||
wpi::util::SmallVectorImpl<uint8_t>& buf,
|
||||
std::span<const uint8_t> defaultValue);
|
||||
|
||||
/** @} */
|
||||
@@ -555,7 +555,7 @@ TimestampedRawView GetAtomicRaw(
|
||||
using TimestampedBooleanArray = Timestamped<std::vector<int>>;
|
||||
|
||||
/**
|
||||
* Timestamped BooleanArray view (for SmallVector-taking functions).
|
||||
* Timestamped BooleanArray view (for wpi::util::SmallVector-taking functions).
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
*/
|
||||
using TimestampedBooleanArrayView = Timestamped<std::span<int>>;
|
||||
@@ -631,11 +631,11 @@ std::vector<TimestampedBooleanArray> ReadQueueBooleanArray(NT_Handle subentry);
|
||||
*/
|
||||
std::vector<std::vector<int>> ReadQueueValuesBooleanArray(NT_Handle subentry);
|
||||
|
||||
std::span<int> GetBooleanArray(NT_Handle subentry, wpi::SmallVectorImpl<int>& buf, std::span<const int> defaultValue);
|
||||
std::span<int> GetBooleanArray(NT_Handle subentry, wpi::util::SmallVectorImpl<int>& buf, std::span<const int> defaultValue);
|
||||
|
||||
TimestampedBooleanArrayView GetAtomicBooleanArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<int>& buf,
|
||||
wpi::util::SmallVectorImpl<int>& buf,
|
||||
std::span<const int> defaultValue);
|
||||
|
||||
/** @} */
|
||||
@@ -647,7 +647,7 @@ TimestampedBooleanArrayView GetAtomicBooleanArray(
|
||||
using TimestampedIntegerArray = Timestamped<std::vector<int64_t>>;
|
||||
|
||||
/**
|
||||
* Timestamped IntegerArray view (for SmallVector-taking functions).
|
||||
* Timestamped IntegerArray view (for wpi::util::SmallVector-taking functions).
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
*/
|
||||
using TimestampedIntegerArrayView = Timestamped<std::span<int64_t>>;
|
||||
@@ -723,11 +723,11 @@ std::vector<TimestampedIntegerArray> ReadQueueIntegerArray(NT_Handle subentry);
|
||||
*/
|
||||
std::vector<std::vector<int64_t>> ReadQueueValuesIntegerArray(NT_Handle subentry);
|
||||
|
||||
std::span<int64_t> GetIntegerArray(NT_Handle subentry, wpi::SmallVectorImpl<int64_t>& buf, std::span<const int64_t> defaultValue);
|
||||
std::span<int64_t> GetIntegerArray(NT_Handle subentry, wpi::util::SmallVectorImpl<int64_t>& buf, std::span<const int64_t> defaultValue);
|
||||
|
||||
TimestampedIntegerArrayView GetAtomicIntegerArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<int64_t>& buf,
|
||||
wpi::util::SmallVectorImpl<int64_t>& buf,
|
||||
std::span<const int64_t> defaultValue);
|
||||
|
||||
/** @} */
|
||||
@@ -739,7 +739,7 @@ TimestampedIntegerArrayView GetAtomicIntegerArray(
|
||||
using TimestampedFloatArray = Timestamped<std::vector<float>>;
|
||||
|
||||
/**
|
||||
* Timestamped FloatArray view (for SmallVector-taking functions).
|
||||
* Timestamped FloatArray view (for wpi::util::SmallVector-taking functions).
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
*/
|
||||
using TimestampedFloatArrayView = Timestamped<std::span<float>>;
|
||||
@@ -815,11 +815,11 @@ std::vector<TimestampedFloatArray> ReadQueueFloatArray(NT_Handle subentry);
|
||||
*/
|
||||
std::vector<std::vector<float>> ReadQueueValuesFloatArray(NT_Handle subentry);
|
||||
|
||||
std::span<float> GetFloatArray(NT_Handle subentry, wpi::SmallVectorImpl<float>& buf, std::span<const float> defaultValue);
|
||||
std::span<float> GetFloatArray(NT_Handle subentry, wpi::util::SmallVectorImpl<float>& buf, std::span<const float> defaultValue);
|
||||
|
||||
TimestampedFloatArrayView GetAtomicFloatArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<float>& buf,
|
||||
wpi::util::SmallVectorImpl<float>& buf,
|
||||
std::span<const float> defaultValue);
|
||||
|
||||
/** @} */
|
||||
@@ -831,7 +831,7 @@ TimestampedFloatArrayView GetAtomicFloatArray(
|
||||
using TimestampedDoubleArray = Timestamped<std::vector<double>>;
|
||||
|
||||
/**
|
||||
* Timestamped DoubleArray view (for SmallVector-taking functions).
|
||||
* Timestamped DoubleArray view (for wpi::util::SmallVector-taking functions).
|
||||
* @ingroup ntcore_cpp_handle_api
|
||||
*/
|
||||
using TimestampedDoubleArrayView = Timestamped<std::span<double>>;
|
||||
@@ -907,11 +907,11 @@ std::vector<TimestampedDoubleArray> ReadQueueDoubleArray(NT_Handle subentry);
|
||||
*/
|
||||
std::vector<std::vector<double>> ReadQueueValuesDoubleArray(NT_Handle subentry);
|
||||
|
||||
std::span<double> GetDoubleArray(NT_Handle subentry, wpi::SmallVectorImpl<double>& buf, std::span<const double> defaultValue);
|
||||
std::span<double> GetDoubleArray(NT_Handle subentry, wpi::util::SmallVectorImpl<double>& buf, std::span<const double> defaultValue);
|
||||
|
||||
TimestampedDoubleArrayView GetAtomicDoubleArray(
|
||||
NT_Handle subentry,
|
||||
wpi::SmallVectorImpl<double>& buf,
|
||||
wpi::util::SmallVectorImpl<double>& buf,
|
||||
std::span<const double> defaultValue);
|
||||
|
||||
/** @} */
|
||||
@@ -995,4 +995,4 @@ std::vector<std::vector<std::string>> ReadQueueValuesStringArray(NT_Handle suben
|
||||
|
||||
/** @} */
|
||||
|
||||
} // namespace nt
|
||||
} // namespace wpi::nt
|
||||
|
||||
Reference in New Issue
Block a user