Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] don't mix public/private issues in jedule
[simgrid.git] / include / simgrid / jedule / jedule.hpp
index d742137..55b84eb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2019. 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. */
@@ -8,6 +8,7 @@
 
 #include <simgrid/jedule/jedule_events.hpp>
 #include <simgrid/jedule/jedule_platform.hpp>
+#include <simgrid/s4u/Engine.hpp>
 
 #include <cstdio>
 
@@ -15,20 +16,23 @@ namespace simgrid {
 namespace jedule{
 
 class XBT_PUBLIC Jedule {
-public:
-  Jedule(const std::string& name) : root_container_(name) {}
+  std::unordered_map<char*, char*> meta_info_;
   std::vector<Event> event_set_;
   Container root_container_;
+
+public:
+  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);
-
-private:
-  std::unordered_map<char*, char*> meta_info_;
 };
 
-}
-}
+} // namespace jedule
+} // namespace simgrid
 
 typedef simgrid::jedule::Jedule *jedule_t;