From: Takishipp Date: Wed, 16 Aug 2017 13:29:49 +0000 (+0200) Subject: Add type_container_new to s_type class as method X-Git-Tag: v3_17~203^2^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/830fa48c41fe9e077b49bae4a506397c96830505 Add type_container_new to s_type class as method --- diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index d6df4a0f7a..88c9d5ded0 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -90,10 +90,10 @@ container_t PJ_container_new (const char *name, e_container_types kind, containe if (newContainer->father){ newContainer->type = s_type::s_type_get_or_null (as_typename, newContainer->father->type); if (newContainer->type == nullptr){ - newContainer->type = PJ_type_container_new (as_typename, newContainer->father->type); + newContainer->type = s_type::s_type_container_new (as_typename, newContainer->father->type); } }else{ - newContainer->type = PJ_type_container_new ("0", nullptr); + newContainer->type = s_type::s_type_container_new ("0", nullptr); } }else{ //otherwise, the name is its kind @@ -126,7 +126,7 @@ container_t PJ_container_new (const char *name, e_container_types kind, containe } type_t type = s_type::s_type_get_or_null (typeNameBuff, newContainer->father->type); if (type == nullptr){ - newContainer->type = PJ_type_container_new (typeNameBuff, newContainer->father->type); + newContainer->type = s_type::s_type_container_new (typeNameBuff, newContainer->father->type); }else{ newContainer->type = type; } diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 12b7eeb46c..01f0050efd 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -104,7 +104,7 @@ type_t s_type::s_type_get_or_null (const char *name, type_t father) return ret; } -type_t PJ_type_container_new (const char *name, type_t father) +type_t s_type::s_type_container_new (const char *name, type_t father) { if (name == nullptr){ THROWF (tracing_error, 0, "can't create a container type with a nullptr name"); diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index be4255d52f..af3595008e 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -75,6 +75,7 @@ class s_type : public ess_type { xbt_dict_t values; //valid for all types except variable and container s_type (const char *typeNameBuff, const char *key, const char *color, e_entity_types kind, type_t father); static type_t s_type_get_or_null (const char *name, type_t father); + static type_t s_type_container_new (const char *name, type_t father); }; //-------------------------------------------------- @@ -344,7 +345,6 @@ XBT_PUBLIC(void) PJ_container_remove_from_parent (container_t container); /* instr_paje_types.c */ XBT_PRIVATE void PJ_type_release (); XBT_PUBLIC(type_t) PJ_type_get_root (); -XBT_PRIVATE type_t PJ_type_container_new (const char *name, type_t father); XBT_PRIVATE type_t PJ_type_event_new (const char *name, type_t father); type_t PJ_type_link_new (const char *name, type_t father, type_t source, type_t dest); XBT_PRIVATE XBT_PRIVATE type_t PJ_type_variable_new (const char *name, const char *color, type_t father); diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 28e55d928d..26674ffb2f 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -175,7 +175,7 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone) if (TRACE_smpi_is_enabled()) { type_t mpi = s_type::s_type_get_or_null ("MPI", root->type); if (mpi == nullptr){ - mpi = PJ_type_container_new("MPI", root->type); + mpi = s_type::s_type_container_new("MPI", root->type); if (not TRACE_smpi_is_grouped()) PJ_type_state_new ("MPI_STATE", mpi); PJ_type_link_new ("MPI_LINK", PJ_type_get_root(), mpi, mpi); @@ -257,7 +257,7 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){ type_t mpi = s_type::s_type_get_or_null ("MPI", container->type); if (mpi == nullptr){ - mpi = PJ_type_container_new("MPI", container->type); + mpi = s_type::s_type_container_new("MPI", container->type); PJ_type_state_new ("MPI_STATE", mpi); } } @@ -265,7 +265,7 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (TRACE_msg_process_is_enabled()) { type_t msg_process = s_type::s_type_get_or_null ("MSG_PROCESS", container->type); if (msg_process == nullptr){ - msg_process = PJ_type_container_new("MSG_PROCESS", container->type); + msg_process = s_type::s_type_container_new("MSG_PROCESS", container->type); type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process); value PJ_value("suspend", "1 0 1", state); value::get_or_new("sleep", "1 1 0", state); @@ -280,7 +280,7 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (TRACE_msg_vm_is_enabled()) { type_t msg_vm = s_type::s_type_get_or_null ("MSG_VM", container->type); if (msg_vm == nullptr){ - msg_vm = PJ_type_container_new("MSG_VM", container->type); + msg_vm = s_type::s_type_container_new("MSG_VM", container->type); type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm); value PJ_value("suspend", "1 0 1", state); value::get_or_new("sleep", "1 1 0", state);