Class StructArrayLogEntry<T>
- Type Parameters:
T- value class
-
Field Summary
Fields inherited from class edu.wpi.first.util.datalog.DataLogEntry
m_entry, m_log -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(Collection<T> value) Appends a record to the log.voidappend(Collection<T> value, long timestamp) Appends a record to the log.voidAppends a record to the log.voidAppends a record to the log.static <T> StructArrayLogEntry<T>Creates a struct-encoded array log entry.static <T> StructArrayLogEntry<T>Creates a struct-encoded array log entry.static <T> StructArrayLogEntry<T>Creates a struct-encoded array log entry.static <T> StructArrayLogEntry<T>Creates a struct-encoded array log entry.T[]Gets the last value.booleanGets whether there is a last value.voidreserve(int nelem) Ensures sufficient buffer space is available for the given number of elements.voidupdate(Collection<T> value) Updates the last value and appends a record to the log if it has changed.voidupdate(Collection<T> value, long timestamp) Updates the last value and appends a record to the log if it has changed.voidUpdates the last value and appends a record to the log if it has changed.voidUpdates the last value and appends a record to the log if it has changed.Methods inherited from class edu.wpi.first.util.datalog.DataLogEntry
finish, finish, setMetadata, setMetadata
-
Method Details
-
create
public static <T> StructArrayLogEntry<T> create(DataLog log, String name, Struct<T> struct, String metadata, long timestamp) Creates a struct-encoded array log entry.- Type Parameters:
T- value class (inferred from struct)- Parameters:
log- datalogname- name of the entrystruct- struct serialization implementationmetadata- metadatatimestamp- entry creation timestamp (0=now)- Returns:
- StructArrayLogEntry
-
create
public static <T> StructArrayLogEntry<T> create(DataLog log, String name, Struct<T> struct, String metadata) Creates a struct-encoded array log entry.- Type Parameters:
T- value class (inferred from struct)- Parameters:
log- datalogname- name of the entrystruct- struct serialization implementationmetadata- metadata- Returns:
- StructArrayLogEntry
-
create
public static <T> StructArrayLogEntry<T> create(DataLog log, String name, Struct<T> struct, long timestamp) Creates a struct-encoded array log entry.- Type Parameters:
T- value class (inferred from struct)- Parameters:
log- datalogname- name of the entrystruct- struct serialization implementationtimestamp- entry creation timestamp (0=now)- Returns:
- StructArrayLogEntry
-
create
Creates a struct-encoded array log entry.- Type Parameters:
T- value class (inferred from struct)- Parameters:
log- datalogname- name of the entrystruct- struct serialization implementation- Returns:
- StructArrayLogEntry
-
reserve
Ensures sufficient buffer space is available for the given number of elements.- Parameters:
nelem- number of elements
-
append
Appends a record to the log.- Parameters:
value- Value to recordtimestamp- Time stamp (0 to indicate now)
-
append
Appends a record to the log.- Parameters:
value- Value to record
-
append
Appends a record to the log.- Parameters:
value- Value to recordtimestamp- Time stamp (0 to indicate now)
-
append
Appends a record to the log.- Parameters:
value- Value to record
-
update
Updates the last value and appends a record to the log if it has changed.Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.
- Parameters:
value- Value to recordtimestamp- Time stamp (0 to indicate now)
-
update
Updates the last value and appends a record to the log if it has changed.Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.
- Parameters:
value- Value to record
-
update
Updates the last value and appends a record to the log if it has changed.Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.
- Parameters:
value- Value to recordtimestamp- Time stamp (0 to indicate now)
-
update
Updates the last value and appends a record to the log if it has changed.Note: the last value is local to this class instance; using update() with two instances pointing to the same underlying log entry name will likely result in unexpected results.
- Parameters:
value- Value to record
-
hasLastValue
Gets whether there is a last value.Note: the last value is local to this class instance and updated only with update(), not append().
- Returns:
- True if last value exists, false otherwise.
-
getLastValue
Gets the last value.Note: the last value is local to this class instance and updated only with update(), not append().
- Returns:
- Last value, or null if none.
-