From: Takishipp Date: Wed, 5 Apr 2017 13:07:12 +0000 (+0200) Subject: s_container is changed to cpp class X-Git-Tag: v3.16~287^2~13 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1de0e9895d452d0056536cbee5bb8e295837f17e s_container is changed to cpp class --- diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index eb40012ad2..65fa3ddf6d 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -116,7 +116,7 @@ type_t PJ_type_get_or_null (const char *name, type_t father) } type_t PJ_type_container_new (const char *name, type_t father) -{ +{ s_defineContainerType EltContainer; if (name == nullptr){ THROWF (tracing_error, 0, "can't create a container type with a nullptr name"); } @@ -130,7 +130,7 @@ type_t PJ_type_container_new (const char *name, type_t father) if(father){ XBT_DEBUG("ContainerType %s(%s), child of %s(%s)", ret->name, ret->id, father->name, father->id); - new_pajeDefineContainerType (ret); + EltContainer.new_pajeDefineContainerType (ret); } return ret; } diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 36615e6217..51aeb50c4a 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -55,16 +55,21 @@ typedef enum { TYPE_EVENT } e_entity_types; -typedef struct s_type *type_t; -typedef struct s_type { +//-------------------------------------------------- +class s_type; +typedef s_type *type_t; +class s_type { + public: char *id; char *name; char *color; e_entity_types kind; - struct s_type *father; + s_type *father; xbt_dict_t children; xbt_dict_t values; //valid for all types except variable and container -}s_type_t; +}; + +typedef s_type s_type_t; //-------------------------------------------------- class s_val; @@ -122,11 +127,16 @@ class paje_event { }; typedef paje_event s_paje_event_t; //-------------------------------------------------- +class s_defineContainerType; -typedef struct s_defineContainerType *defineContainerType_t; -typedef struct s_defineContainerType { +typedef s_defineContainerType *defineContainerType_t; +class s_defineContainerType { + public: type_t type; -}s_defineContainerType_t; + XBT_PUBLIC(void) new_pajeDefineContainerType(type_t type); +}; +typedef s_defineContainerType s_defineContainerType_t; +//-------------------------------------------------- typedef struct s_defineVariableType *defineVariableType_t; typedef struct s_defineVariableType { @@ -285,7 +295,7 @@ XBT_PRIVATE void TRACE_paje_init(); XBT_PRIVATE void TRACE_paje_start(); XBT_PRIVATE void TRACE_paje_end(); XBT_PRIVATE void TRACE_paje_dump_buffer (int force); -XBT_PUBLIC(void) new_pajeDefineContainerType(type_t type); + XBT_PUBLIC(void) new_pajeDefineVariableType(type_t type); XBT_PUBLIC(void) new_pajeDefineStateType(type_t type); XBT_PUBLIC(void) new_pajeDefineEventType(type_t type); diff --git a/src/instr/instr_trace.cpp b/src/instr/instr_trace.cpp index 0580aa2ac1..052167807d 100644 --- a/src/instr/instr_trace.cpp +++ b/src/instr/instr_trace.cpp @@ -123,7 +123,7 @@ static void free_paje_event (paje_event_t event) xbt_free (event); } -void new_pajeDefineContainerType(type_t type) +void s_defineContainerType::new_pajeDefineContainerType(type_t type) { paje_event_t event = xbt_new0(s_paje_event_t, 1); event->event_type = PAJE_DefineContainerType;