From: Martin Quinson Date: Sun, 27 Aug 2017 22:42:55 +0000 (+0200) Subject: class names must be in CamelCase X-Git-Tag: v3_17~201 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b277818bec65f5664e6880a2cf7ab3551804d589?ds=sidebyside class names must be in CamelCase --- diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 2029d3cc73..8a0accaaf1 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -193,7 +193,7 @@ void TRACE_declare_mark_value_with_color (const char *mark_type, const char *mar mark_color = white; XBT_DEBUG("MARK,declare_value %s %s %s", mark_type, mark_value, mark_color); - value rett(mark_value, mark_color, type); + Value rett(mark_value, mark_color, type); } /** \ingroup TRACE_mark @@ -245,7 +245,7 @@ void TRACE_mark(const char *mark_type, const char *mark_value) } XBT_DEBUG("MARK %s %s", mark_type, mark_value); - new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, value::get(mark_value, type)); + new NewEvent(MSG_get_clock(), PJ_container_get_root(), type, Value::get(mark_value, type)); } /** \ingroup TRACE_mark @@ -946,8 +946,8 @@ void TRACE_host_set_state(const char* host, const char* state, const char* value { container_t container = PJ_container_get(host); 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 */ + 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); } @@ -966,8 +966,8 @@ void TRACE_host_push_state(const char* host, const char* state, const char* valu { container_t container = PJ_container_get(host); 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 */ + 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); } diff --git a/src/instr/instr_paje_trace.cpp b/src/instr/instr_paje_trace.cpp index 9745a0f7ce..21c36d74c0 100644 --- a/src/instr/instr_paje_trace.cpp +++ b/src/instr/instr_paje_trace.cpp @@ -284,7 +284,7 @@ if (instr_fmt_type == instr_fmt_paje) { } } -void LogEntityValue(value* val) +void LogEntityValue(Value* val) { XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue); //print it @@ -467,7 +467,7 @@ void SubVariableEvent::print() { } } -SetStateEvent::SetStateEvent(double timestamp, container_t container, Type* 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 @@ void SetStateEvent::print() { } } -PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* 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; @@ -531,7 +531,7 @@ PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* ty insert_into_buffer (this); } -PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, value* val) +PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val) : PushStateEvent(timestamp, container, type, val, nullptr) {} void PushStateEvent::print() { @@ -839,7 +839,7 @@ void EndLinkEvent::print() { } } -NewEvent::NewEvent(double timestamp, container_t container, Type* type, value* val) +NewEvent::NewEvent(double timestamp, container_t container, Type* type, Value* val) { this->event_type = PAJE_NewEvent; this->timestamp = timestamp; diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 3bf10618fb..89810379fe 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -45,7 +45,7 @@ Type::Type (const char *typeNameBuff, const char *key, const char *color, e_enti void PJ_type_free (type_t type) { - value* val; + Value* val; char *value_name; xbt_dict_cursor_t cursor = nullptr; xbt_dict_foreach (type->values, cursor, value_name, val) { diff --git a/src/instr/instr_paje_values.cpp b/src/instr/instr_paje_values.cpp index 5372bf2307..020735bad2 100644 --- a/src/instr/instr_paje_values.cpp +++ b/src/instr/instr_paje_values.cpp @@ -10,12 +10,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)"); -value::value(const char* name, const char* color, Type* father) +Value::Value(const char* name, const char* color, Type* father) { if (name == nullptr || father == nullptr){ THROWF (tracing_error, 0, "can't create a value with a nullptr name (or a nullptr father)"); } - this->ret = xbt_new0(value, 1); + this->ret = xbt_new0(Value, 1); this->ret->name = xbt_strdup (name); this->ret->father = father; this->ret->color = xbt_strdup (color); @@ -29,7 +29,7 @@ value::value(const char* name, const char* color, Type* father) LogEntityValue(this->ret); }; -value::~value() +Value::~Value() { /* FIXME: this should be cleanable xbt_free(name); @@ -38,20 +38,20 @@ value::~value() */ } -value* value::get_or_new(const char* name, const char* color, Type* father) +Value* Value::get_or_new(const char* name, const char* color, Type* father) { - value* ret = 0; + Value* ret = 0; try { - ret = value::get(name, father); + ret = Value::get(name, father); } catch(xbt_ex& e) { - value rett(name, color, father); + Value rett(name, color, father); ret = rett.ret; } return ret; } -value* value::get(const char* name, Type* father) +Value* Value::get(const char* name, Type* father) { if (name == nullptr || father == nullptr){ THROWF (tracing_error, 0, "can't get a value with a nullptr name (or a nullptr father)"); @@ -59,7 +59,7 @@ value* value::get(const char* name, Type* father) if (father->kind == TYPE_VARIABLE) THROWF(tracing_error, 0, "variables can't have different values (%s)", father->name); - value* ret = (value*)xbt_dict_get_or_null(father->values, name); + Value* ret = (Value*)xbt_dict_get_or_null(father->values, name); if (ret == nullptr) { THROWF(tracing_error, 2, "value with name (%s) not found in father type (%s)", name, father->name); } diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 3dee571d22..10a19dff2f 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -80,18 +80,18 @@ public: }; //-------------------------------------------------- -class value { +class Value { public: char* id; char* name; char* color; type_t father; - value* ret; - value(const char* name, const char* color, type_t father); - ~value(); - static value* get_or_new(const char* name, const char* color, type_t father); - static value* get(const char* name, type_t father); + Value* ret; + Value(const char* name, const char* color, type_t father); + ~Value(); + static Value* get_or_new(const char* name, const char* color, type_t father); + static Value* get(const char* name, type_t father); }; @@ -191,11 +191,11 @@ class SetStateEvent : public PajeEvent { private: container_t container; type_t type; - value* val; + Value* val; const char* filename; int linenumber; public: - SetStateEvent(double timestamp, container_t container, type_t type, value* val); + SetStateEvent(double timestamp, container_t container, type_t type, Value* val); void print() override; }; @@ -204,14 +204,14 @@ class PushStateEvent : public PajeEvent { public: container_t container; type_t type; - value* val; + Value* val; int size; const char* filename; int linenumber; void* extra_; public: - PushStateEvent(double timestamp, container_t container, type_t type, value* val); - PushStateEvent(double timestamp, container_t container, type_t type, value* val, void* extra); + PushStateEvent(double timestamp, container_t container, type_t type, Value* val); + PushStateEvent(double timestamp, container_t container, type_t type, Value* val, void* extra); void print() override; }; @@ -266,10 +266,10 @@ class NewEvent : public PajeEvent { public: container_t container; type_t type; - value* val; + Value* val; public: - NewEvent(double timestamp, container_t container, type_t type, value* val); + NewEvent(double timestamp, container_t container, type_t type, Value* val); void print() override; }; @@ -432,7 +432,7 @@ void DefineContainerEvent(type_t type); void LogVariableTypeDefinition(type_t type); void LogStateTypeDefinition(type_t type); void LogLinkTypeDefinition(type_t type, type_t source, type_t dest); -void LogEntityValue(value* val); +void LogEntityValue(Value* val); void LogContainerCreation (container_t container); void LogContainerDestruction (container_t container); void LogDefineEventType(type_t type); diff --git a/src/msg/instr_msg_process.cpp b/src/msg/instr_msg_process.cpp index 11bbb18316..6ed284fc26 100644 --- a/src/msg/instr_msg_process.cpp +++ b/src/msg/instr_msg_process.cpp @@ -94,7 +94,7 @@ void TRACE_msg_process_suspend(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - value* val = value::get("suspend", type); + Value* val = Value::get("suspend", type); new PushStateEvent(MSG_get_clock(), process_container, type, val); } } @@ -119,7 +119,7 @@ void TRACE_msg_process_sleep_in(msg_process_t process) container_t process_container = PJ_container_get (instr_process_id(process, str, len)); Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - value* val = value::get("sleep", type); + Value* val = Value::get("sleep", type); new PushStateEvent(MSG_get_clock(), process_container, type, val); } } diff --git a/src/msg/instr_msg_task.cpp b/src/msg/instr_msg_task.cpp index cfd1d388a3..11c9293fc8 100644 --- a/src/msg/instr_msg_task.cpp +++ b/src/msg/instr_msg_task.cpp @@ -54,7 +54,7 @@ void TRACE_msg_task_execute_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - value* val = value::get("task_execute", type); + Value* val = Value::get("task_execute", type); new PushStateEvent(MSG_get_clock(), process_container, type, val); } } @@ -94,7 +94,7 @@ void TRACE_msg_task_get_start() container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - value* val = value::get("receive", type); + Value* val = Value::get("receive", type); new PushStateEvent(MSG_get_clock(), process_container, type, val); } } @@ -129,7 +129,7 @@ int TRACE_msg_task_put_start(msg_task_t task) container_t process_container = PJ_container_get (instr_process_id(MSG_process_self(), str, len)); Type* type = PJ_type_get ("MSG_PROCESS_STATE", process_container->type); - value* val = value::get("send", type); + Value* val = Value::get("send", type); new PushStateEvent(MSG_get_clock(), process_container, type, val); char key[INSTR_DEFAULT_STR_SIZE]; diff --git a/src/msg/msg_vm.cpp b/src/msg/msg_vm.cpp index f12bbd01ed..25a4a0445b 100644 --- a/src/msg/msg_vm.cpp +++ b/src/msg/msg_vm.cpp @@ -188,7 +188,7 @@ void MSG_vm_start(msg_vm_t vm) if (TRACE_msg_vm_is_enabled()) { container_t vm_container = PJ_container_get(vm->getCname()); 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 + Value* val = Value::get_or_new("start", "0 0 1", type); // start is blue new PushStateEvent(MSG_get_clock(), vm_container, type, val); } } @@ -775,7 +775,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* type = PJ_type_get("MSG_VM_STATE", vm_container->type); - value* val = value::get_or_new("suspend", "1 0 0", type); // suspend is red + Value* val = Value::get_or_new("suspend", "1 0 0", type); // suspend is red new PushStateEvent(MSG_get_clock(), vm_container, type, val); } } diff --git a/src/smpi/colls/smpi_automatic_selector.cpp b/src/smpi/colls/smpi_automatic_selector.cpp index 2530f409b7..376b0d9dd8 100644 --- a/src/smpi/colls/smpi_automatic_selector.cpp +++ b/src/smpi/colls/smpi_automatic_selector.cpp @@ -16,13 +16,13 @@ #define TRACE_AUTO_COLL(cat) \ if (TRACE_is_enabled()) { \ - Type* type = Type::getOrNull(#cat, PJ_type_get_root()); \ + Type* type = Type::getOrNull(#cat, PJ_type_get_root()); \ if (not type) { \ - type = Type::eventNew(#cat, PJ_type_get_root()); \ + type = Type::eventNew(#cat, PJ_type_get_root()); \ } \ char cont_name[25]; \ snprintf(cont_name, 25, "rank-%d", smpi_process()->index()); \ - value* val = value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \ + Value* val = Value::get_or_new(Colls::mpi_coll_##cat##_description[i].name, "1.0 1.0 1.0", type); \ new NewEvent(SIMIX_get_clock(), PJ_container_get(cont_name), type, val); \ } diff --git a/src/smpi/internals/instr_smpi.cpp b/src/smpi/internals/instr_smpi.cpp index 38e31583b5..eb27740abb 100644 --- a/src/smpi/internals/instr_smpi.cpp +++ b/src/smpi/internals/instr_smpi.cpp @@ -238,7 +238,7 @@ void TRACE_smpi_collective_in(int rank, const char *operation, instr_extra_data container_t container = PJ_container_get (str); 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); + Value* val = Value::get_or_new(operation, color, type); new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -266,7 +266,7 @@ void TRACE_smpi_computing_init(int rank) container_t container = PJ_container_get(str); 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)); + new PushStateEvent(SIMIX_get_clock(), container, type, Value::get_or_new("computing", color, type)); } void TRACE_smpi_computing_in(int rank, instr_extra_data extra) @@ -281,7 +281,7 @@ void TRACE_smpi_computing_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); Type* type = PJ_type_get ("MPI_STATE", container->type); - value* val = value::get_or_new("computing", nullptr, type); + Value* val = Value::get_or_new("computing", nullptr, type); new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -307,7 +307,7 @@ void TRACE_smpi_sleeping_init(int rank) container_t container = PJ_container_get (str); 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); + Value* val = Value::get_or_new("sleeping", color, type); new PushStateEvent(SIMIX_get_clock(), container, type, val); } @@ -323,7 +323,7 @@ void TRACE_smpi_sleeping_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); Type* type = PJ_type_get ("MPI_STATE", container->type); - value* val = value::get_or_new("sleeping", nullptr, type); + Value* val = Value::get_or_new("sleeping", nullptr, type); new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -350,7 +350,7 @@ void TRACE_smpi_testing_in(int rank, instr_extra_data extra) smpi_container(rank, str, INSTR_DEFAULT_STR_SIZE); container_t container = PJ_container_get (str); Type* type = PJ_type_get ("MPI_STATE", container->type); - value* val = value::get_or_new("test", nullptr, type); + Value* val = Value::get_or_new("test", nullptr, type); new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } @@ -377,7 +377,7 @@ void TRACE_smpi_ptp_in(int rank, const char *operation, instr_extra_data extra) container_t container = PJ_container_get (str); 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); + Value* val = Value::get_or_new(operation, color, type); new PushStateEvent(SIMIX_get_clock(), container, type, val, static_cast(extra)); } diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index d32071114e..0b8c360c1e 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -267,11 +267,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (msg_process == nullptr){ 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); + 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); 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); } @@ -282,11 +282,11 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) if (msg_vm == nullptr){ 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); + 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); 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); } @@ -403,7 +403,7 @@ void instr_new_user_state_type (const char *father_type, const char *new_typenam 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); + Value PJ_value(val, color, root); } xbt_dict_cursor_t cursor = nullptr; Type* child_type;