33#ifndef TF2__TIME_CACHE_HPP_
34#define TF2__TIME_CACHE_HPP_
148 typedef std::list<TransformStorage> L_TransformStorage;
149 L_TransformStorage storage_;
160 inline void interpolate(
196 bool populated_{
false};
Definition time_cache.hpp:168
bool getData(TimePoint time, TransformStorage &data_out, std::string *error_str=nullptr, TF2Error *error_code=nullptr) override
Overridden methods.
unsigned int getListLength() override
Debugging information methods.
bool insertData(const TransformStorage &new_data) override
Insert data into the cache.
P_TimeAndFrameID getLatestTimeAndParent() override
Get the latest time stored in this cache, and the parent associated with it. Returns parent = 0 if no...
void clearList() override
Clear the list of stored values.
TimePoint getOldestTimestamp() override
Get the oldest timestamp cached.
CompactFrameID getParent(TimePoint time, std::string *error_str=nullptr, TF2Error *error_code=nullptr) override
Retrieve the parent at a specific time.
TimePoint getLatestTimestamp() override
Get the latest timestamp cached.
Definition time_cache.hpp:53
virtual tf2::TimePoint getOldestTimestamp()=0
Get the oldest timestamp cached.
virtual unsigned int getListLength()=0
Debugging information methods.
virtual void clearList()=0
Clear the list of stored values.
virtual CompactFrameID getParent(tf2::TimePoint time, std::string *error_str=nullptr, TF2Error *error_code=nullptr)=0
Retrieve the parent at a specific time.
virtual bool getData(tf2::TimePoint time, tf2::TransformStorage &data_out, std::string *error_str=nullptr, TF2Error *error_code=nullptr)=0
Access data from the cache returns false if data unavailable (should be thrown as lookup exception)
virtual ~TimeCacheInterface()=default
virtual bool insertData(const tf2::TransformStorage &new_data)=0
Insert data into the cache.
virtual P_TimeAndFrameID getLatestTimeAndParent()=0
Get the latest time stored in this cache, and the parent associated with it. Returns parent = 0 if no...
virtual tf2::TimePoint getLatestTimestamp()=0
Get the latest timestamp cached.
A class to keep a sorted linked list in time (newest first, oldest last). This builds and maintains a...
Definition time_cache.hpp:110
void clearList() override
Clear the list of stored values.
TimePoint getOldestTimestamp() override
Get the oldest timestamp cached.
const std::list< TransformStorage > & getAllItems() const
tf2::CompactFrameID getParent(tf2::TimePoint time, std::string *error_str=nullptr, TF2Error *error_code=nullptr) override
Retrieve the parent at a specific time.
P_TimeAndFrameID getLatestTimeAndParent() override
Get the latest time stored in this cache, and the parent associated with it. Returns parent = 0 if no...
TimePoint getLatestTimestamp() override
Get the latest timestamp cached.
unsigned int getListLength() override
Debugging information methods.
bool getData(tf2::TimePoint time, tf2::TransformStorage &data_out, std::string *error_str=nullptr, TF2Error *error_code=nullptr) override
Overridden methods.
bool insertData(const tf2::TransformStorage &new_data) override
Insert data into the cache.
TimeCache(tf2::Duration max_storage_time=TIMECACHE_DEFAULT_MAX_STORAGE_TIME)
Definition buffer_core.hpp:58
uint32_t CompactFrameID
Definition transform_storage.hpp:44
std::pair< TimePoint, CompactFrameID > P_TimeAndFrameID
Definition buffer_core.hpp:60
B toMsg(const A &a)
Function that converts from one type to a ROS message type. It has to be implemented by each data typ...
TF2Error
Definition exceptions.hpp:46
std::chrono::time_point< std::chrono::system_clock, Duration > TimePoint
Definition time.hpp:41
std::chrono::nanoseconds Duration
Definition time.hpp:40
std::shared_ptr< TimeCacheInterface > TimeCacheInterfacePtr
Definition buffer_core.hpp:64
constexpr tf2::Duration TIMECACHE_DEFAULT_MAX_STORAGE_TIME
default value of 10 seconds storage
Definition time_cache.hpp:102
#define TF2_PUBLIC
Definition visibility_control.h:57