X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d6d03a0a88c2673c9e5c604d63912b77bc17fdd4..6d004c352f7b26fba38486001f874e65466b5bee:/src/instr/jedule/jedule_events.cpp diff --git a/src/instr/jedule/jedule_events.cpp b/src/instr/jedule/jedule_events.cpp index 95a591b042..2744fcd87e 100644 --- a/src/instr/jedule/jedule_events.cpp +++ b/src/instr/jedule/jedule_events.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2016. The SimGrid Team. +/* Copyright (c) 2010-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -12,66 +12,52 @@ namespace simgrid{ namespace jedule{ -Event::Event(std::string name, double start_time, double end_time, std::string type) - : name(name), start_time(start_time), end_time(end_time), type(type) +void Event::add_resources(const std::vector& host_selection) { - this->resource_subsets = new std::vector(); + get_resource_selection_by_hosts(this->resource_subsets_, host_selection); } -Event::~Event() -{ - if (!this->resource_subsets->empty()){ - for (auto subset: *this->resource_subsets) - delete subset; - delete this->resource_subsets; - } -} - -void Event::addResources(std::vector *host_selection) -{ - get_resource_selection_by_hosts(this->resource_subsets, host_selection); -} - -void Event::addCharacteristic(char *characteristic) +void Event::add_characteristic(char* characteristic) { xbt_assert( characteristic != nullptr ); - this->characteristics_list.push_back(characteristic); + this->characteristics_list_.push_back(characteristic); } -void Event::addInfo(char* key, char *value) { +void Event::add_info(char* key, char* value) +{ xbt_assert((key != nullptr) && value != nullptr); - this->info_map.insert({key, value}); + this->info_map_.insert({key, value}); } -void Event::print(FILE *jed_file) +void Event::print(FILE* jed_file) const { fprintf(jed_file, " \n"); - fprintf(jed_file, " \n", this->name.c_str()); - fprintf(jed_file, " \n", this->start_time); - fprintf(jed_file, " \n", this->end_time); - fprintf(jed_file, " \n", this->type.c_str()); + fprintf(jed_file, " \n", this->name_.c_str()); + fprintf(jed_file, " \n", this->start_time_); + fprintf(jed_file, " \n", this->end_time_); + fprintf(jed_file, " \n", this->type_.c_str()); - xbt_assert(!this->resource_subsets-> empty()); + xbt_assert(not this->resource_subsets_.empty()); fprintf(jed_file, " \n"); - for (auto subset: *this->resource_subsets) { + for (auto const& subset : this->resource_subsets_) { fprintf(jed_file, "