Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'pikachuyann/simgrid-stoprofiles'
[simgrid.git] / src / kernel / resource / profile / Profile.cpp
index 3f2ffba..478c0c4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2020. 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. */
@@ -38,7 +38,7 @@ Profile::~Profile() = default;
  * and get an iterator over the integrated trace  */
 Event* Profile::schedule(FutureEvtSet* fes, resource::Resource* resource)
 {
-  Event* event    = new Event();
+  auto* event     = new Event();
   event->profile  = this;
   event->idx      = 0;
   event->resource = resource;
@@ -96,7 +96,7 @@ DatedValue Profile::next(Event* event)
 Profile* Profile::from_string(const std::string& name, const std::string& input, double periodicity)
 {
   int linecount                                    = 0;
-  simgrid::kernel::profile::Profile* profile       = new simgrid::kernel::profile::Profile();
+  auto* profile                                    = new simgrid::kernel::profile::Profile();
   simgrid::kernel::profile::DatedValue* last_event = &(profile->event_list.back());
 
   xbt_assert(trace_list.find(name) == trace_list.end(), "Refusing to define trace %s twice", name.c_str());
@@ -214,7 +214,7 @@ Profile* Profile::from_file(const std::string& path)
   xbt_assert(not path.empty(), "Cannot parse a trace from an empty filename");
   xbt_assert(trace_list.find(path) == trace_list.end(), "Refusing to define trace %s twice", path.c_str());
 
-  std::ifstream* f = surf_ifsopen(path);
+  const std::ifstream* f = surf_ifsopen(path);
   xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", path.c_str(), (boost::join(surf_path, ":")).c_str());
 
   std::stringstream buffer;