X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bd7d5780ee8b73efd58c83f5d6f864d0a941b3ed..2319c71fd8f21f5d2ed4b1e3f8b2922c2705ffcb:/include/simgrid/jedule/jedule_platform.hpp diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index 1b0c32c4bc..007e1c1a76 100644 --- a/include/simgrid/jedule/jedule_platform.hpp +++ b/include/simgrid/jedule/jedule_platform.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2019. 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,43 +7,41 @@ #define JED_SIMGRID_PLATFORM_H_ #include -#include -#include +#include +#include #include #include -#include - -#if SIMGRID_HAVE_JEDULE namespace simgrid { namespace jedule{ class XBT_PUBLIC Container { public: - Container(std::string name); - virtual ~Container(); + explicit Container(const std::string& name); + 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 name2id; Container *parent = nullptr; - std::vector children; + std::vector> children; std::vector resource_list; - void addChild(Container* child); - void addResources(std::vector hosts); - void createHierarchy(sg_netzone_t from_as); - std::vector getHierarchy(); - std::string getHierarchyAsString(); + void add_child(Container* child); + void add_resources(std::vector hosts); + void create_hierarchy(sg_netzone_t from_as); + std::vector get_hierarchy(); + std::string get_hierarchy_as_string(); void print(FILE *file); - void printResources(FILE *file); + void print_resources(FILE* file); }; class XBT_PUBLIC Subset { public: Subset(int s, int n, Container* p); - virtual ~Subset()=default; int start_idx; // start idx in resource_list of container int nres; // number of resources spanning starting at start_idx Container *parent; @@ -51,12 +49,8 @@ public: } } -extern "C" { typedef simgrid::jedule::Container * jed_container_t; -typedef simgrid::jedule::Subset * jed_subset_t; -void get_resource_selection_by_hosts(std::vector* subset_list, std::vector *host_list); -} - -#endif +void get_resource_selection_by_hosts(std::vector& subset_list, + const std::vector& host_list); #endif /* JED_SIMGRID_PLATFORM_H_ */