Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add type_container_new to s_type class as method
authorTakishipp <toufik.boubehziz@gmail.com>
Wed, 16 Aug 2017 13:29:49 +0000 (15:29 +0200)
committerTakishipp <toufik.boubehziz@gmail.com>
Wed, 16 Aug 2017 13:29:49 +0000 (15:29 +0200)
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_types.cpp
src/instr/instr_private.h
src/surf/instr_routing.cpp

index d6df4a0..88c9d5d 100644 (file)
@@ -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){
     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{
       }
     }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
     }
   }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){
     }
     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;
     }
     }else{
       newContainer->type = type;
     }
index 12b7eeb..01f0050 100644 (file)
@@ -104,7 +104,7 @@ type_t s_type::s_type_get_or_null (const char *name, type_t father)
   return ret;
 }
 
   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");
 {
   if (name == nullptr){
     THROWF (tracing_error, 0, "can't create a container type with a nullptr name");
index be4255d..af35950 100644 (file)
@@ -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);
   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 ();
 /* 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);
 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);
index 28e55d9..26674ff 100644 (file)
@@ -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){
     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);
         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){
   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);
     }
   }
       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){
   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);
       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){
   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);
       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);