Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / include / simgrid / jedule / jedule_platform.hpp
index a7f7439..9566380 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. */
@@ -7,32 +7,32 @@
 #define JED_SIMGRID_PLATFORM_H_
 
 #include <simgrid/forward.h>
-#include <xbt/dynar.h>
 
+#include <memory>
+#include <string>
 #include <unordered_map>
 #include <vector>
-#include <string>
 
 namespace simgrid {
 namespace jedule{
 class XBT_PUBLIC Container {
 public:
   explicit Container(const std::string& name);
-  ~Container();
+  Container(const Container&) = delete;
+  Container& operator=(const Container&) = delete;
 
 private:
-  int last_id_;
-  int is_lowest_ = 0;
+  int last_id_   = 0;
 
 public:
   std::string name;
   std::unordered_map<const char*, unsigned int> name2id;
   Container *parent = nullptr;
-  std::vector<Container*> children;
+  std::vector<std::unique_ptr<Container>> children;
   std::vector<sg_host_t> resource_list;
   void add_child(Container* child);
   void add_resources(std::vector<sg_host_t> hosts);
-  void create_hierarchy(sg_netzone_t from_as);
+  void create_hierarchy(const_sg_netzone_t from_as);
   std::vector<int> get_hierarchy();
   std::string get_hierarchy_as_string();
   void print(FILE *file);