1 /* Copyright (c) 2010-2019. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "xbt/asserts.h"
8 #include "simgrid/jedule/jedule.hpp"
10 #if SIMGRID_HAVE_JEDULE
16 delete this->root_container_;
17 for (auto const& evt : this->event_set_)
19 this->event_set_.clear();
22 void Jedule::add_meta_info(char* key, char* value)
24 xbt_assert(key != nullptr);
25 xbt_assert(value != nullptr);
27 this->meta_info_.insert({key, value});
30 void Jedule::write_output(FILE* file)
32 if (not this->event_set_.empty()) {
33 fprintf(file, "<jedule>\n");
35 if (not this->meta_info_.empty()) {
36 fprintf(file, " <jedule_meta>\n");
37 for (auto const& elm : this->meta_info_)
38 fprintf(file, " <prop key=\"%s\" value=\"%s\" />\n",elm.first,elm.second);
39 fprintf(file, " </jedule_meta>\n");
42 fprintf(file, " <platform>\n");
43 this->root_container_->print(file);
44 fprintf(file, " </platform>\n");
46 fprintf(file, " <events>\n");
47 for (auto const& event : this->event_set_)
49 fprintf(file, " </events>\n");
51 fprintf(file, "</jedule>\n");