Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
s_container is changed to cpp class
authorTakishipp <toufik.boubehziz@gmail.com>
Wed, 5 Apr 2017 13:07:12 +0000 (15:07 +0200)
committerTakishipp <toufik.boubehziz@gmail.com>
Wed, 5 Apr 2017 13:07:12 +0000 (15:07 +0200)
src/instr/instr_paje_types.cpp
src/instr/instr_private.h
src/instr/instr_trace.cpp

index eb40012..65fa3dd 100644 (file)
@@ -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)
 }
 
 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");
   }
   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);
 
   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;
 }
   }
   return ret;
 }
index 36615e6..51aeb50 100644 (file)
@@ -55,16 +55,21 @@ typedef enum {
   TYPE_EVENT
 } e_entity_types;
 
   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;
   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
   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;
 
 //--------------------------------------------------
 class s_val;
@@ -122,11 +127,16 @@ class paje_event {
 };
 typedef paje_event s_paje_event_t;
 //--------------------------------------------------
 };
 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;
   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 {
 
 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_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);
 XBT_PUBLIC(void) new_pajeDefineVariableType(type_t type);
 XBT_PUBLIC(void) new_pajeDefineStateType(type_t type);
 XBT_PUBLIC(void) new_pajeDefineEventType(type_t type);
index 0580aa2..0521678 100644 (file)
@@ -123,7 +123,7 @@ static void free_paje_event (paje_event_t event)
   xbt_free (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;
 {
   paje_event_t event                           = xbt_new0(s_paje_event_t, 1);
   event->event_type                            = PAJE_DefineContainerType;