From: Martin Quinson Date: Sun, 5 Nov 2017 00:25:44 +0000 (+0100) Subject: change src/include/surf.h into surf.hpp X-Git-Tag: v3.18~285 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/72bcdd6c079bd27b3e4e1e5a5552ca97a4f2bf19?hp=21a30b8c98ca9b36834ce3716a06addd9a964a7a change src/include/surf.h into surf.hpp --- diff --git a/src/include/surf/maxmin.hpp b/src/include/surf/maxmin.hpp index e0dd9d7ccf..bdf2977e50 100644 --- a/src/include/surf/maxmin.hpp +++ b/src/include/surf/maxmin.hpp @@ -7,7 +7,7 @@ #define SURF_MAXMIN_HPP #include "src/internal_config.h" -#include "surf/surf.h" +#include "surf/surf.hpp" #include "xbt/asserts.h" #include "xbt/misc.h" #include diff --git a/src/include/surf/surf.h b/src/include/surf/surf.hpp similarity index 90% rename from src/include/surf/surf.h rename to src/include/surf/surf.hpp index 9fc3d95b67..3214e60756 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.hpp @@ -6,23 +6,21 @@ #ifndef SURF_SURF_H #define SURF_SURF_H -#include "xbt/swag.h" -#include "xbt/dynar.h" +#include "simgrid/datatypes.h" +#include "simgrid/forward.h" +#include "src/internal_config.h" +#include "surf/datatypes.h" +#include "xbt/config.h" #include "xbt/dict.h" +#include "xbt/dynar.h" #include "xbt/graph.h" #include "xbt/misc.h" -#include "xbt/config.h" -#include "src/internal_config.h" -#include "surf/datatypes.h" -#include "simgrid/datatypes.h" -#include "simgrid/forward.h" +#include "xbt/swag.h" #ifndef __cplusplus #error This is a C++ only file, now #endif -#ifdef __cplusplus - namespace simgrid { namespace surf { class Model; @@ -35,46 +33,17 @@ class Action; } } -typedef simgrid::surf::Model surf_Model; -typedef simgrid::surf::CpuModel surf_CpuModel; -typedef simgrid::surf::HostModel surf_HostModel; -typedef simgrid::surf::NetworkModel surf_NetworkModel; -typedef simgrid::surf::StorageModel surf_StorageModel; -typedef simgrid::surf::Action surf_Action; - -#else - -typedef struct surf_Model surf_Model; -typedef struct surf_CpuModel surf_CpuModel; -typedef struct surf_HostModel surf_HostModel; -typedef struct surf_NetworkModel surf_NetworkModel; -typedef struct surf_StorageModel surf_StorageModel; -typedef struct surf_Action surf_Action; - -#endif - -SG_BEGIN_DECL() -/* Actions and models are highly connected structures... */ - -/* user-visible parameters */ -extern XBT_PRIVATE double sg_tcp_gamma; -extern XBT_PRIVATE double sg_latency_factor; -extern XBT_PRIVATE double sg_bandwidth_factor; -extern XBT_PRIVATE double sg_weight_S_parameter; -extern XBT_PRIVATE int sg_network_crosstraffic; - /** @ingroup SURF_c_bindings * \brief Model datatype * * Generic data structure for a model. The hosts, * the CPUs and the network links are examples of models. */ -typedef surf_Model *surf_model_t; -typedef surf_CpuModel *surf_cpu_model_t; -typedef surf_HostModel *surf_host_model_t; -typedef surf_NetworkModel *surf_network_model_t; -typedef surf_StorageModel *surf_storage_model_t; - +typedef simgrid::surf::Model* surf_model_t; +typedef simgrid::surf::CpuModel* surf_cpu_model_t; +typedef simgrid::surf::HostModel* surf_host_model_t; +typedef simgrid::surf::NetworkModel* surf_network_model_t; +typedef simgrid::surf::StorageModel* surf_storage_model_t; /** @ingroup SURF_c_bindings * \brief Action structure * @@ -83,22 +52,29 @@ typedef surf_StorageModel *surf_storage_model_t; * * \see e_surf_action_state_t */ -typedef surf_Action *surf_action_t; +typedef simgrid::surf::Action* surf_action_t; +SG_BEGIN_DECL() +/* Actions and models are highly connected structures... */ + +/* user-visible parameters */ +extern XBT_PRIVATE double sg_tcp_gamma; +extern XBT_PRIVATE double sg_latency_factor; +extern XBT_PRIVATE double sg_bandwidth_factor; +extern XBT_PRIVATE double sg_weight_S_parameter; +extern XBT_PRIVATE int sg_network_crosstraffic; /** \brief Resource model description */ struct surf_model_description { - const char *name; - const char *description; + const char* name; + const char* description; void_f_void_t model_init_preparse; }; typedef struct surf_model_description s_surf_model_description_t; -#ifdef __cplusplus XBT_PUBLIC(int) find_model_description(s_surf_model_description_t* table, std::string name); -#endif -XBT_PUBLIC(void) model_help(const char *category, s_surf_model_description_t * table); +XBT_PUBLIC(void) model_help(const char* category, s_surf_model_description_t* table); /***************************/ /* Generic model object */ @@ -163,7 +139,6 @@ XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model_pm; */ XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model_vm; - /** \ingroup SURF_models * \brief Initializes the CPU model with the model Cas01 * @@ -383,7 +358,7 @@ XBT_PUBLIC(void) surf_vm_model_init_HL13(); * * \see surf_host_model_init_CM02(), surf_host_model_init_compound(), surf_exit() */ -XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */ +XBT_PUBLIC(void) surf_init(int* argc, char** argv); /* initialize common structures */ /** \ingroup SURF_simulation * \brief Finish simulation initialization @@ -421,17 +396,17 @@ XBT_PUBLIC(double) surf_get_clock(); XBT_PUBLIC(void) surf_exit(); /* surf parse file related (public because called from a test suite) */ -XBT_PUBLIC(void) parse_platform_file(const char *file); +XBT_PUBLIC(void) parse_platform_file(const char* file); /********** Tracing **********/ /* from surf_instr.c */ -void TRACE_surf_action(surf_action_t surf_action, const char *category); +void TRACE_surf_action(surf_action_t surf_action, const char* category); /* instr_routing.c */ -void instr_routing_define_callbacks (); -int instr_platform_traced (); -xbt_graph_t instr_routing_platform_graph (); -void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename); +void instr_routing_define_callbacks(); +int instr_platform_traced(); +xbt_graph_t instr_routing_platform_graph(); +void instr_routing_platform_graph_export_graphviz(xbt_graph_t g, const char* filename); SG_END_DECL() diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index 41b7c85897..486b5649f5 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -5,7 +5,7 @@ #include "include/xbt/config.hpp" #include "src/instr/instr_private.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include #include diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 432d0ef954..8053955ed7 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -9,7 +9,7 @@ #include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/surf_private.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include enum InstrUserVariable { INSTR_US_DECLARE, INSTR_US_SET, INSTR_US_ADD, INSTR_US_SUB }; diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index 2eecc69263..8480bb97b0 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -7,7 +7,7 @@ #define SIMIX_SYNCHRO_COMM_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" enum e_smx_comm_type_t { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE }; diff --git a/src/kernel/activity/ExecImpl.hpp b/src/kernel/activity/ExecImpl.hpp index 8012e39df0..2fe76ae4c3 100644 --- a/src/kernel/activity/ExecImpl.hpp +++ b/src/kernel/activity/ExecImpl.hpp @@ -7,7 +7,7 @@ #define SIMIX_SYNCHRO_EXEC_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" namespace simgrid { namespace kernel { diff --git a/src/kernel/activity/SleepImpl.hpp b/src/kernel/activity/SleepImpl.hpp index a149ce5c36..5441f6145e 100644 --- a/src/kernel/activity/SleepImpl.hpp +++ b/src/kernel/activity/SleepImpl.hpp @@ -7,7 +7,7 @@ #define SIMIX_SYNCHRO_SLEEP_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" namespace simgrid { namespace kernel { diff --git a/src/kernel/activity/SynchroIo.hpp b/src/kernel/activity/SynchroIo.hpp index 2b6ab93a14..f827ac6017 100644 --- a/src/kernel/activity/SynchroIo.hpp +++ b/src/kernel/activity/SynchroIo.hpp @@ -6,8 +6,8 @@ #ifndef SIMIX_SYNCHRO_IO_HPP #define SIMIX_SYNCHRO_IO_HPP -#include "surf/surf.h" #include "src/kernel/activity/ActivityImpl.hpp" +#include "surf/surf.hpp" namespace simgrid { namespace kernel { diff --git a/src/kernel/activity/SynchroRaw.hpp b/src/kernel/activity/SynchroRaw.hpp index f5ef90d2fc..d416f90dd0 100644 --- a/src/kernel/activity/SynchroRaw.hpp +++ b/src/kernel/activity/SynchroRaw.hpp @@ -6,8 +6,8 @@ #ifndef SIMIX_SYNCHRO_RAW_HPP #define SIMIX_SYNCHRO_RAW_HPP -#include "surf/surf.h" #include "src/kernel/activity/ActivityImpl.hpp" +#include "surf/surf.hpp" namespace simgrid { namespace kernel { diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index c467f05245..7b53ca9556 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -21,7 +21,7 @@ #include "src/simix/smx_io_private.hpp" #include "src/simix/smx_network_private.hpp" #include "src/simix/smx_synchro_private.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include "xbt/base.h" #include "xbt/config.h" #include "xbt/function_types.h" diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 39e5922c4e..c16b189cf7 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -17,7 +17,7 @@ #include "src/kernel/routing/NetPoint.hpp" #include "src/kernel/routing/NetZoneImpl.hpp" #include "src/surf/network_interface.hpp" -#include "surf/surf.h" // routing_platf. FIXME:KILLME. SOON +#include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON XBT_LOG_NEW_CATEGORY(s4u,"Log channels of the S4U (Simgrid for you) interface"); diff --git a/src/simdag/simdag_private.hpp b/src/simdag/simdag_private.hpp index 6b14965fc2..13d55f49f4 100644 --- a/src/simdag/simdag_private.hpp +++ b/src/simdag/simdag_private.hpp @@ -4,11 +4,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/simdag.h" +#include "surf/surf.hpp" #include #include #include -#include "simgrid/simdag.h" -#include "surf/surf.h" #ifndef SIMDAG_PRIVATE_HPP #define SIMDAG_PRIVATE_HPP diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index c8a657913d..9158528f5a 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -15,7 +15,7 @@ #include "src/mc/mc_replay.h" #include "src/surf/surf_interface.hpp" #include "surf/maxmin.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include "xbt/config.h" #include "xbt/config.hpp" #include "xbt/log.h" diff --git a/src/simix/smx_io.cpp b/src/simix/smx_io.cpp index 90c7f88dc1..dc044778f3 100644 --- a/src/simix/smx_io.cpp +++ b/src/simix/smx_io.cpp @@ -12,7 +12,7 @@ #include "src/surf/FileImpl.hpp" #include "src/surf/HostImpl.hpp" #include "src/surf/StorageImpl.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include "smx_private.hpp" #include "src/surf/surf_interface.hpp" diff --git a/src/surf/FileImpl.hpp b/src/surf/FileImpl.hpp index 94337fed3a..acb8f27bd5 100644 --- a/src/surf/FileImpl.hpp +++ b/src/surf/FileImpl.hpp @@ -7,7 +7,7 @@ #ifndef SRC_SURF_FILEIMPL_HPP_ #define SRC_SURF_FILEIMPL_HPP_ -#include "surf/surf.h" +#include "surf/surf.hpp" #include namespace simgrid { diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index b5d1eb8281..6a271cdf5f 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -7,11 +7,11 @@ #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" -#include "src/kernel/routing/NetZoneImpl.hpp" #include "src/kernel/routing/NetPoint.hpp" +#include "src/kernel/routing/NetZoneImpl.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/xml/platf_private.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include "xbt/graph.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy"); diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index 32e6ec3a80..5cad6feeae 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -9,7 +9,7 @@ #include "xbt/signal.hpp" #include "src/surf/surf_private.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #include "xbt/str.h" #include diff --git a/src/surf/surf_private.hpp b/src/surf/surf_private.hpp index 33181250e1..55a7e4f17e 100644 --- a/src/surf/surf_private.hpp +++ b/src/surf/surf_private.hpp @@ -8,7 +8,7 @@ #include "src/surf/trace_mgr.hpp" #include "surf/maxmin.hpp" -#include "surf/surf.h" +#include "surf/surf.hpp" #define NO_MAX_DURATION -1.0