示例#1
0
val_t PJ_value_new (const char *name, const char *color, type_t father)
{
  if (name == NULL || father == NULL){
    THROWF (tracing_error, 0, "can't create a value with a NULL name (or a NULL father)");
  }

  val_t ret = xbt_new0(s_val_t, 1);
  ret->name = xbt_strdup (name);
  ret->father = father;
  ret->color = xbt_strdup (color);

  char str_id[INSTR_DEFAULT_STR_SIZE];
  snprintf (str_id, INSTR_DEFAULT_STR_SIZE, "%lld", instr_new_paje_id());
  ret->id = xbt_strdup (str_id);

  xbt_dict_set (father->values, name, ret, NULL);
  XBT_DEBUG("new value %s, child of %s", ret->name, ret->father->name);
  new_pajeDefineEntityValue(ret);
  return ret;
}
示例#2
0
EntityValue::EntityValue(std::string name, std::string color, Type* father)
    : id_(instr_new_paje_id()), name_(name), color_(color), father_(father){};