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
15 void Jedule::add_meta_info(char* key, char* value)
17 xbt_assert(key != nullptr);
18 xbt_assert(value != nullptr);
20 this->meta_info_.insert({key, value});
23 void Jedule::write_output(FILE* file)
25 if (not this->event_set_.empty()) {
26 fprintf(file, "<jedule>\n");
28 if (not this->meta_info_.empty()) {
29 fprintf(file, " <jedule_meta>\n");
30 for (auto const& elm : this->meta_info_)
31 fprintf(file, " <prop key=\"%s\" value=\"%s\" />\n",elm.first,elm.second);
32 fprintf(file, " </jedule_meta>\n");
35 fprintf(file, " <platform>\n");
36 this->root_container_.print(file);
37 fprintf(file, " </platform>\n");
39 fprintf(file, " <events>\n");
40 for (auto const& event : this->event_set_)
42 fprintf(file, " </events>\n");
44 fprintf(file, "</jedule>\n");