[GIT] ppl/ppl(master): Minor improvements: prefer direct header file inclusions to indirect ones.

Module: ppl/ppl Branch: master Commit: 78c8fb6cebda65e57b79176eb7aff2995db8d726 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=78c8fb6cebda6...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Sun Jul 12 08:11:22 2009 +0200
Minor improvements: prefer direct header file inclusions to indirect ones. Avoid unnecessarily long lines.
---
Watchdog/src/EList.defs.hh | 4 +++- Watchdog/src/Threshold_Watcher.cc | 3 ++- Watchdog/src/Threshold_Watcher.defs.hh | 14 +++++++------- Watchdog/src/Threshold_Watcher.templates.hh | 10 +++++----- Watchdog/src/Threshold_Watcher.types.hh | 4 +++- 5 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/Watchdog/src/EList.defs.hh b/Watchdog/src/EList.defs.hh index e16ceb0..fbb9696 100644 --- a/Watchdog/src/EList.defs.hh +++ b/Watchdog/src/EList.defs.hh @@ -24,6 +24,7 @@ site: http://www.cs.unipr.it/ppl/ . */ #define PWL_EList_defs_hh 1
#include "EList.types.hh" +#include "Doubly_Linked_Object.defs.hh" #include "EList_Iterator.defs.hh"
/*! \brief @@ -31,7 +32,8 @@ site: http://www.cs.unipr.it/ppl/ . */ where the links are embedded in the objects themselves). */ template <typename T> -class Parma_Watchdog_Library::EList : private Doubly_Linked_Object { +class Parma_Watchdog_Library::EList + : private Parma_Watchdog_Library::Doubly_Linked_Object { public: //! A const iterator to traverse the list. typedef EList_Iterator<const T> Const_Iterator; diff --git a/Watchdog/src/Threshold_Watcher.cc b/Watchdog/src/Threshold_Watcher.cc index 75c1368..50374e2 100644 --- a/Watchdog/src/Threshold_Watcher.cc +++ b/Watchdog/src/Threshold_Watcher.cc @@ -1,4 +1,5 @@ -/* Threshold_Watcher and associated classes' implementation (non-inline functions). +/* Threshold_Watcher and associated classes' implementation + (non-inline functions). Copyright (C) 2001-2009 Roberto Bagnara bagnara@cs.unipr.it
This file is part of the Parma Watchdog Library (PWL). diff --git a/Watchdog/src/Threshold_Watcher.defs.hh b/Watchdog/src/Threshold_Watcher.defs.hh index 132c973..e2f8f55 100644 --- a/Watchdog/src/Threshold_Watcher.defs.hh +++ b/Watchdog/src/Threshold_Watcher.defs.hh @@ -28,16 +28,18 @@ site: http://www.cs.unipr.it/ppl/ . */ #include "Pending_List.defs.hh" #include <cassert>
-namespace Parma_Watchdog_Library { - //! A watchdog for thresholds exceeding. template <typename Traits> -class Threshold_Watcher { +class Parma_Watchdog_Library::Threshold_Watcher { public: template <typename Flag_Base, typename Flag> - Threshold_Watcher(const typename Traits::Delta& delta, const Flag_Base* volatile& holder, Flag& flag); + Threshold_Watcher(const typename Traits::Delta& delta, + const Flag_Base* volatile& holder, + Flag& flag); + + Threshold_Watcher(const typename Traits::Delta& delta, + void (*function)());
- Threshold_Watcher(const typename Traits::Delta& delta, void (*function)()); ~Threshold_Watcher();
private: @@ -74,8 +76,6 @@ private:
};
-} // namespace Parma_Watchdog_Library - #include "Threshold_Watcher.inlines.hh" #include "Threshold_Watcher.templates.hh"
diff --git a/Watchdog/src/Threshold_Watcher.templates.hh b/Watchdog/src/Threshold_Watcher.templates.hh index b902153..a133775 100644 --- a/Watchdog/src/Threshold_Watcher.templates.hh +++ b/Watchdog/src/Threshold_Watcher.templates.hh @@ -28,17 +28,17 @@ namespace Parma_Watchdog_Library { template <typename Traits> typename Threshold_Watcher<Traits>::WW_Pending_List::Iterator Threshold_Watcher<Traits>::add_threshold(typename Traits::Threshold threshold, - const Handler& handler, - bool& expired_flag) { + const Handler& handler, + bool& expired_flag) { Traits::check_function = Threshold_Watcher::check; return initialize.pending.insert(threshold, handler, expired_flag); }
template <typename Traits> typename Threshold_Watcher<Traits>::WW_Pending_List::Iterator -Threshold_Watcher<Traits>::remove_threshold(typename WW_Pending_List::Iterator position) { - typename WW_Pending_List::Iterator i; - i = initialize.pending.erase(position); +Threshold_Watcher<Traits> +::remove_threshold(typename WW_Pending_List::Iterator position) { + typename WW_Pending_List::Iterator i = initialize.pending.erase(position); if (initialize.pending.empty()) Traits::check_function = 0; return i; diff --git a/Watchdog/src/Threshold_Watcher.types.hh b/Watchdog/src/Threshold_Watcher.types.hh index 69101a0..e6e7bee 100644 --- a/Watchdog/src/Threshold_Watcher.types.hh +++ b/Watchdog/src/Threshold_Watcher.types.hh @@ -13,8 +13,10 @@ PURPOSE. */ #define PWL_Threshold_Watcher_types_hh 1
namespace Parma_Watchdog_Library { + template <typename Traits> class Threshold_Watcher; -} + +} // namespace Parma_Watchdog_Library
#endif // !defined(PWL_Threshold_Watcher_types_hh)
participants (1)
-
Enea Zaffanella