X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a46dc2e1f51658a842b4df3e689bd7f6c49986fe..685040f3a8779f848f54d8bc8f8d1d1bf003a622:/src/surf/cpu_ti.hpp diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 9c6f0a85a0..014789a0fc 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -6,13 +6,11 @@ #ifndef SURF_MODEL_CPUTI_H_ #define SURF_MODEL_CPUTI_H_ -#include - -//#include - #include "src/surf/cpu_interface.hpp" #include "src/surf/trace_mgr.hpp" +#include + namespace simgrid { namespace surf { @@ -42,15 +40,14 @@ public: int binary_search(double* array, double a, int low, int high); }; -enum trace_type { - - TRACE_FIXED, /*< Trace fixed, no availability file */ - TRACE_DYNAMIC /*< Dynamic, have an availability file */ -}; - class CpuTiTmgr { + enum class Type { + FIXED, /*< Trace fixed, no availability file */ + DYNAMIC /*< Dynamic, have an availability file */ + }; + public: - CpuTiTmgr(trace_type type, double value) : type_(type), value_(value){}; + explicit CpuTiTmgr(double value) : type_(Type::FIXED), value_(value){}; CpuTiTmgr(tmgr_trace_t speed_trace, double value); CpuTiTmgr(const CpuTiTmgr&) = delete; CpuTiTmgr& operator=(const CpuTiTmgr&) = delete; @@ -60,7 +57,8 @@ public: double solve(double a, double amount); double get_power_scale(double a); - trace_type type_; +private: + Type type_; double value_; /*< Percentage of cpu speed available. Value fixed between 0 and 1 */ /* Dynamic */