From 01ae631eab583be7a2ea6b0b57e81da85081b855 Mon Sep 17 00:00:00 2001
From: asantamaria <asantamaria@iri.upc.edu>
Date: Tue, 20 Feb 2018 09:27:33 +0100
Subject: [PATCH] add comments to KFPackBuffer class

---
 src/processor_base.h | 41 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/src/processor_base.h b/src/processor_base.h
index 56d0ef663..447f7fabe 100644
--- a/src/processor_base.h
+++ b/src/processor_base.h
@@ -17,6 +17,10 @@ class SensorBase;
 
 namespace wolf {
 
+/** \brief Key frame class pack
+ *
+ * To store a key_frame with an associated time tolerance.
+ */
 class KFPack
 {
     public:
@@ -28,34 +32,67 @@ class KFPack
 
 WOLF_PTR_TYPEDEFS(KFPack);
 
+
+/** \brief Buffer of Key frame class objects
+ *
+ * Object and functions to manage a buffer of KFPack objects.
+ */
 class KFPackBuffer
 {
     public:
 
-        typedef std::map<TimeStamp,KFPackPtr>::iterator Iterator;
+        typedef std::map<TimeStamp,KFPackPtr>::iterator Iterator; // buffer iterator
 
         KFPackBuffer(void);
         ~KFPackBuffer(void);
 
+        /**\brief Select a Pack from the buffer
+         *
+         *  Select from the buffer the closest pack (w.r.t. time stamp),
+         * respecting a defined time tolerance
+         */
         KFPackPtr selectPack(const TimeStamp& _time_stamp, const Scalar& _time_tolerance);
 
+        /**\brief Buffer size
+         *
+         */
         size_t size(void);
 
+        /**\brief Add a pack to the buffer
+         *
+         */
         void add(const FrameBasePtr& _key_frame, const Scalar& _time_tolerance);
 
+        /**\brief Remove all packs in the buffer with a time stamp older than the specified
+         *
+         */
         void removeUpTo(const TimeStamp& _time_stamp);
 
+        /**\brief Check time tolerance
+         *
+         * Check if the time distance between two time stamps is smaller than
+         * the minimum time tolerance of the two frames.
+         */
         bool checkTimeTolerance(const TimeStamp& _time_stamp1, const Scalar& _time_tolerance1, const TimeStamp& _time_stamp2, const Scalar& _time_tolerance2);
 
+        /**\brief Clear the buffer
+         *
+         */
         void clear();
 
+        /**\brief Empty the buffer
+         *
+         */
         bool empty();
 
+        /**\brief Print buffer information
+         *
+         */
         void print();
 
     private:
 
-        std::map<TimeStamp,KFPackPtr> container_;
+        std::map<TimeStamp,KFPackPtr> container_; // Main buffer container
 };
 
 /** \brief base struct for processor parameters
-- 
GitLab