A record in the data log.
More...
#include <wpi/DataLogReader.h>
A record in the data log.
May represent either a control record (entry == 0) or a data record. Used only for reading (e.g. with DataLogReader).
◆ DataLogRecord() [1/2]
wpi::log::DataLogRecord::DataLogRecord |
( |
| ) |
|
|
default |
◆ DataLogRecord() [2/2]
wpi::log::DataLogRecord::DataLogRecord |
( |
int |
entry, |
|
|
int64_t |
timestamp, |
|
|
std::span< const uint8_t > |
data |
|
) |
| |
|
inline |
◆ GetBoolean()
bool wpi::log::DataLogRecord::GetBoolean |
( |
bool * |
value | ) |
const |
Decodes a data record as a boolean.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "boolean", invalid results may be returned.
- Parameters
-
[out] | value | boolean value (if successful) |
- Returns
- True on success, false on error
◆ GetBooleanArray()
bool wpi::log::DataLogRecord::GetBooleanArray |
( |
std::vector< int > * |
arr | ) |
const |
Decodes a data record as a boolean array.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "boolean[]", invalid results may be returned.
- Parameters
-
- Returns
- True (never fails)
◆ GetDouble()
bool wpi::log::DataLogRecord::GetDouble |
( |
double * |
value | ) |
const |
Decodes a data record as a double.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "double", invalid results may be returned.
- Parameters
-
[out] | value | double value (if successful) |
- Returns
- True on success, false on error
◆ GetDoubleArray()
bool wpi::log::DataLogRecord::GetDoubleArray |
( |
std::vector< double > * |
arr | ) |
const |
Decodes a data record as a double array.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "double[]", invalid results may be returned.
- Parameters
-
[out] | arr | double array (if successful) |
- Returns
- True on success, false on error
◆ GetEntry()
int wpi::log::DataLogRecord::GetEntry |
( |
| ) |
const |
|
inline |
Gets the entry ID.
- Returns
- entry ID
◆ GetFinishEntry()
bool wpi::log::DataLogRecord::GetFinishEntry |
( |
int * |
out | ) |
const |
Decodes a finish control record.
- Parameters
-
[out] | out | finish record entry ID (if successful) |
- Returns
- True on success, false on error
◆ GetFloat()
bool wpi::log::DataLogRecord::GetFloat |
( |
float * |
value | ) |
const |
Decodes a data record as a float.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "float", invalid results may be returned.
- Parameters
-
[out] | value | float value (if successful) |
- Returns
- True on success, false on error
◆ GetFloatArray()
bool wpi::log::DataLogRecord::GetFloatArray |
( |
std::vector< float > * |
arr | ) |
const |
Decodes a data record as a float array.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "float[]", invalid results may be returned.
- Parameters
-
[out] | arr | float array (if successful) |
- Returns
- True on success, false on error
◆ GetInteger()
bool wpi::log::DataLogRecord::GetInteger |
( |
int64_t * |
value | ) |
const |
Decodes a data record as an integer.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "int64", invalid results may be returned.
- Parameters
-
[out] | value | integer value (if successful) |
- Returns
- True on success, false on error
◆ GetIntegerArray()
bool wpi::log::DataLogRecord::GetIntegerArray |
( |
std::vector< int64_t > * |
arr | ) |
const |
Decodes a data record as an integer array.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "int64[]", invalid results may be returned.
- Parameters
-
[out] | arr | integer array (if successful) |
- Returns
- True on success, false on error
◆ GetRaw()
std::span< const uint8_t > wpi::log::DataLogRecord::GetRaw |
( |
| ) |
const |
|
inline |
Gets the raw data.
Use the GetX functions to decode based on the data type in the entry's start record.
◆ GetSetMetadataData()
Decodes a set metadata control record.
- Parameters
-
[out] | out | set metadata record decoded data (if successful) |
- Returns
- True on success, false on error
◆ GetSize()
size_t wpi::log::DataLogRecord::GetSize |
( |
| ) |
const |
|
inline |
Gets the size of the raw data.
- Returns
- size
◆ GetStartData()
Decodes a start control record.
- Parameters
-
[out] | out | start record decoded data (if successful) |
- Returns
- True on success, false on error
◆ GetString()
Decodes a data record as a string.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "string", invalid results may be returned.
- Parameters
-
- Returns
- True (never fails)
◆ GetStringArray()
bool wpi::log::DataLogRecord::GetStringArray |
( |
std::vector< std::string_view > * |
arr | ) |
const |
Decodes a data record as a string array.
Note if the data type (as indicated in the corresponding start control record for this entry) is not "string[]", invalid results may be returned.
- Parameters
-
[out] | arr | string array (if successful) |
- Returns
- True on success, false on error
◆ GetTimestamp()
int64_t wpi::log::DataLogRecord::GetTimestamp |
( |
| ) |
const |
|
inline |
Gets the record timestamp.
- Returns
- Timestamp, in integer microseconds
◆ IsControl()
bool wpi::log::DataLogRecord::IsControl |
( |
| ) |
const |
|
inline |
Returns true if the record is a control record.
- Returns
- True if control record, false if normal data record.
◆ IsFinish()
bool wpi::log::DataLogRecord::IsFinish |
( |
| ) |
const |
Returns true if the record is a finish control record.
Use GetFinishEntry() to decode the contents.
- Returns
- True if finish control record, false otherwise.
◆ IsSetMetadata()
bool wpi::log::DataLogRecord::IsSetMetadata |
( |
| ) |
const |
Returns true if the record is a set metadata control record.
Use GetSetMetadataData() to decode the contents.
- Returns
- True if set metadata control record, false otherwise.
◆ IsStart()
bool wpi::log::DataLogRecord::IsStart |
( |
| ) |
const |
Returns true if the record is a start control record.
Use GetStartData() to decode the contents.
- Returns
- True if start control record, false otherwise.
The documentation for this class was generated from the following file: