SF2 C++ FRC Class Library
Sensor Fusion Framework (SF2) for FRC
|
Public Member Functions | |
ThreadsafeInterpolatingTimeHistory (T &default_obj, int num_samples, TimestampInfo &ts_info, string &name) | |
Constructs a ThreadsafeInterpolatingTimeHihstory to hold up to a specified number of objects of the specified class. More... | |
void | reset () |
Clears all contents of the ThreadsafeInterpolatingTimeHistory by marking all contained objects as invalid. | |
int | getValidSampleCount () |
Returns the current count of valid objects in this ThreadsafeInterpolatingTimeHistory. More... | |
void | add (T &t) |
Adds the provided object to the ThreadsafeInterpolatingTimeHistory. More... | |
bool | get (long requested_timestamp, T &out) |
Retrieves the object in the ThreadsafeInterpolatingTimeHistory which matches the provided timestamp. More... | |
bool | getMostRecent (T &out) |
Retrieves the most recently-added object in the ThreadsafeInterpolatingTimeHistory. More... | |
bool | writeToDirectory (string &directory) |
bool | writeToFile (const string &file_path) |
bool | writeToDiskInternal (PrintWriter &out) |
|
inline |
Constructs a ThreadsafeInterpolatingTimeHihstory to hold up to a specified number of objects of the specified class.
_class | - the Java class of the objects to be contained. |
num_samples | - the maximum number of objects to be contained. |
|
inline |
Adds the provided object to the ThreadsafeInterpolatingTimeHistory.
t | - the object to add |
|
inline |
Retrieves the object in the ThreadsafeInterpolatingTimeHistory which matches the provided timestamp.
If an exact match is not found, a new object will be created using interpolated values, based upon the nearest objects preceding and following the requested timestamp.
requested_timestamp | - the timeatamp for which to return an object |
|
inline |
Retrieves the most recently-added object in the ThreadsafeInterpolatingTimeHistory.
|
inline |
Returns the current count of valid objects in this ThreadsafeInterpolatingTimeHistory.