X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a96adb51dabc0c759af11e60c770355f22a54ef3..cc4eceb15c80a597e44222b8c0ff60caf85db959:/include/simgrid/jedule/jedule_platform.hpp diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index 9510ad01b0..0d8cf5ca16 100644 --- a/include/simgrid/jedule/jedule_platform.hpp +++ b/include/simgrid/jedule/jedule_platform.hpp @@ -1,5 +1,4 @@ -/* Copyright (c) 2010-2012, 2014-2017. 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,39 +6,64 @@ #ifndef JED_SIMGRID_PLATFORM_H_ #define JED_SIMGRID_PLATFORM_H_ -#include "simgrid_config.h" -#include "simgrid/forward.h" -#include "xbt/dynar.h" +#include +#include + #include #include #include -#if SIMGRID_HAVE_JEDULE namespace simgrid { namespace jedule{ -XBT_PUBLIC_CLASS Container { +class XBT_PUBLIC Container { public: - Container(std::string name); + explicit Container(std::string name); + Container(const Container&) = delete; + Container& operator=(const Container&) = delete; virtual ~Container(); private: - int last_id; - int is_lowest = 0; + int last_id_; + int is_lowest_ = 0; + public: std::string name; std::unordered_map name2id; Container *parent = nullptr; 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); + + // deprecated + XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_child()") void addChild(Container* child) { add_child(child); } + XBT_ATTRIB_DEPRECATED_v323("Please use Container::add_resources()") void addResources(std::vector hosts) + { + add_resources(hosts); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Container::create_hierarchy()") void createHierarchy(sg_netzone_t from_as) + { + create_hierarchy(from_as); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy()") std::vector getHierarchy() + { + return get_hierarchy(); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Container::get_hierarchy_as_string()") std::string getHierarchyAsString() + { + return get_hierarchy_as_string(); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Container::print_resources()") void printResources(FILE* file) + { + print_resources(file); + } }; -XBT_PUBLIC_CLASS Subset { +class XBT_PUBLIC Subset { public: Subset(int s, int n, Container* p); virtual ~Subset()=default; @@ -50,12 +74,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 #endif /* JED_SIMGRID_PLATFORM_H_ */