From 81ba809a19ed5c09642fb1df46fa22d7b32424d7 Mon Sep 17 00:00:00 2001
From: Joan Perez Ibarz <jperez@iri.upc.edu>
Date: Mon, 14 Mar 2011 19:10:51 +0000
Subject: [PATCH] - adding execption to segway driver constructor -
 implementing reconfigure callback instead of making it virtual in
 iri_base_algorithm

---
 .../iri_base_algorithm/iri_base_algorithm.h   | 29 +++++++++++++++----
 1 file changed, 24 insertions(+), 5 deletions(-)

diff --git a/include/iri_base_algorithm/iri_base_algorithm.h b/include/iri_base_algorithm/iri_base_algorithm.h
index c1ac22a..dcbfbef 100644
--- a/include/iri_base_algorithm/iri_base_algorithm.h
+++ b/include/iri_base_algorithm/iri_base_algorithm.h
@@ -1,3 +1,21 @@
+// Copyright (C) 2010-2011 Institut de Robotica i Informatica Industrial, CSIC-UPC.
+// Author Sergi Hernandez & Joan Perez
+// All rights reserved.
+//
+// This file is part of iri-ros-pkg
+// iri-ros-pkg is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 #ifndef _IRI_BASE_ALGORITHM_H
 #define _IRI_BASE_ALGORITHM_H
 
@@ -206,7 +224,7 @@ class IriBaseAlgorithm : public AbstractAlgorithmNode
     * \param level  integer referring the level in which the configuration
     *               has been changed.
     */
-    virtual void reconfigureCallback(Config &config, uint32_t level) = 0;
+    void reconfigureCallback(Config &config, uint32_t level);
 
    /**
     * \brief add diagnostics
@@ -285,11 +303,12 @@ IriBaseAlgorithm<Algorithm>::~IriBaseAlgorithm()
   this->thread_server_->kill_thread(this->main_thread_id_);
 }
 
-// template <class Algorithm>
-// void IriBaseAlgorithm<Algorithm>::reconfigureCallback(Config &config, uint32_t level)
-// {
+template <class Algorithm>
+void IriBaseAlgorithm<Algorithm>::reconfigureCallback(Config &config, uint32_t level)
+{
 //   this->alg_.config_ = config;
-// }
+  this->alg_.config_update(config, level);
+}
 
 template <class Algorithm>
 void IriBaseAlgorithm<Algorithm>::addDiagnostics(void)
-- 
GitLab