[wpiutil] DataLog: Add documentation for append methods (NFC) (#5348)

This commit is contained in:
Gold856
2023-05-19 00:56:21 -04:00
committed by GitHub
parent c9b612c986
commit 01490fc77b
2 changed files with 180 additions and 7 deletions

View File

@@ -188,10 +188,10 @@ public final class DataLog implements AutoCloseable {
}
/**
* Appends a record to the log.
* Appends a raw record to the log.
*
* @param entry Entry index, as returned by Start()
* @param data Data to record
* @param entry Entry index, as returned by start()
* @param data Byte array to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendRaw(int entry, byte[] data, long timestamp) {
@@ -204,42 +204,112 @@ public final class DataLog implements AutoCloseable {
m_impl = 0;
}
/**
* Appends a boolean record to the log.
*
* @param entry Entry index, as returned by start()
* @param value Boolean value to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendBoolean(int entry, boolean value, long timestamp) {
DataLogJNI.appendBoolean(m_impl, entry, value, timestamp);
}
/**
* Appends an integer record to the log.
*
* @param entry Entry index, as returned by start()
* @param value Integer value to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendInteger(int entry, long value, long timestamp) {
DataLogJNI.appendInteger(m_impl, entry, value, timestamp);
}
/**
* Appends a float record to the log.
*
* @param entry Entry index, as returned by start()
* @param value Float value to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendFloat(int entry, float value, long timestamp) {
DataLogJNI.appendFloat(m_impl, entry, value, timestamp);
}
/**
* Appends a double record to the log.
*
* @param entry Entry index, as returned by start()
* @param value Double value to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendDouble(int entry, double value, long timestamp) {
DataLogJNI.appendDouble(m_impl, entry, value, timestamp);
}
/**
* Appends a string record to the log.
*
* @param entry Entry index, as returned by start()
* @param value String value to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendString(int entry, String value, long timestamp) {
DataLogJNI.appendString(m_impl, entry, value, timestamp);
}
/**
* Appends a boolean array record to the log.
*
* @param entry Entry index, as returned by start()
* @param arr Boolean array to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendBooleanArray(int entry, boolean[] arr, long timestamp) {
DataLogJNI.appendBooleanArray(m_impl, entry, arr, timestamp);
}
/**
* Appends an integer array record to the log.
*
* @param entry Entry index, as returned by start()
* @param arr Integer array to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendIntegerArray(int entry, long[] arr, long timestamp) {
DataLogJNI.appendIntegerArray(m_impl, entry, arr, timestamp);
}
/**
* Appends a float array record to the log.
*
* @param entry Entry index, as returned by start()
* @param arr Float array to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendFloatArray(int entry, float[] arr, long timestamp) {
DataLogJNI.appendFloatArray(m_impl, entry, arr, timestamp);
}
/**
* Appends a double array record to the log.
*
* @param entry Entry index, as returned by start()
* @param arr Double array to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendDoubleArray(int entry, double[] arr, long timestamp) {
DataLogJNI.appendDoubleArray(m_impl, entry, arr, timestamp);
}
/**
* Appends a string array record to the log.
*
* @param entry Entry index, as returned by start()
* @param arr String array to record
* @param timestamp Time stamp (0 to indicate now)
*/
public void appendStringArray(int entry, String[] arr, long timestamp) {
DataLogJNI.appendStringArray(m_impl, entry, arr, timestamp);
}

View File

@@ -190,43 +190,146 @@ class DataLog final {
void SetMetadata(int entry, std::string_view metadata, int64_t timestamp = 0);
/**
* Appends a record to the log.
* Appends a raw record to the log.
*
* @param entry Entry index, as returned by Start()
* @param data Data to record
* @param data Byte array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendRaw(int entry, std::span<const uint8_t> data, int64_t timestamp);
/**
* Appends a record to the log.
* Appends a raw record to the log.
*
* @param entry Entry index, as returned by Start()
* @param data Data to record
* @param data Byte array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendRaw2(int entry, std::span<const std::span<const uint8_t>> data,
int64_t timestamp);
/**
* Appends a boolean record to the log.
*
* @param entry Entry index, as returned by Start()
* @param value Boolean value to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendBoolean(int entry, bool value, int64_t timestamp);
/**
* Appends an integer record to the log.
*
* @param entry Entry index, as returned by Start()
* @param value Integer value to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendInteger(int entry, int64_t value, int64_t timestamp);
/**
* Appends a float record to the log.
*
* @param entry Entry index, as returned by Start()
* @param value Float value to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendFloat(int entry, float value, int64_t timestamp);
/**
* Appends a double record to the log.
*
* @param entry Entry index, as returned by Start()
* @param value Double value to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendDouble(int entry, double value, int64_t timestamp);
/**
* Appends a string record to the log.
*
* @param entry Entry index, as returned by Start()
* @param value String value to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendString(int entry, std::string_view value, int64_t timestamp);
/**
* Appends a boolean array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr Boolean array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendBooleanArray(int entry, std::span<const bool> arr,
int64_t timestamp);
/**
* Appends a boolean array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr Boolean array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendBooleanArray(int entry, std::span<const int> arr,
int64_t timestamp);
/**
* Appends a boolean array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr Boolean array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendBooleanArray(int entry, std::span<const uint8_t> arr,
int64_t timestamp);
/**
* Appends an integer array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr Integer array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendIntegerArray(int entry, std::span<const int64_t> arr,
int64_t timestamp);
/**
* Appends a float array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr Float array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendFloatArray(int entry, std::span<const float> arr,
int64_t timestamp);
/**
* Appends a double array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr Double array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendDoubleArray(int entry, std::span<const double> arr,
int64_t timestamp);
/**
* Appends a string array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr String array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendStringArray(int entry, std::span<const std::string> arr,
int64_t timestamp);
/**
* Appends a string array record to the log.
*
* @param entry Entry index, as returned by Start()
* @param arr String array to record
* @param timestamp Time stamp (may be 0 to indicate now)
*/
void AppendStringArray(int entry, std::span<const std::string_view> arr,
int64_t timestamp);