Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tiny cleanups in HostCLM03Model
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Jul 2018 22:23:59 +0000 (00:23 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 7 Jul 2018 22:27:28 +0000 (00:27 +0200)
src/surf/host_clm03.cpp
src/surf/host_clm03.hpp

index 912e630..f25ebdf 100644 (file)
@@ -3,42 +3,33 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "host_clm03.hpp"
+#include "src/surf/host_clm03.hpp"
 #include "simgrid/sg_config.hpp"
 #include "surf/surf.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_host);
 
-/*************
- * CallBacks *
- *************/
-
-/*********
- * Model *
- *********/
-
 void surf_host_model_init_current_default()
 {
   surf_host_model = new simgrid::surf::HostCLM03Model();
   simgrid::config::set_default<bool>("network/crosstraffic", true);
   surf_cpu_model_init_Cas01();
   surf_network_model_init_LegrandVelho();
-
-  all_existing_models->push_back(surf_host_model);
 }
 
 void surf_host_model_init_compound()
 {
   xbt_assert(surf_cpu_model_pm, "No CPU model defined yet!");
   xbt_assert(surf_network_model, "No network model defined yet!");
-
   surf_host_model = new simgrid::surf::HostCLM03Model();
-  all_existing_models->push_back(surf_host_model);
 }
 
 namespace simgrid {
 namespace surf {
-
+HostCLM03Model::HostCLM03Model()
+{
+  all_existing_models->push_back(this);
+}
 double HostCLM03Model::next_occuring_event(double now)
 {
   ignore_empty_vm_in_pm_LMM();
@@ -65,7 +56,7 @@ double HostCLM03Model::next_occuring_event(double now)
 
 void HostCLM03Model::update_actions_state(double /*now*/, double /*delta*/)
 {
-  /* I won't do what you tell me */
+  /* I've no action to update */
 }
 
 }
index 53771aa..1e97a2d 100644 (file)
@@ -1,14 +1,8 @@
-/* Copyright (c) 2013-2018. The SimGrid Team.
- * All rights reserved.                                                     */
+/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <xbt/base.h>
-
-#include "StorageImpl.hpp"
-#include "cpu_interface.hpp"
-#include "network_interface.hpp"
 #include "src/surf/HostImpl.hpp"
 
 #ifndef SURF_HOST_CLM03_HPP_
 namespace simgrid {
 namespace surf {
 
-class XBT_PRIVATE HostCLM03Model;
-
-/*********
- * Model *
- *********/
-
-class HostCLM03Model : public HostModel {
+class XBT_PRIVATE HostCLM03Model : public HostModel {
 public:
+  HostCLM03Model();
   double next_occuring_event(double now) override;
   void update_actions_state(double now, double delta) override;
 };