From aeaec77cd1f8e5baebebf7f2bec2cdc7e0716986 Mon Sep 17 00:00:00 2001 From: elvez Date: Thu, 14 Sep 2006 15:31:42 +0000 Subject: [PATCH] - Another bit of auditing... git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1149 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/backend/key_file.cc | 2 + src/backend/sgpemv2/key_file.hh | 19 ++++++---- src/backend/sgpemv2/thread_statistics.hh | 48 +++++++++++++----------- 3 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/backend/key_file.cc b/src/backend/key_file.cc index 6de3e91..d758f82 100644 --- a/src/backend/key_file.cc +++ b/src/backend/key_file.cc @@ -81,6 +81,8 @@ namespace sgpem void KeyFile::file_read(std::istream& is) { + const unsigned int KEY_FILE_BUF_LEN = 1000; + if (is) { _elements.clear(); // erase all elements diff --git a/src/backend/sgpemv2/key_file.hh b/src/backend/sgpemv2/key_file.hh index b2dd6aa..362bed0 100644 --- a/src/backend/sgpemv2/key_file.hh +++ b/src/backend/sgpemv2/key_file.hh @@ -1,4 +1,4 @@ -// src/backend/key_file.hh - Copyright 2005, 2006, University +// src/backend/sgpemv2/key_file.hh - Copyright 2005, 2006, University // of Padova, dept. of Pure and Applied // Mathematics // @@ -21,17 +21,20 @@ #ifndef KEY_FILE_HH #define KEY_FILE_HH 1 -#define KEY_FILE_BUF_LEN 1000 - -#include -#include -#include -#include "config.h" - namespace sgpem { class KeyFile; +} +#include "config.h" + +#include + +#include +#include + +namespace sgpem +{ /** \brief Save and retrieve configuration files formatted as key=value rows. * * This class handles files to store and retrieve configuration preferences diff --git a/src/backend/sgpemv2/thread_statistics.hh b/src/backend/sgpemv2/thread_statistics.hh index b798b2d..5063121 100644 --- a/src/backend/sgpemv2/thread_statistics.hh +++ b/src/backend/sgpemv2/thread_statistics.hh @@ -1,4 +1,4 @@ -// src/backend/thread_statistics.hh - Copyright 2005, 2006, University +// src/backend/sgpemv2/thread_statistics.hh - Copyright 2005, 2006, University // of Padova, dept. of Pure and Applied // Mathematics // @@ -31,27 +31,31 @@ namespace sgpem { - class ThreadStatistics : public SchedulableStatistics - { - public: - ~ThreadStatistics(); - - int get_execution_time() const =0; - int get_execution_progress() const =0; - int get_total_inactivity() const =0; - int get_response_time() const =0; - int get_turn_around() const =0; - int get_efficiency() const =0; - int get_resource_usage_time() const =0; - int get_resource_waitings_time() const =0; - - const Thread* get_core() const =0; - - virtual int get_real_arrival_time() const =0; //useful for ProcessStatistics - - protected: - ThreadStatistics(); - }; + class ThreadStatistics : public SchedulableStatistics + { + public: + ~ThreadStatistics(); + + int get_execution_time() const =0; + int get_execution_progress() const =0; + int get_total_inactivity() const =0; + int get_response_time() const =0; + int get_turn_around() const =0; + int get_efficiency() const =0; + int get_resource_usage_time() const =0; + int get_resource_waitings_time() const =0; + + const Thread* get_core() const =0; + + /** \brief Useful for ProcessStatistics + * \return The first instant at which the thread was first + * given the processor + */ + virtual int get_real_arrival_time() const =0; + + protected: + ThreadStatistics(); + }; } #endif