X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d8232f0af88b82c158f0451e3b41ef9ec85ced02..12459ed00fdc525ec6e524555dfe80ce7737bab7:/include/simgrid/jedule/jedule_platform.hpp diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index a7f74391f4..a63279e16c 100644 --- a/include/simgrid/jedule/jedule_platform.hpp +++ b/include/simgrid/jedule/jedule_platform.hpp @@ -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,36 @@ #define JED_SIMGRID_PLATFORM_H_ #include -#include +#include +#include #include #include -#include namespace simgrid { namespace jedule{ class XBT_PUBLIC Container { + int last_id_ = 0; + std::string name; + std::unordered_map name2id; + Container* parent_ = nullptr; + std::vector> children_; + std::vector resource_list; + 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; + const char* get_cname() const { return name.c_str(); } + void set_parent(Container* parent) { parent_ = parent; } + bool has_children() const { return not children_.empty(); } + int get_child_position(const Container* child) const; + unsigned int get_id_by_name(const char* name) const { return name2id.at(name); } -public: - std::string name; - std::unordered_map name2id; - Container *parent = nullptr; - std::vector children; - std::vector resource_list; void add_child(Container* child); void add_resources(std::vector hosts); - void create_hierarchy(sg_netzone_t from_as); + void create_hierarchy(const_sg_netzone_t from_as); std::vector get_hierarchy(); std::string get_hierarchy_as_string(); void print(FILE *file); @@ -47,9 +51,9 @@ public: Container *parent; }; -} -} -typedef simgrid::jedule::Container * jed_container_t; +} // namespace jedule +} // namespace simgrid +using jed_container_t = simgrid::jedule::Container*; void get_resource_selection_by_hosts(std::vector& subset_list, const std::vector& host_list);