Class TimeCache

Inheritance Relationships

Base Type

Class Documentation

class TimeCache : public tf2::TimeCacheInterface

A class to keep a sorted linked list in time (newest first, oldest last). This builds and maintains a list of timestamped data. And provides lookup functions to get data out as a function of time.

Public Functions

explicit TimeCache(tf2::Duration max_storage_time = TIMECACHE_DEFAULT_MAX_STORAGE_TIME)
virtual bool getData(tf2::TimePoint time, tf2::TransformStorage &data_out, std::string *error_str = 0, TF2Error *error_code = 0)

Virtual methods.

virtual bool insertData(const tf2::TransformStorage &new_data)

Insert data into the cache.

virtual void clearList()

Clear the list of stored values.

virtual tf2::CompactFrameID getParent(tf2::TimePoint time, std::string *error_str = 0, TF2Error *error_code = 0)

Retrieve the parent at a specific time.

virtual P_TimeAndFrameID getLatestTimeAndParent()

Get the latest time stored in this cache, and the parent associated with it. Returns parent = 0 if no data.

virtual unsigned int getListLength()

Debugging information methods.

virtual TimePoint getLatestTimestamp()

Get the latest timestamp cached.

virtual TimePoint getOldestTimestamp()

Get the oldest timestamp cached.

Public Static Attributes

static const int MIN_INTERPOLATION_DISTANCE = 5

Number of nano-seconds to not interpolate below.

static const unsigned int MAX_LENGTH_LINKED_LIST = 1000000

Maximum length of linked list, to make sure not to be able to use unlimited memory.

Protected Functions

const std::list<TransformStorage> &getAllItems() const