From: Martin Quinson Date: Sat, 25 Aug 2018 08:22:28 +0000 (+0200) Subject: Rename simgrid::exception into simgrid::Exception X-Git-Tag: v3_21~179 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/32892d0df7206a7c14ace5a13f985df1e0a9249a Rename simgrid::exception into simgrid::Exception Also move simgrid/exception.hpp to simgrid/Exception.hpp (our coding standards say that files defining a class must have their name upper-cased as the class) --- diff --git a/include/simgrid/exception.hpp b/include/simgrid/Exception.hpp similarity index 77% rename from include/simgrid/exception.hpp rename to include/simgrid/Exception.hpp index f363a2ee47..66c12def16 100644 --- a/include/simgrid/exception.hpp +++ b/include/simgrid/Exception.hpp @@ -12,7 +12,6 @@ */ #include -#include #include #include @@ -21,26 +20,26 @@ namespace simgrid { /** Ancestor class of all SimGrid exception */ -class exception : public std::runtime_error { +class Exception : public std::runtime_error { public: - exception() : std::runtime_error("") {} - exception(const char* message) : std::runtime_error(message) {} + Exception() : std::runtime_error("") {} + Exception(const char* message) : std::runtime_error(message) {} }; /** Exception raised when a timeout elapsed */ -class timeout_error : public simgrid::exception { +class timeout_error : public simgrid::Exception { }; /** Exception raised when an host fails */ -class host_failure : public simgrid::exception { +class host_failure : public simgrid::Exception { }; /** Exception raised when a communication fails because of the network */ -class network_failure : public simgrid::exception { +class network_failure : public simgrid::Exception { }; /** Exception raised when something got canceled before completion */ -class canceled_error : public simgrid::exception { +class canceled_error : public simgrid::Exception { }; } // namespace simgrid @@ -58,9 +57,9 @@ class canceled_error : public simgrid::exception { * * @ingroup XBT_ex_c */ -class XBT_PUBLIC xbt_ex : public simgrid::exception, public simgrid::xbt::ContextedException { +class XBT_PUBLIC xbt_ex : public simgrid::Exception, public simgrid::xbt::ContextedException { public: - xbt_ex() : simgrid::exception() {} + xbt_ex() : simgrid::Exception() {} /** * @@ -68,7 +67,7 @@ public: * @param message Exception message */ xbt_ex(simgrid::xbt::ThrowPoint throwpoint, const char* message) - : simgrid::exception(message), simgrid::xbt::ContextedException(throwpoint, simgrid::xbt::backtrace()) + : simgrid::Exception(message), simgrid::xbt::ContextedException(throwpoint, simgrid::xbt::backtrace()) { } diff --git a/include/simgrid/s4u.hpp b/include/simgrid/s4u.hpp index 42a72bf338..485ed2d433 100644 --- a/include/simgrid/s4u.hpp +++ b/include/simgrid/s4u.hpp @@ -20,6 +20,6 @@ #include #include -#include +#include #endif /* SIMGRID_S4U_S4U_H */ diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp index 3cf242239b..70c706906b 100644 --- a/src/bindings/java/JavaContext.cpp +++ b/src/bindings/java/JavaContext.cpp @@ -7,7 +7,7 @@ #include "JavaContext.hpp" #include "jxbt_utilities.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/simix/smx_private.hpp" #include diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index a6db169e1f..bb621d88ed 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -9,6 +9,7 @@ #include #include +#include "simgrid/Exception.hpp" #include "simgrid/msg.h" #include "simgrid/plugins/energy.h" #include "simgrid/plugins/file_system.h" @@ -29,7 +30,6 @@ #include "JavaContext.hpp" -#include "simgrid/exception.hpp" /* Shut up some errors in eclipse online compiler. I wish such a pimple wouldn't be needed */ #ifndef JNIEXPORT diff --git a/src/bindings/java/jmsg_process.cpp b/src/bindings/java/jmsg_process.cpp index fc5444c039..f914fc859c 100644 --- a/src/bindings/java/jmsg_process.cpp +++ b/src/bindings/java/jmsg_process.cpp @@ -5,14 +5,13 @@ /* 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. */ -#include "simgrid/exception.hpp" - #include "jmsg_process.h" #include "JavaContext.hpp" #include "jmsg.hpp" #include "jmsg_host.h" #include "jxbt_utilities.hpp" +#include "simgrid/Exception.hpp" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java); diff --git a/src/bindings/java/jmsg_synchro.cpp b/src/bindings/java/jmsg_synchro.cpp index b8afdeca40..e79910ce4b 100644 --- a/src/bindings/java/jmsg_synchro.cpp +++ b/src/bindings/java/jmsg_synchro.cpp @@ -5,11 +5,10 @@ /* 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. */ -#include "simgrid/exception.hpp" - -#include "jmsg.hpp" #include "jmsg_synchro.h" +#include "jmsg.hpp" #include "jxbt_utilities.hpp" +#include "simgrid/Exception.hpp" #include "xbt/synchro.h" XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java); diff --git a/src/bindings/java/jmsg_synchro.h b/src/bindings/java/jmsg_synchro.h index 7eb08120a9..16bff6523f 100644 --- a/src/bindings/java/jmsg_synchro.h +++ b/src/bindings/java/jmsg_synchro.h @@ -8,6 +8,7 @@ #ifndef MSG_JSYNCHRO_H #define MSG_JSYNCHRO_H +#include "xbt/base.h" #include SG_BEGIN_DECL() diff --git a/src/bindings/java/jmsg_vm.cpp b/src/bindings/java/jmsg_vm.cpp index fb3bfbb001..9b04afbb90 100644 --- a/src/bindings/java/jmsg_vm.cpp +++ b/src/bindings/java/jmsg_vm.cpp @@ -8,7 +8,7 @@ #include "jmsg_vm.h" #include "jmsg_host.h" #include "jxbt_utilities.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/plugins/live_migration.h" #include "src/plugins/vm/VirtualMachineImpl.hpp" diff --git a/src/kernel/activity/ConditionVariableImpl.cpp b/src/kernel/activity/ConditionVariableImpl.cpp index 20412aa8fa..12f2e0255e 100644 --- a/src/kernel/activity/ConditionVariableImpl.cpp +++ b/src/kernel/activity/ConditionVariableImpl.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/activity/ConditionVariableImpl.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/kernel/activity/MutexImpl.hpp" #include "src/kernel/activity/SynchroRaw.hpp" #include "src/simix/smx_synchro_private.hpp" diff --git a/src/kernel/activity/SleepImpl.cpp b/src/kernel/activity/SleepImpl.cpp index 38d4cb38b3..4d807ccc96 100644 --- a/src/kernel/activity/SleepImpl.cpp +++ b/src/kernel/activity/SleepImpl.cpp @@ -9,7 +9,7 @@ #include "src/kernel/activity/SleepImpl.hpp" #include "src/kernel/context/Context.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/simix/ActorImpl.hpp" #include "src/simix/popping_private.hpp" #include "src/simix/smx_private.hpp" diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index b32a3a6b8b..9b434b404b 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -3,7 +3,7 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/s4u/Mailbox.hpp" #include "src/instr/instr_private.hpp" diff --git a/src/msg/msg_synchro.cpp b/src/msg/msg_synchro.cpp index 9bd5a7d997..c24469b2ba 100644 --- a/src/msg/msg_synchro.cpp +++ b/src/msg/msg_synchro.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "msg_private.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/simix/smx_private.hpp" #include "src/simix/smx_synchro_private.hpp" #include "xbt/synchro.h" diff --git a/src/plugins/vm/VmLiveMigration.cpp b/src/plugins/vm/VmLiveMigration.cpp index a9a3fd64c9..74a45e8796 100644 --- a/src/plugins/vm/VmLiveMigration.cpp +++ b/src/plugins/vm/VmLiveMigration.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/plugins/vm/VmLiveMigration.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/instr/instr_private.hpp" #include "src/plugins/vm/VirtualMachineImpl.hpp" #include "src/plugins/vm/VmHostExt.hpp" diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index f7dad67557..2f2b67c3d7 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "mc/mc.h" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "smx_private.hpp" #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/activity/ExecImpl.hpp" diff --git a/src/simix/smx_deployment.cpp b/src/simix/smx_deployment.cpp index 96f1fb7f3c..b549d91ae3 100644 --- a/src/simix/smx_deployment.cpp +++ b/src/simix/smx_deployment.cpp @@ -3,11 +3,11 @@ /* 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. */ +#include "simgrid/Exception.hpp" #include "simgrid/s4u/Host.hpp" #include "smx_private.hpp" #include "src/surf/xml/platf_private.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here #include -#include #include #include diff --git a/src/simix/smx_environment.cpp b/src/simix/smx_environment.cpp index 1537e9915b..70150a9a72 100644 --- a/src/simix/smx_environment.cpp +++ b/src/simix/smx_environment.cpp @@ -7,8 +7,8 @@ #include "src/include/surf/surf.hpp" #include "xbt/xbt_os_time.h" +#include #include -#include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_environment, simix, "Logging specific to SIMIX (environment)"); diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index eac34bf8f1..1e90d37302 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "mc/mc.h" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "smx_private.hpp" #include "src/kernel/activity/CommImpl.hpp" #include "src/kernel/activity/ExecImpl.hpp" diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index af80dc9843..c4e8562593 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "mc/mc.h" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/s4u/Host.hpp" #include "simgrid/s4u/Io.hpp" diff --git a/src/simix/smx_network.cpp b/src/simix/smx_network.cpp index fbcea719ff..c7afaa8e1d 100644 --- a/src/simix/smx_network.cpp +++ b/src/simix/smx_network.cpp @@ -4,7 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "mc/mc.h" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/kernel/activity/MailboxImpl.hpp" #include "src/mc/mc_replay.hpp" #include "src/simix/smx_private.hpp" diff --git a/src/smpi/mpi/smpi_info.cpp b/src/smpi/mpi/smpi_info.cpp index 16b8c5355b..0b64447dad 100644 --- a/src/smpi/mpi/smpi_info.cpp +++ b/src/smpi/mpi/smpi_info.cpp @@ -1,15 +1,13 @@ -/* Copyright (c) 2007-2018. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2007-2018. 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. */ #include "smpi_info.hpp" -#include "simgrid/exception.hpp" -#include "xbt/sysdep.h" +#include "simgrid/Exception.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid { +namespace smpi { Info::Info(Info* info) : map_(info->map_) { diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index 16b0dd5f3f..ebd900a46b 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -7,7 +7,7 @@ #include "mc/mc.h" #include "private.hpp" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/s4u/Exec.hpp" #include "smpi_comm.hpp" #include "smpi_datatype.hpp" @@ -21,7 +21,7 @@ #include -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_request, smpi, "Logging specific to SMPI (reques)"); +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_request, smpi, "Logging specific to SMPI (request)"); static simgrid::config::Flag smpi_iprobe_sleep( "smpi/iprobe", "Minimum time to inject inside a call to MPI_Iprobe", 1e-4); diff --git a/src/xbt/config.cpp b/src/xbt/config.cpp index b69e80f08c..b31d8fbd0c 100644 --- a/src/xbt/config.cpp +++ b/src/xbt/config.cpp @@ -19,7 +19,7 @@ #include #include -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/sg_config.hpp" #include "xbt/dynar.h" #include "xbt/log.h" @@ -719,7 +719,7 @@ int xbt_cfg_get_boolean(const char *key) #include -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "xbt.h" #include "xbt/ex.h" diff --git a/src/xbt/cunit.cpp b/src/xbt/cunit.cpp index 4a4fd78776..a3a625fda7 100644 --- a/src/xbt/cunit.cpp +++ b/src/xbt/cunit.cpp @@ -14,7 +14,7 @@ #include #include -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include #include diff --git a/src/xbt/dict.cpp b/src/xbt/dict.cpp index 1a6b61e5b2..be4dd59a81 100644 --- a/src/xbt/dict.cpp +++ b/src/xbt/dict.cpp @@ -7,7 +7,7 @@ #include "xbt/dict.h" #include "dict_private.h" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/xbt_modinter.h" #include "xbt/ex.h" #include "xbt/log.h" @@ -454,7 +454,7 @@ void xbt_dict_postexit() } #ifdef SIMGRID_TEST -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "src/internal_config.h" #include "xbt.h" #include "xbt/ex.h" diff --git a/src/xbt/dynar.cpp b/src/xbt/dynar.cpp index e1444f01f1..c2dd5f03ac 100644 --- a/src/xbt/dynar.cpp +++ b/src/xbt/dynar.cpp @@ -7,7 +7,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/dynar.h" -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "xbt/ex.h" #include "xbt/log.h" #include "xbt/misc.h" diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index b9503b69ef..964590f84c 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -13,7 +13,7 @@ #include #include -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include #include #include diff --git a/src/xbt/xbt_os_synchro.cpp b/src/xbt/xbt_os_synchro.cpp index d1d8b0a559..d8544dc945 100644 --- a/src/xbt/xbt_os_synchro.cpp +++ b/src/xbt/xbt_os_synchro.cpp @@ -6,7 +6,7 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/simix.h" /* used implementation */ #include "src/kernel/activity/ConditionVariableImpl.hpp" #include "xbt/synchro.h" diff --git a/src/xbt/xbt_replay.cpp b/src/xbt/xbt_replay.cpp index 3a876d0745..7ee69817d6 100644 --- a/src/xbt/xbt_replay.cpp +++ b/src/xbt/xbt_replay.cpp @@ -3,7 +3,7 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "xbt/log.h" #include "xbt/replay.hpp" diff --git a/src/xbt/xbt_str.cpp b/src/xbt/xbt_str.cpp index b5300552bf..bd3972916a 100644 --- a/src/xbt/xbt_str.cpp +++ b/src/xbt/xbt_str.cpp @@ -5,10 +5,9 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "xbt/misc.h" #include "xbt/str.h" /* headers of these functions */ -#include "xbt/sysdep.h" /** @brief Splits a string into a dynar of strings * @@ -263,7 +262,7 @@ double xbt_str_parse_double(const char* str, const char* error_msg) } #ifdef SIMGRID_TEST -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "xbt/str.h" XBT_TEST_SUITE("xbt_str", "String Handling"); diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp b/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp index 278c10317b..fb7751daa2 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.cpp @@ -3,7 +3,7 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/msg.h" #include /* sscanf */ diff --git a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp index a7659a9279..54f8831d75 100644 --- a/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp +++ b/teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp @@ -3,7 +3,7 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); diff --git a/teshsuite/msg/task_progress/task_progress.cpp b/teshsuite/msg/task_progress/task_progress.cpp index 0596850970..841fb3db66 100644 --- a/teshsuite/msg/task_progress/task_progress.cpp +++ b/teshsuite/msg/task_progress/task_progress.cpp @@ -3,7 +3,7 @@ /* 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. */ -#include "simgrid/exception.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); diff --git a/teshsuite/xbt/mmalloc/mmalloc_test.cpp b/teshsuite/xbt/mmalloc/mmalloc_test.cpp index e05d3ff49c..1d2eeae347 100644 --- a/teshsuite/xbt/mmalloc/mmalloc_test.cpp +++ b/teshsuite/xbt/mmalloc/mmalloc_test.cpp @@ -3,8 +3,10 @@ /* 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. */ -#include "xbt/mmalloc.h" +#include "simgrid/Exception.hpp" #include "xbt.h" +#include "xbt/mmalloc.h" + #include #include #include @@ -13,8 +15,6 @@ #include #include -#include - XBT_LOG_NEW_DEFAULT_CATEGORY(test,"this test"); #define BUFFSIZE 204800 diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index d674ddc7a7..7467088055 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -669,7 +669,7 @@ set(headers_to_install include/simgrid/actor.h include/simgrid/barrier.h include/simgrid/engine.h - include/simgrid/exception.hpp + include/simgrid/Exception.hpp include/simgrid/chrono.hpp include/simgrid/plugins/dvfs.h include/simgrid/plugins/energy.h