Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #215 from Takishipp/s_type_cleanup
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 27 Aug 2017 22:22:02 +0000 (00:22 +0200)
committerGitHub <noreply@github.com>
Sun, 27 Aug 2017 22:22:02 +0000 (00:22 +0200)
s_type cleanup

1  2 
src/instr/instr_config.cpp
src/instr/instr_interface.cpp
src/instr/instr_paje_trace.cpp
src/msg/msg_vm.cpp
src/smpi/internals/instr_smpi.cpp
src/surf/instr_routing.cpp

@@@ -63,7 -63,7 +63,7 @@@ static int trace_precision
  static bool trace_configured = false;
  static bool trace_active     = false;
  
- static type_t rootType = nullptr;        /* the root type */
+ static Type* rootType = nullptr;        /* the root type */
  
  instr_fmt_type_t instr_fmt_type = instr_fmt_paje;
  
@@@ -482,7 -482,7 +482,7 @@@ static void output_categories(const cha
  {
    unsigned int i = created_categories.size();
    fprintf (file, "    values = (");
 -  for (auto cat : created_categories) {
 +  for (auto const& cat : created_categories) {
      --i;
      fprintf(file, "\"%s%s\"", name, cat.c_str());
      if (i > 0) {
@@@ -618,3 -618,21 +618,3 @@@ void instr_resume_tracing (
    XBT_DEBUG ("Tracing is resumed.");
    previous_trace_state = -1;
  }
 -
 -#undef OPT_TRACING
 -#undef OPT_TRACING_PLATFORM
 -#undef OPT_TRACING_TOPOLOGY
 -#undef OPT_TRACING_SMPI
 -#undef OPT_TRACING_SMPI_GROUP
 -#undef OPT_TRACING_CATEGORIZED
 -#undef OPT_TRACING_UNCATEGORIZED
 -#undef OPT_TRACING_MSG_PROCESS
 -#undef OPT_TRACING_FILENAME
 -#undef OPT_TRACING_BUFFER
 -#undef OPT_TRACING_ONELINK_ONLY
 -#undef OPT_TRACING_DISABLE_DESTROY
 -#undef OPT_TRACING_BASIC
 -#undef OPT_TRACING_COMMENT
 -#undef OPT_TRACING_COMMENT_FILE
 -#undef OPT_VIVA_UNCAT_CONF
 -#undef OPT_VIVA_CAT_CONF
@@@ -35,7 -35,7 +35,7 @@@ static xbt_dynar_t instr_set_to_dynar(s
      return nullptr;
  
    xbt_dynar_t ret = xbt_dynar_new (sizeof(char*), &xbt_free_ref);
 -  for (auto name : *filter)
 +  for (auto const& name : *filter)
      xbt_dynar_push_as(ret, char*, xbt_strdup(name.c_str()));
  
    return ret;
@@@ -153,7 -153,7 +153,7 @@@ void TRACE_declare_mark(const char *mar
    }
  
    XBT_DEBUG("MARK,declare %s", mark_type);
-   PJ_type_event_new(mark_type, PJ_type_get_root());
+   Type::eventNew(mark_type, PJ_type_get_root());
    declared_marks.insert(mark_type);
  }
  
@@@ -183,7 -183,7 +183,7 @@@ void TRACE_declare_mark_value_with_colo
    if (not mark_value)
      THROWF (tracing_error, 1, "mark_value is nullptr");
  
-   type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+   Type* type = PJ_type_get (mark_type, PJ_type_get_root());
    if (not type) {
      THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
    }
@@@ -239,7 -239,7 +239,7 @@@ void TRACE_mark(const char *mark_type, 
      THROWF (tracing_error, 1, "mark_value is nullptr");
  
    //check if mark_type is already declared
-   type_t type = PJ_type_get (mark_type, PJ_type_get_root());
+   Type* type = PJ_type_get (mark_type, PJ_type_get_root());
    if (not type) {
      THROWF (tracing_error, 1, "mark_type with name (%s) is not declared", mark_type);
    }
@@@ -282,7 -282,7 +282,7 @@@ static void instr_user_variable(double 
        char valuestr[100];
        snprintf(valuestr, 100, "%g", value);
        container_t container = PJ_container_get(resource);
-       type_t type = PJ_type_get (variable, container->type);
+       Type* type = PJ_type_get (variable, container->type);
        switch (what){
        case INSTR_US_SET:
          new SetVariableEvent(time, container, type, value);
@@@ -314,7 -314,7 +314,7 @@@ static void instr_user_srcdst_variable(
  
    std::vector<simgrid::surf::LinkImpl*> route;
    simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, &route, nullptr);
 -  for (auto link : route)
 +  for (auto const& link : route)
      instr_user_variable(time, link->cname(), variable, father_type, value, what, nullptr, &user_link_variables);
  }
  
@@@ -945,7 -945,7 +945,7 @@@ void TRACE_host_state_declare_value (co
  void TRACE_host_set_state(const char* host, const char* state, const char* value_str)
  {
    container_t container = PJ_container_get(host);
-   type_t type = PJ_type_get (state, container->type);
+   Type* type = PJ_type_get (state, container->type);
    value* val =
        value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
    new SetStateEvent(MSG_get_clock(), container, type, val);
  void TRACE_host_push_state(const char* host, const char* state, const char* value_str)
  {
    container_t container = PJ_container_get(host);
-   type_t type = PJ_type_get (state, container->type);
+   Type* type = PJ_type_get (state, container->type);
    value* val =
        value::get_or_new(value_str, nullptr, type); /* if user didn't declare a value with a color, use nullptr color */
    new PushStateEvent(MSG_get_clock(), container, type, val);
  void TRACE_host_pop_state (const char *host, const char *state)
  {
    container_t container = PJ_container_get(host);
-   type_t type = PJ_type_get (state, container->type);
+   Type* type = PJ_type_get (state, container->type);
    new PopStateEvent(MSG_get_clock(), container, type);
  }
  
@@@ -68,14 -68,14 +68,14 @@@ void TRACE_paje_dump_buffer (int force
      return;
    XBT_DEBUG("%s: dump until %f. starts", __FUNCTION__, TRACE_last_timestamp_to_dump);
    if (force){
 -    for (auto event : buffer){
 +    for (auto const& event : buffer) {
        event->print();
        delete event;
      }
      buffer.clear();
    }else{
      std::vector<PajeEvent*>::iterator i = buffer.begin();
 -    for (auto event :buffer){
 +    for (auto const& event : buffer) {
        double head_timestamp = event->timestamp;
        if (head_timestamp > TRACE_last_timestamp_to_dump)
          break;
@@@ -92,7 -92,7 +92,7 @@@ void buffer_debug(std::vector<PajeEvent
  void buffer_debug(std::vector<PajeEvent*> *buf) {
    return;
    XBT_DEBUG(">>>>>> Dump the state of the buffer. %zu events", buf->size());
 -  for (auto event :*buf){
 +  for (auto const& event : *buf) {
      event->print();
      XBT_DEBUG("%p %s", event, stream.str().c_str());
      stream.str("");
@@@ -267,7 -267,7 +267,7 @@@ void LogDefineEventType(type_t type
    }
  }
  
- void LogLinkTypeDefinition(type_t type, type_t source, type_t dest)
+ void LogLinkTypeDefinition(type_t type, Type* source, Type* dest)
  {
    XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineLinkType);
    //print it
@@@ -383,7 -383,7 +383,7 @@@ if (instr_fmt_type == instr_fmt_paje) 
  }
  
  
- SetVariableEvent::SetVariableEvent (double timestamp, container_t container, type_t type, double value)
+ SetVariableEvent::SetVariableEvent (double timestamp, container_t container, Type* type, double value)
  {
    this->event_type                         = PAJE_SetVariable;
    this->timestamp                          = timestamp;
@@@ -411,7 -411,7 +411,7 @@@ void SetVariableEvent::print() 
    }
  }
  
- AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value)
+ AddVariableEvent::AddVariableEvent (double timestamp, container_t container, Type* type, double value)
  {
    this->event_type                         = PAJE_AddVariable;
    this->timestamp                          = timestamp;
@@@ -439,7 -439,7 +439,7 @@@ void AddVariableEvent::print() 
    }
  }
  
- SubVariableEvent::SubVariableEvent (double timestamp, container_t container, type_t type, double value)
+ SubVariableEvent::SubVariableEvent (double timestamp, container_t container, Type* type, double value)
  {
    this->event_type                         = PAJE_SubVariable;
    this->timestamp                          = timestamp;
@@@ -467,7 -467,7 +467,7 @@@ void SubVariableEvent::print() 
    }
  }
  
- SetStateEvent::SetStateEvent(double timestamp, container_t container, type_t type, value* val)
+ SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* type, value* val)
  {
    this->event_type                      = PAJE_SetState;
    this->timestamp                       = timestamp;
@@@ -509,7 -509,7 +509,7 @@@ void SetStateEvent::print() 
    }
  }
  
- PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra)
+ PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val, void* extra)
  {
    this->event_type                  = PAJE_PushState;
    this->timestamp                   = timestamp;
    insert_into_buffer (this);
  }
  
- PushStateEvent::PushStateEvent(double timestamp, container_t container, type_t type, value* val)
+ PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val)
      : PushStateEvent(timestamp, container, type, val, nullptr)
  {}
  void PushStateEvent::print() {
  }
  
  
- PopStateEvent::PopStateEvent (double timestamp, container_t container, type_t type)
+ PopStateEvent::PopStateEvent (double timestamp, container_t container, Type* type)
  {
    this->event_type                      = PAJE_PopState;
    this->timestamp                       = timestamp;
@@@ -726,7 -726,7 +726,7 @@@ void PopStateEvent::print() 
    }
  }
  
- ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_t type)
+ ResetStateEvent::ResetStateEvent (double timestamp, container_t container, Type* type)
  {
    this->event_type                        = PAJE_ResetState;
    this->timestamp                         = timestamp;
@@@ -760,11 -760,11 +760,11 @@@ StartLinkEvent::~StartLinkEvent(
    free(key);
  }
  StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
-     type_t type, container_t sourceContainer, const char *value, const char *key)
+     Type* type, container_t sourceContainer, const char *value, const char *key)
    : StartLinkEvent(timestamp, container, type, sourceContainer, value, key, -1)
  {}
  
- StartLinkEvent::StartLinkEvent (double timestamp, container_t container, type_t type, container_t sourceContainer,
+ StartLinkEvent::StartLinkEvent (double timestamp, container_t container, Type* type, container_t sourceContainer,
                                  const char *value, const char *key, int size)
  {
    event_type                             = PAJE_StartLink;
@@@ -802,7 -802,7 +802,7 @@@ void StartLinkEvent::print() 
    }
  }
  
- EndLinkEvent::EndLinkEvent (double timestamp, container_t container, type_t type, container_t destContainer,
+ EndLinkEvent::EndLinkEvent (double timestamp, container_t container, Type* type, container_t destContainer,
                        const char *value, const char *key)
  {
    this->event_type                         = PAJE_EndLink;
@@@ -839,7 -839,7 +839,7 @@@ void EndLinkEvent::print() 
    }
  }
  
- NewEvent::NewEvent(double timestamp, container_t container, type_t type, value* val)
+ NewEvent::NewEvent(double timestamp, container_t container, Type* type, value* val)
  {
    this->event_type                      = PAJE_NewEvent;
    this->timestamp                       = timestamp;
diff --combined src/msg/msg_vm.cpp
@@@ -187,7 -187,7 +187,7 @@@ void MSG_vm_start(msg_vm_t vm
    vm->start();
    if (TRACE_msg_vm_is_enabled()) {
      container_t vm_container = PJ_container_get(vm->getCname());
-     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
+     Type* type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
      value* val               = value::get_or_new("start", "0 0 1", type); // start is blue
      new PushStateEvent(MSG_get_clock(), vm_container, type, val);
    }
@@@ -296,7 -296,7 +296,7 @@@ static int migration_rx_fun(int argc, c
  
      // start link
      container_t msg = PJ_container_get(vm->getCname());
-     type_t type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
+     Type* type     = PJ_type_get("MSG_VM_LINK", PJ_type_get_root());
      new StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
  
      // destroy existing container of this vm
@@@ -338,7 -338,7 +338,7 @@@ static void start_dirty_page_tracking(m
    if (vm->pimpl_vm_->dp_objs.empty())
      return;
  
 -  for (auto elm : vm->pimpl_vm_->dp_objs) {
 +  for (auto const& elm : vm->pimpl_vm_->dp_objs) {
      dirty_page_t dp    = elm.second;
      double remaining = MSG_task_get_flops_amount(dp->task);
      dp->prev_clock = MSG_get_clock();
@@@ -367,7 -367,7 +367,7 @@@ static double lookup_computed_flop_coun
  {
    double total = 0;
  
 -  for (auto elm : vm->pimpl_vm_->dp_objs) {
 +  for (auto const& elm : vm->pimpl_vm_->dp_objs) {
      const char* key  = elm.first.c_str();
      dirty_page_t dp  = elm.second;
      double remaining = MSG_task_get_flops_amount(dp->task);
@@@ -774,7 -774,7 +774,7 @@@ void MSG_vm_suspend(msg_vm_t vm
  
    if (TRACE_msg_vm_is_enabled()) {
      container_t vm_container = PJ_container_get(vm->getCname());
-     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
+     Type* type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
      value* val               = value::get_or_new("suspend", "1 0 0", type); // suspend is red
      new PushStateEvent(MSG_get_clock(), vm_container, type, val);
    }
@@@ -791,7 -791,7 +791,7 @@@ void MSG_vm_resume(msg_vm_t vm
  
    if (TRACE_msg_vm_is_enabled()) {
      container_t vm_container = PJ_container_get(vm->getCname());
-     type_t type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
+     Type* type              = PJ_type_get("MSG_VM_STATE", vm_container->type);
      new PopStateEvent(MSG_get_clock(), vm_container, type);
    }
  }
@@@ -176,7 -176,7 +176,7 @@@ void TRACE_smpi_alloc(
  
  void TRACE_smpi_release()
  {
 -  for (auto elm : keys)
 +  for (auto const& elm : keys)
      delete elm.second;
  }
  
@@@ -203,13 -203,13 +203,13 @@@ void TRACE_smpi_init(int rank
  #if HAVE_PAPI
    papi_counter_t counters = smpi_process()->papi_counters();
  
 -  for (auto& it : counters) {
 +  for (auto const& it : counters) {
      /**
       * Check whether this variable already exists or not. Otherwise, it will be created
       * multiple times but only the last one would be used...
       */
-     if (PJ_type_get_or_null(it.first.c_str(), container->type) == nullptr) {
-       PJ_type_variable_new(it.first.c_str(), nullptr, container->type);
+     if (s_type::getOrNull(it.first.c_str(), container->type) == nullptr) {
+       Type::variableNew(it.first.c_str(), nullptr, container->type);
      }
    }
  #endif
@@@ -236,7 -236,7 +236,7 @@@ void TRACE_smpi_collective_in(int rank
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color (operation);
    value* val            = value::get_or_new(operation, color, type);
    new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
@@@ -250,7 -250,7 +250,7 @@@ void TRACE_smpi_collective_out(int rank
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
  
    new PopStateEvent (SIMIX_get_clock(), container, type);
  }
@@@ -264,7 -264,7 +264,7 @@@ void TRACE_smpi_computing_init(int rank
   char str[INSTR_DEFAULT_STR_SIZE];
   smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
   container_t container = PJ_container_get(str);
-  type_t type           = PJ_type_get("MPI_STATE", container->type);
+  Type* type           = PJ_type_get("MPI_STATE", container->type);
   const char* color     = instr_find_color("computing");
   new PushStateEvent(SIMIX_get_clock(), container, type, value::get_or_new("computing", color, type));
  }
@@@ -280,7 -280,7 +280,7 @@@ void TRACE_smpi_computing_in(int rank, 
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    value* val            = value::get_or_new("computing", nullptr, type);
    new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
  }
@@@ -292,7 -292,7 +292,7 @@@ void TRACE_smpi_computing_out(int rank
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
@@@ -305,7 -305,7 +305,7 @@@ void TRACE_smpi_sleeping_init(int rank
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color ("sleeping");
    value* val            = value::get_or_new("sleeping", color, type);
    new PushStateEvent(SIMIX_get_clock(), container, type, val);
@@@ -322,7 -322,7 +322,7 @@@ void TRACE_smpi_sleeping_in(int rank, i
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    value* val            = value::get_or_new("sleeping", nullptr, type);
    new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
  }
@@@ -334,7 -334,7 +334,7 @@@ void TRACE_smpi_sleeping_out(int rank
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
@@@ -349,7 -349,7 +349,7 @@@ void TRACE_smpi_testing_in(int rank, in
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    value* val            = value::get_or_new("test", nullptr, type);
    new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
  }
@@@ -361,7 -361,7 +361,7 @@@ void TRACE_smpi_testing_out(int rank
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    new PopStateEvent (SIMIX_get_clock(), container, type);
  }
  
@@@ -375,7 -375,7 +375,7 @@@ void TRACE_smpi_ptp_in(int rank, const 
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
    const char *color = instr_find_color (operation);
    value* val            = value::get_or_new(operation, color, type);
    new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast<void*>(extra));
@@@ -389,7 -389,7 +389,7 @@@ void TRACE_smpi_ptp_out(int rank, int d
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_STATE", container->type);
+   Type* type = PJ_type_get ("MPI_STATE", container->type);
  
    new PopStateEvent (SIMIX_get_clock(), container, type);
  }
@@@ -405,7 -405,7 +405,7 @@@ void TRACE_smpi_send(int rank, int src
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(src, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
+   Type* type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
    XBT_DEBUG("Send tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
    new StartLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key, size);
  }
@@@ -421,7 -421,7 +421,7 @@@ void TRACE_smpi_recv(int src, int dst, 
    char str[INSTR_DEFAULT_STR_SIZE];
    smpi_container(dst, str, INSTR_DEFAULT_STR_SIZE);
    container_t container = PJ_container_get (str);
-   type_t type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
+   Type* type = PJ_type_get ("MPI_LINK", PJ_type_get_root());
    XBT_DEBUG("Recv tracing from %d to %d, tag %d, with key %s", src, dst, tag, key);
    new EndLinkEvent (SIMIX_get_clock(), PJ_container_get_root(), type, container, "PTP", key);
  }
@@@ -105,9 -105,9 +105,9 @@@ static void linkContainers (container_
              father->type->name,
              src->type->name, src->type->id,
              dst->type->name, dst->type->id);
-   type_t link_type = PJ_type_get_or_null (link_typename, father->type);
+   Type* link_type = Type::getOrNull (link_typename, father->type);
    if (link_type == nullptr){
-     link_type = PJ_type_link_new (link_typename, father->type, src->type, dst->type);
+     link_type = Type::linkNew (link_typename, father->type, src->type, dst->type);
    }
  
    //register EDGE types for triva configuration
@@@ -135,7 -135,7 +135,7 @@@ static void recursiveGraphExtraction(si
    XBT_DEBUG("Graph extraction for NetZone = %s", netzone->getCname());
    if (not netzone->getChildren()->empty()) {
      //bottom-up recursion
 -    for (auto nz_son : *netzone->getChildren()) {
 +    for (auto const& nz_son : *netzone->getChildren()) {
        container_t child_container = static_cast<container_t>(xbt_dict_get(container->children, nz_son->getCname()));
        recursiveGraphExtraction(nz_son, child_container, filter);
      }
@@@ -173,12 -173,12 +173,12 @@@ static void sg_instr_AS_begin(simgrid::
      PJ_container_set_root (root);
  
      if (TRACE_smpi_is_enabled()) {
-       type_t mpi = PJ_type_get_or_null ("MPI", root->type);
+       Type* mpi = Type::getOrNull ("MPI", root->type);
        if (mpi == nullptr){
-         mpi = PJ_type_container_new("MPI", root->type);
+         mpi = Type::containerNew("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);
+           Type::stateNew ("MPI_STATE", mpi);
+         Type::linkNew ("MPI_LINK", PJ_type_get_root(), mpi, mpi);
        }
      }
  
@@@ -214,21 -214,21 +214,21 @@@ static void instr_routing_parse_start_l
    container_t container = PJ_container_new(link.name(), INSTR_LINK, father);
  
    if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
-     type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type);
+     Type* bandwidth = Type::getOrNull("bandwidth", container->type);
      if (bandwidth == nullptr) {
-       bandwidth = PJ_type_variable_new("bandwidth", nullptr, container->type);
+       bandwidth = Type::variableNew("bandwidth", nullptr, container->type);
      }
-     type_t latency = PJ_type_get_or_null("latency", container->type);
+     Type* latency = Type::getOrNull("latency", container->type);
      if (latency == nullptr) {
-       latency = PJ_type_variable_new("latency", nullptr, container->type);
+       latency = Type::variableNew("latency", nullptr, container->type);
      }
      new SetVariableEvent(0, container, bandwidth, bandwidth_value);
      new SetVariableEvent(0, container, latency, latency_value);
    }
    if (TRACE_uncategorized()) {
-     type_t bandwidth_used = PJ_type_get_or_null("bandwidth_used", container->type);
+     Type* bandwidth_used = Type::getOrNull("bandwidth_used", container->type);
      if (bandwidth_used == nullptr) {
-       PJ_type_variable_new("bandwidth_used", "0.5 0.5 0.5", container->type);
+       Type::variableNew("bandwidth_used", "0.5 0.5 0.5", container->type);
      }
    }
  }
@@@ -239,56 -239,56 +239,56 @@@ static void sg_instr_new_host(simgrid::
    container_t container = PJ_container_new(host.getCname(), INSTR_HOST, father);
  
    if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
-     type_t speed = PJ_type_get_or_null ("power", container->type);
+     Type* speed = Type::getOrNull ("power", container->type);
      if (speed == nullptr){
-       speed = PJ_type_variable_new ("power", nullptr, container->type);
+       speed = Type::variableNew ("power", nullptr, container->type);
      }
  
      double current_speed_state = host.getSpeed();
      new SetVariableEvent (0, container, speed, current_speed_state);
    }
    if (TRACE_uncategorized()){
-     type_t speed_used = PJ_type_get_or_null ("power_used", container->type);
+     Type* speed_used = Type::getOrNull ("power_used", container->type);
      if (speed_used == nullptr){
-       PJ_type_variable_new ("power_used", "0.5 0.5 0.5", container->type);
+       Type::variableNew ("power_used", "0.5 0.5 0.5", container->type);
      }
    }
  
    if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
-     type_t mpi = PJ_type_get_or_null ("MPI", container->type);
+     Type* mpi = Type::getOrNull ("MPI", container->type);
      if (mpi == nullptr){
-       mpi = PJ_type_container_new("MPI", container->type);
-       PJ_type_state_new ("MPI_STATE", mpi);
+       mpi = Type::containerNew("MPI", container->type);
+       Type::stateNew ("MPI_STATE", mpi);
      }
    }
  
    if (TRACE_msg_process_is_enabled()) {
-     type_t msg_process = PJ_type_get_or_null ("MSG_PROCESS", container->type);
+     Type* msg_process = Type::getOrNull ("MSG_PROCESS", container->type);
      if (msg_process == nullptr){
-       msg_process = PJ_type_container_new("MSG_PROCESS", container->type);
-       type_t state = PJ_type_state_new ("MSG_PROCESS_STATE", msg_process);
+       msg_process = Type::containerNew("MSG_PROCESS", container->type);
+       Type* state = Type::stateNew ("MSG_PROCESS_STATE", msg_process);
        value PJ_value("suspend", "1 0 1", state);
        value::get_or_new("sleep", "1 1 0", state);
        value::get_or_new("receive", "1 0 0", state);
        value::get_or_new("send", "0 0 1", state);
        value::get_or_new("task_execute", "0 1 1", state);
-       PJ_type_link_new ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
-       PJ_type_link_new ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
+       Type::linkNew ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
+       Type::linkNew ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
      }
    }
  
    if (TRACE_msg_vm_is_enabled()) {
-     type_t msg_vm = PJ_type_get_or_null ("MSG_VM", container->type);
+     Type* msg_vm = Type::getOrNull ("MSG_VM", container->type);
      if (msg_vm == nullptr){
-       msg_vm = PJ_type_container_new("MSG_VM", container->type);
-       type_t state = PJ_type_state_new ("MSG_VM_STATE", msg_vm);
+       msg_vm = Type::containerNew("MSG_VM", container->type);
+       Type* state = Type::stateNew ("MSG_VM_STATE", msg_vm);
        value PJ_value("suspend", "1 0 1", state);
        value::get_or_new("sleep", "1 1 0", state);
        value::get_or_new("receive", "1 0 0", state);
        value::get_or_new("send", "0 0 1", state);
        value::get_or_new("task_execute", "0 1 1", state);
-       PJ_type_link_new ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
-       PJ_type_link_new ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
+       Type::linkNew ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
+       Type::linkNew ("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
      }
    }
  
@@@ -334,25 -334,25 +334,25 @@@ void instr_routing_define_callbacks (
  /*
   * user categories support
   */
- static void recursiveNewVariableType (const char *new_typename, const char *color, type_t root)
+ static void recursiveNewVariableType (const char *new_typename, const char *color, Type* root)
  {
    if (not strcmp(root->name, "HOST")) {
      char tnstr[INSTR_DEFAULT_STR_SIZE];
      snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
-     PJ_type_variable_new (tnstr, color, root);
+     Type::variableNew (tnstr, color, root);
    }
    if (not strcmp(root->name, "MSG_VM")) {
      char tnstr[INSTR_DEFAULT_STR_SIZE];
      snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
-     PJ_type_variable_new (tnstr, color, root);
+     Type::variableNew (tnstr, color, root);
    }
    if (not strcmp(root->name, "LINK")) {
      char tnstr[INSTR_DEFAULT_STR_SIZE];
      snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
-     PJ_type_variable_new (tnstr, color, root);
+     Type::variableNew (tnstr, color, root);
    }
    xbt_dict_cursor_t cursor = nullptr;
-   type_t child_type;
+   Type* child_type;
    char *name;
    xbt_dict_foreach(root->children, cursor, name, child_type) {
      recursiveNewVariableType (new_typename, color, child_type);
@@@ -364,13 -364,13 +364,13 @@@ void instr_new_variable_type (const cha
    recursiveNewVariableType (new_typename, color, PJ_type_get_root());
  }
  
- static void recursiveNewUserVariableType (const char *father_type, const char *new_typename, const char *color, type_t root)
+ static void recursiveNewUserVariableType (const char *father_type, const char *new_typename, const char *color, Type* root)
  {
    if (not strcmp(root->name, father_type)) {
-     PJ_type_variable_new (new_typename, color, root);
+     Type::variableNew (new_typename, color, root);
    }
    xbt_dict_cursor_t cursor = nullptr;
-   type_t child_type;
+   Type* child_type;
    char *name;
    xbt_dict_foreach(root->children, cursor, name, child_type) {
      recursiveNewUserVariableType (father_type, new_typename, color, child_type);
@@@ -382,13 -382,13 +382,13 @@@ void instr_new_user_variable_type  (con
    recursiveNewUserVariableType (father_type, new_typename, color, PJ_type_get_root());
  }
  
- static void recursiveNewUserStateType (const char *father_type, const char *new_typename, type_t root)
+ static void recursiveNewUserStateType (const char *father_type, const char *new_typename, Type* root)
  {
    if (not strcmp(root->name, father_type)) {
-     PJ_type_state_new (new_typename, root);
+     Type::stateNew (new_typename, root);
    }
    xbt_dict_cursor_t cursor = nullptr;
-   type_t child_type;
+   Type* child_type;
    char *name;
    xbt_dict_foreach(root->children, cursor, name, child_type) {
      recursiveNewUserStateType (father_type, new_typename, child_type);
@@@ -400,13 -400,13 +400,13 @@@ void instr_new_user_state_type (const c
    recursiveNewUserStateType (father_type, new_typename, PJ_type_get_root());
  }
  
- static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, type_t root)
+ static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color, Type* root)
  {
    if (not strcmp(root->name, type_name)) {
      value PJ_value(val, color, root);
    }
    xbt_dict_cursor_t cursor = nullptr;
-   type_t child_type;
+   Type* child_type;
    char *name;
    xbt_dict_foreach(root->children, cursor, name, child_type) {
      recursiveNewValueForUserStateType(type_name, val, color, child_type);
@@@ -430,7 -430,7 +430,7 @@@ static void recursiveXBTGraphExtraction
  {
    if (not netzone->getChildren()->empty()) {
      //bottom-up recursion
 -    for (auto netzone_child : *netzone->getChildren()) {
 +    for (auto const& netzone_child : *netzone->getChildren()) {
        container_t child_container =
            static_cast<container_t>(xbt_dict_get(container->children, netzone_child->getCname()));
        recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container);