-/* Copyright (c) 2010-2012, 2014-2015. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2010-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. */
#ifndef JEDULE_HPP_
#define JEDULE_HPP_
-#include <stdio.h>
-#include "simgrid_config.h"
-#include "jedule_events.hpp"
-#include "jedule_platform.hpp"
+#include <simgrid/jedule/jedule_events.hpp>
+#include <simgrid/jedule/jedule_platform.hpp>
+#include <simgrid/s4u/Engine.hpp>
-#if HAVE_JEDULE
-
-XBT_ATTRIB_UNUSED static std::unordered_map <const char *, jed_container_t> host2_simgrid_parent_container;
-XBT_ATTRIB_UNUSED static std::unordered_map <std::string, jed_container_t> container_name2container;
+#include <cstdio>
namespace simgrid {
namespace jedule{
+class XBT_PUBLIC Jedule {
+ std::unordered_map<char*, char*> meta_info_;
+ std::vector<Event> event_set_;
+ Container root_container_;
-XBT_PUBLIC_CLASS Jedule {
public:
- Jedule()=default;
- ~Jedule();
- std::vector<Event *> event_set;
- Container* root_container = nullptr;
- std::unordered_map<char*, char*> meta_info;
- void addMetaInfo(char* key, char* value);
- void cleanupOutput();
- void writeOutput(FILE *file);
+ explicit Jedule(const std::string& name) : root_container_(name)
+ {
+ root_container_.create_hierarchy(s4u::Engine::get_instance()->get_netzone_root());
+ }
+ void add_meta_info(char* key, char* value);
+ void add_event(const Event& event);
+ void cleanup_output();
+ void write_output(FILE* file);
};
-}
-}
-
-SG_BEGIN_DECL()
+} // namespace jedule
+} // namespace simgrid
typedef simgrid::jedule::Jedule *jedule_t;
-SG_END_DECL()
-#endif
-
#endif /* JEDULE_HPP_ */