1 /* Copyright (c) 2010-2016. 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::addMetaInfo(char *key, char *value) {
23 xbt_assert(key != nullptr);
24 xbt_assert(value != nullptr);
26 this->meta_info.insert({key, value});
29 void Jedule::writeOutput(FILE *file) {
30 if (not this->event_set.empty()) {
31 fprintf(file, "<jedule>\n");
33 if (not this->meta_info.empty()) {
34 fprintf(file, " <jedule_meta>\n");
35 for (auto const& elm : this->meta_info)
36 fprintf(file, " <prop key=\"%s\" value=\"%s\" />\n",elm.first,elm.second);
37 fprintf(file, " </jedule_meta>\n");
40 fprintf(file, " <platform>\n");
41 this->root_container->print(file);
42 fprintf(file, " </platform>\n");
44 fprintf(file, " <events>\n");
45 for (auto const& event : this->event_set)
47 fprintf(file, " </events>\n");
49 fprintf(file, "</jedule>\n");