From 9ebaf728bca44a41fb080b432af20b83be51ad46 Mon Sep 17 00:00:00 2001
From: PierreGtch <pierre.guetschel@gmail.com>
Date: Mon, 3 Jun 2019 14:49:15 +0200
Subject: [PATCH] Add getContainer() method to Buffer class

---
 include/core/processor/processor_base.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h
index 566baa6f6..93f70607a 100644
--- a/include/core/processor/processor_base.h
+++ b/include/core/processor/processor_base.h
@@ -70,6 +70,12 @@ public:
     */
     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
     *
     */
@@ -400,6 +406,12 @@ void Buffer<T>::add(const T& _element, const TimeStamp& _time_stamp)
     container_.emplace(_time_stamp, _element);
 }
 
+template <typename T>
+std::map<TimeStamp,T> Buffer<T>::getContainer()
+{
+    return container_;
+}
+
 template <typename T>
 inline void Buffer<T>::clear()
 {
-- 
GitLab