From: Martin Quinson Date: Sat, 10 Mar 2018 16:57:37 +0000 (+0100) Subject: move the definition of resource's Metric as an inner class X-Git-Tag: v3.19~97 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c2791a779fbd1de095a0634afaddaafd203dff02?hp=efdf331fec43d7ce02cc61f2ad6d3c7e900b3e24 move the definition of resource's Metric as an inner class --- diff --git a/src/kernel/model/Resource.hpp b/src/kernel/model/Resource.hpp index 153325e405..b34bcc0759 100644 --- a/src/kernel/model/Resource.hpp +++ b/src/kernel/model/Resource.hpp @@ -74,6 +74,12 @@ public: /* LMM */ protected: const kernel::lmm::Constraint* constraint_ = nullptr; + + struct Metric { + double peak; /**< The peak of the metric, ie its max value */ + double scale; /**< Current availability of the metric according to the traces, in [0,1] */ + tmgr_trace_event_t event; /**< The associated trace event associated to the metric */ + }; }; } // namespace model } // namespace kernel diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 1eb54c3f22..5b97cf2267 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -135,7 +135,7 @@ public: virtual void setSpeedTrace(tmgr_trace_t trace); /*< setup the trace file with availability events (peak speed changes due to external load). Trace must contain relative values (ratio between 0 and 1) */ tmgr_trace_event_t stateEvent_ = nullptr; - s_surf_metric_t speed_ = {1.0, 0, nullptr}; + Metric speed_ = {1.0, 0, nullptr}; }; /********** diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index aedbde82f0..87f37e0a91 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -160,8 +160,8 @@ public: Trace must contain absolute values */ tmgr_trace_event_t stateEvent_ = nullptr; - s_surf_metric_t latency_ = {1.0, 0, nullptr}; - s_surf_metric_t bandwidth_ = {1.0, 0, nullptr}; + Metric latency_ = {1.0, 0, nullptr}; + Metric bandwidth_ = {1.0, 0, nullptr}; /* User data */ void* getData() { return userData; } diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index adfddab53d..6472c75061 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -373,14 +373,5 @@ private: * Resource * ************/ -/** @ingroup SURF_interface - * @brief Resource which have a metric handled by a maxmin system - */ -struct s_surf_metric_t { - double peak; /**< The peak of the metric, ie its max value */ - double scale; /**< Current availability of the metric according to the traces, in [0,1] */ - tmgr_trace_event_t event; /**< The associated trace event associated to the metric */ -}; - #endif /* SURF_MODEL_H_ */