X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1ac51a57cbc9eeda2ae7100d7366d0788db83029..8ec63ad549cad884dad1c08e901671496d548a4d:/include/simgrid/jedule/jedule_platform.hpp diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index ed27a85c16..8097776b16 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. */ @@ -16,24 +16,27 @@ 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(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); @@ -48,8 +51,8 @@ public: Container *parent; }; -} -} +} // namespace jedule +} // namespace simgrid typedef simgrid::jedule::Container * jed_container_t; void get_resource_selection_by_hosts(std::vector& subset_list, const std::vector& host_list);