From 051c7c114378799c4a6e461d838b73495949a78d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Schr=C3=B6dter?= <t.schroedter@fz-juelich.de>
Date: Sat, 30 Mar 2019 12:41:29 +0100
Subject: [PATCH] Added some Documentation

---
 Simulation.cpp            |  3 ++-
 routing/Router.h          |  4 ++++
 routing/RoutingEngine.cpp |  2 +-
 routing/RoutingEngine.h   | 22 ++++++++++++++++------
 4 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/Simulation.cpp b/Simulation.cpp
index 6b9242df..a930e932 100644
--- a/Simulation.cpp
+++ b/Simulation.cpp
@@ -546,7 +546,8 @@ double Simulation::RunBody(double maxSimTime)
                 }
             }
 
-            if (_routingEngine->isNeedUpdate()){
+            // here the used routers are update, when needed due to external changes
+            if (_routingEngine->NeedsUpdate()){
                  _routingEngine->UpdateRouter();
             }
 
diff --git a/routing/Router.h b/routing/Router.h
index eb9b2c93..b2a65e32 100644
--- a/routing/Router.h
+++ b/routing/Router.h
@@ -142,6 +142,10 @@ public:
 
      void SetTrips(const Trips& trips);
 
+     /**
+      * Update the router, when geometry changed due to external changes.
+      * Remark: Depends on router if needed!
+      */
      virtual void Update();
 };
 
diff --git a/routing/RoutingEngine.cpp b/routing/RoutingEngine.cpp
index 5e09f5b8..494f7f51 100644
--- a/routing/RoutingEngine.cpp
+++ b/routing/RoutingEngine.cpp
@@ -131,7 +131,7 @@ bool RoutingEngine::Init(Building* building)
      return status;
 }
 
-bool RoutingEngine::isNeedUpdate() const
+bool RoutingEngine::NeedsUpdate() const
 {
      return _needUpdate;
 }
diff --git a/routing/RoutingEngine.h b/routing/RoutingEngine.h
index ef5bb52a..ef09a040 100644
--- a/routing/RoutingEngine.h
+++ b/routing/RoutingEngine.h
@@ -107,6 +107,22 @@ public:
       */
      bool Init(Building* building);
 
+     /**
+      * Returns if routers need to be updated
+      * @return routers need to be updated
+      */
+     bool NeedsUpdate() const;
+
+     /**
+      * Set if routers need to be updated
+      * @param needUpdate
+      */
+     void setNeedUpdate(bool needUpdate);
+
+     /**
+      * Updates all used routers
+      */
+     void UpdateRouter();
 
 private:
      /// collections of all routers used
@@ -114,12 +130,6 @@ private:
      /// collection of all trips/routes
      Trips _tripsCollection;
      bool _needUpdate = false;
-public:
-    bool isNeedUpdate() const;
-
-    void setNeedUpdate(bool needUpdate);
-
-    void UpdateRouter();
 };
 
 #endif /* ROUTINGENGINE_H_ */
-- 
GitLab