From: Martin Quinson Date: Mon, 18 Jun 2018 13:16:31 +0000 (+0200) Subject: snake_case jedule X-Git-Tag: v3.20~74 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dc63d290001cd127af79685f3cd811e03eebcece snake_case jedule --- diff --git a/include/simgrid/jedule/jedule.hpp b/include/simgrid/jedule/jedule.hpp index 8c9ef3945c..1a1e859d3a 100644 --- a/include/simgrid/jedule/jedule.hpp +++ b/include/simgrid/jedule/jedule.hpp @@ -21,9 +21,17 @@ public: std::vector event_set; Container* root_container = nullptr; std::unordered_map meta_info; - void addMetaInfo(char* key, char* value); - void cleanupOutput(); - void writeOutput(FILE *file); + void add_meta_info(char* key, char* value); + void cleanup_output(); + void write_output(FILE* file); + + // deprecated + XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::add_meta_info()") void addMetaInfo(char* key, char* value) + { + add_meta_info(key, value); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::cleanup_output()") void cleanupOutput() { cleanup_output(); } + XBT_ATTRIB_DEPRECATED_v323("Please use Jedule::write_output()") void writeOutput(FILE* file) { write_output(file); } }; } diff --git a/include/simgrid/jedule/jedule_events.hpp b/include/simgrid/jedule/jedule_events.hpp index 71bced756d..54d00023a0 100644 --- a/include/simgrid/jedule/jedule_events.hpp +++ b/include/simgrid/jedule/jedule_events.hpp @@ -21,11 +21,26 @@ class XBT_PUBLIC Event { public: Event(std::string name, double start_time, double end_time, std::string type); ~Event(); - void addCharacteristic(char* characteristic); - void addResources(std::vector* host_selection); - void addInfo(char* key, char* value); + void add_characteristic(char* characteristic); + void add_resources(std::vector* host_selection); + void add_info(char* key, char* value); void print(FILE* file); + // deprecated + XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_characteristic()") void addCharacteristic(char* characteristic) + { + add_characteristic(characteristic); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_resources()") void addResources( + std::vector* host_selection) + { + add_resources(host_selection); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Event::add_info()") void addInfo(char* key, char* value) + { + add_info(key, value); + } + private: std::string name; double start_time; diff --git a/include/simgrid/jedule/jedule_platform.hpp b/include/simgrid/jedule/jedule_platform.hpp index 5e40d67784..e5d5f6407c 100644 --- a/include/simgrid/jedule/jedule_platform.hpp +++ b/include/simgrid/jedule/jedule_platform.hpp @@ -28,13 +28,36 @@ public: 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); + } }; class XBT_PUBLIC Subset { diff --git a/src/instr/jedule/jedule.cpp b/src/instr/jedule/jedule.cpp index 475b615623..762b1d4012 100644 --- a/src/instr/jedule/jedule.cpp +++ b/src/instr/jedule/jedule.cpp @@ -19,14 +19,16 @@ Jedule::~Jedule() { this->event_set.clear(); } -void Jedule::addMetaInfo(char *key, char *value) { +void Jedule::add_meta_info(char* key, char* value) +{ xbt_assert(key != nullptr); xbt_assert(value != nullptr); this->meta_info.insert({key, value}); } -void Jedule::writeOutput(FILE *file) { +void Jedule::write_output(FILE* file) +{ if (not this->event_set.empty()) { fprintf(file, "\n"); diff --git a/src/instr/jedule/jedule_events.cpp b/src/instr/jedule/jedule_events.cpp index 5789db9e12..7047f22c36 100644 --- a/src/instr/jedule/jedule_events.cpp +++ b/src/instr/jedule/jedule_events.cpp @@ -27,18 +27,19 @@ Event::~Event() } } -void Event::addResources(std::vector *host_selection) +void Event::add_resources(std::vector* host_selection) { get_resource_selection_by_hosts(this->resource_subsets, host_selection); } -void Event::addCharacteristic(char *characteristic) +void Event::add_characteristic(char* characteristic) { xbt_assert( characteristic != nullptr ); this->characteristics_list.push_back(characteristic); } -void Event::addInfo(char* key, char *value) { +void Event::add_info(char* key, char* value) +{ xbt_assert((key != nullptr) && value != nullptr); this->info_map.insert({key, value}); } @@ -55,7 +56,7 @@ void Event::print(FILE *jed_file) fprintf(jed_file, " \n"); for (auto const& subset : *this->resource_subsets) { fprintf(jed_file, "