[ntcore] Allow numeric-compatible value sets (#4620)

Also fix entry publishing behavior to allow numerically compatible set
default publish following a subscribe.
This commit is contained in:
Peter Johnson
2022-11-18 22:46:24 -08:00
committed by GitHub
parent 88bd67e7de
commit e962fd2916
8 changed files with 476 additions and 56 deletions

View File

@@ -471,6 +471,18 @@ class Value final {
return MakeBooleanArray(std::span(value.begin(), value.end()), time);
}
/**
* Creates a boolean array entry value.
*
* @param value the value
* @param time if nonzero, the creation time to use (instead of the current
* time)
* @return The entry value
*
* @note This function moves the values out of the vector.
*/
static Value MakeBooleanArray(std::vector<int>&& value, int64_t time = 0);
/**
* Creates an integer array entry value.
*
@@ -495,6 +507,18 @@ class Value final {
return MakeIntegerArray(std::span(value.begin(), value.end()), time);
}
/**
* Creates an integer array entry value.
*
* @param value the value
* @param time if nonzero, the creation time to use (instead of the current
* time)
* @return The entry value
*
* @note This function moves the values out of the vector.
*/
static Value MakeIntegerArray(std::vector<int64_t>&& value, int64_t time = 0);
/**
* Creates a float array entry value.
*
@@ -518,6 +542,18 @@ class Value final {
return MakeFloatArray(std::span(value.begin(), value.end()), time);
}
/**
* Creates a float array entry value.
*
* @param value the value
* @param time if nonzero, the creation time to use (instead of the current
* time)
* @return The entry value
*
* @note This function moves the values out of the vector.
*/
static Value MakeFloatArray(std::vector<float>&& value, int64_t time = 0);
/**
* Creates a double array entry value.
*
@@ -541,6 +577,18 @@ class Value final {
return MakeDoubleArray(std::span(value.begin(), value.end()), time);
}
/**
* Creates a double array entry value.
*
* @param value the value
* @param time if nonzero, the creation time to use (instead of the current
* time)
* @return The entry value
*
* @note This function moves the values out of the vector.
*/
static Value MakeDoubleArray(std::vector<double>&& value, int64_t time = 0);
/**
* Creates a string array entry value.
*