Skip to content
Snippets Groups Projects
Commit 9ebaf728 authored by PierreGtch's avatar PierreGtch
Browse files

Add getContainer() method to Buffer class

parent 7115402e
No related branches found
No related tags found
1 merge request!290Resolve "ProcessorLoopClosureBase class"
...@@ -70,6 +70,12 @@ public: ...@@ -70,6 +70,12 @@ public:
*/ */
void add(const T& _element, const TimeStamp& _time_stamp); //const Scalar& _time_tolerance); void add(const T& _element, const TimeStamp& _time_stamp); //const Scalar& _time_tolerance);
/** \brief returns the container with elements of the buffer
*
* elements are ordered from most recent to oldest
*/
std::map<TimeStamp,T> getContainer();
/**\brief Remove all packs in the buffer with a time stamp older than the specified /**\brief Remove all packs in the buffer with a time stamp older than the specified
* *
*/ */
...@@ -400,6 +406,12 @@ void Buffer<T>::add(const T& _element, const TimeStamp& _time_stamp) ...@@ -400,6 +406,12 @@ void Buffer<T>::add(const T& _element, const TimeStamp& _time_stamp)
container_.emplace(_time_stamp, _element); container_.emplace(_time_stamp, _element);
} }
template <typename T>
std::map<TimeStamp,T> Buffer<T>::getContainer()
{
return container_;
}
template <typename T> template <typename T>
inline void Buffer<T>::clear() inline void Buffer<T>::clear()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment