Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
[simgrid.git] / src / plugins / link_load.cpp
index edadcbc..77f4382 100644 (file)
@@ -39,10 +39,19 @@ namespace simgrid {
 namespace plugin {
 
 class LinkLoad {
+  s4u::Link* link_{};      /*< The link onto which this data is attached*/
+  bool is_tracked_{false}; /*<Whether the link is tracked or not*/
+
+  double cumulated_bytes_{};      /*< Cumulated load since last reset*/
+  double min_bytes_per_second_{}; /*< Minimum instantaneous load observed since last reset*/
+  double max_bytes_per_second_{}; /*< Maximum instantaneous load observed since last reset*/
+  double last_reset_{};           /*< Timestamp of the last reset (init timestamp by default)*/
+  double last_updated_{};         /*< Timestamp of the last energy update event*/
+
 public:
-  static simgrid::xbt::Extension<simgrid::s4u::Link, LinkLoad> EXTENSION_ID;
+  static xbt::Extension<s4u::Link, LinkLoad> EXTENSION_ID;
 
-  explicit LinkLoad(simgrid::s4u::Link* ptr);
+  explicit LinkLoad(s4u::Link* ptr);
 
   void track();
   void untrack();
@@ -51,25 +60,15 @@ public:
   double get_average_bytes();
 
   /// Getter methods.
-  bool is_tracked() const;
+  bool is_tracked() const { return is_tracked_; }
   double get_cumulated_bytes();
   double get_min_bytes_per_second();
   double get_max_bytes_per_second();
-
-private:
-  s4u::Link* link_{};      /*< The link onto which this data is attached*/
-  bool is_tracked_{false}; /*<Whether the link is tracked or not*/
-
-  double cumulated_bytes_{};      /*< Cumulated load since last reset*/
-  double min_bytes_per_second_{}; /*< Minimum instantaneous load observed since last reset*/
-  double max_bytes_per_second_{}; /*< Maximum instantaneous load observed since last reset*/
-  double last_reset_{};           /*< Timestamp of the last reset (init timestamp by default)*/
-  double last_updated_{};         /*< Timestamp of the last energy update event*/
 };
 
 xbt::Extension<s4u::Link, LinkLoad> LinkLoad::EXTENSION_ID;
 
-LinkLoad::LinkLoad(simgrid::s4u::Link* ptr) : link_(ptr), is_tracked_(false)
+LinkLoad::LinkLoad(s4u::Link* ptr) : link_(ptr), is_tracked_(false)
 {
   XBT_DEBUG("Instantiating a LinkLoad for link '%s'", link_->get_cname());
 }
@@ -131,10 +130,6 @@ void LinkLoad::update()
   last_updated_ = now;
 }
 
-bool LinkLoad::is_tracked() const
-{
-  return is_tracked_;
-}
 double LinkLoad::get_cumulated_bytes()
 {
   update();