Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more std::string and stuff
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 16 Oct 2017 13:33:58 +0000 (15:33 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 16 Oct 2017 13:33:58 +0000 (15:33 +0200)
src/include/surf/surf.h
src/instr/instr_interface.cpp
src/instr/instr_paje_trace.cpp
src/instr/instr_private.hpp
src/surf/instr_routing.cpp

index 7d7a121..d83c9a0 100644 (file)
@@ -433,10 +433,6 @@ void TRACE_surf_action(surf_action_t surf_action, const char *category);
 
 /* instr_routing.c */
 void instr_routing_define_callbacks ();
-void instr_new_variable_type (const char *new_typename, const char *color);
-void instr_new_user_variable_type  (const char *father_type, const char *new_typename, const char *color);
-void instr_new_user_state_type (const char *father_type, const char *new_typename);
-void instr_new_value_for_user_state_type (const char *_typename, const char *value, const char *color);
 int instr_platform_traced ();
 xbt_graph_t instr_routing_platform_graph ();
 void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *filename);
index a0899f6..6263fcd 100644 (file)
@@ -941,8 +941,7 @@ void TRACE_host_set_state(const char* host, const char* state, const char* value
 {
   container_t container      = simgrid::instr::Container::byName(host);
   simgrid::instr::Type* type = container->type_->byName(state);
-  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(
-      value_str, "", type); /* if user didn't declare a value with a color, use no color */
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(value_str, "", type);
   new simgrid::instr::SetStateEvent(MSG_get_clock(), container, type, val);
 }
 
@@ -961,8 +960,7 @@ void TRACE_host_push_state(const char* host, const char* state, const char* valu
 {
   container_t container      = simgrid::instr::Container::byName(host);
   simgrid::instr::Type* type = container->type_->byName(state);
-  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(
-      value_str, "", type); /* if user didn't declare a value with a color, use no color */
+  simgrid::instr::Value* val = simgrid::instr::Value::byNameOrCreate(value_str, "", type);
   new simgrid::instr::PushStateEvent(MSG_get_clock(), container, type, val);
 }
 
index 67a0747..1a5371c 100644 (file)
@@ -76,7 +76,6 @@ void TRACE_paje_dump_buffer(bool force)
   XBT_DEBUG("%s: ends", __FUNCTION__);
 }
 
-void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf);
 void buffer_debug(std::vector<simgrid::instr::PajeEvent*>* buf)
 {
   return;
@@ -288,7 +287,6 @@ void simgrid::instr::Value::print()
   }
 }
 
-
 simgrid::instr::SetVariableEvent::SetVariableEvent(double timestamp, container_t container, Type* type, double value)
     : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_SetVariable), value(value)
 {
@@ -416,6 +414,7 @@ simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t con
 simgrid::instr::PushStateEvent::PushStateEvent(double timestamp, container_t container, Type* type, Value* val)
     : PushStateEvent(timestamp, container, type, val, nullptr)
 {}
+
 void simgrid::instr::PushStateEvent::print()
 {
   if (instr_fmt_type == instr_fmt_paje) {
index a899542..bb29ad2 100644 (file)
@@ -325,6 +325,10 @@ extern XBT_PRIVATE std::set<std::string> trivaEdgeTypes;
 XBT_PRIVATE long long int instr_new_paje_id();
 XBT_PUBLIC(container_t) PJ_container_get_root ();
 XBT_PUBLIC(void) PJ_container_set_root (container_t root);
+void instr_new_variable_type(std::string new_typename, const char* color);
+void instr_new_user_variable_type(std::string father_type, std::string new_typename, const char* color);
+void instr_new_user_state_type(std::string father_type, std::string new_typename);
+void instr_new_value_for_user_state_type(std::string new_typename, const char* value, const char* color);
 
 /* instr_config.c */
 XBT_PRIVATE void TRACE_TI_start();
index 75169e6..d15d655 100644 (file)
@@ -288,7 +288,7 @@ void instr_routing_define_callbacks ()
 /*
  * user categories support
  */
-static void recursiveNewVariableType(const char* new_typename, const char* color, simgrid::instr::Type* root)
+static void recursiveNewVariableType(std::string new_typename, const char* color, simgrid::instr::Type* root)
 {
   if (root->getName() == "HOST" || root->getName() == "MSG_VM")
     root->getOrCreateVariableType(std::string("p") + new_typename, color == nullptr ? "" : color);
@@ -301,12 +301,12 @@ static void recursiveNewVariableType(const char* new_typename, const char* color
   }
 }
 
-void instr_new_variable_type (const char *new_typename, const char *color)
+void instr_new_variable_type(std::string new_typename, const char* color)
 {
   recursiveNewVariableType(new_typename, color, simgrid::instr::Type::getRootType());
 }
 
-static void recursiveNewUserVariableType(const char* father_type, const char* new_typename, const char* color,
+static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, const char* color,
                                          simgrid::instr::Type* root)
 {
   if (root->getName() == father_type) {
@@ -316,12 +316,12 @@ static void recursiveNewUserVariableType(const char* father_type, const char* ne
     recursiveNewUserVariableType(father_type, new_typename, color, elm.second);
 }
 
-void instr_new_user_variable_type  (const char *father_type, const char *new_typename, const char *color)
+void instr_new_user_variable_type(std::string father_type, std::string new_typename, const char* color)
 {
   recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Type::getRootType());
 }
 
-static void recursiveNewUserStateType(const char* father_type, const char* new_typename, simgrid::instr::Type* root)
+static void recursiveNewUserStateType(std::string father_type, std::string new_typename, simgrid::instr::Type* root)
 {
   if (root->getName() == father_type) {
     root->getOrCreateStateType(new_typename);
@@ -330,12 +330,12 @@ static void recursiveNewUserStateType(const char* father_type, const char* new_t
     recursiveNewUserStateType(father_type, new_typename, elm.second);
 }
 
-void instr_new_user_state_type (const char *father_type, const char *new_typename)
+void instr_new_user_state_type(std::string father_type, std::string new_typename)
 {
   recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Type::getRootType());
 }
 
-static void recursiveNewValueForUserStateType(const char* type_name, const char* val, const char* color,
+static void recursiveNewValueForUserStateType(std::string type_name, const char* val, const char* color,
                                               simgrid::instr::Type* root)
 {
   if (root->getName() == type_name)
@@ -345,7 +345,7 @@ static void recursiveNewValueForUserStateType(const char* type_name, const char*
     recursiveNewValueForUserStateType(type_name, val, color, elm.second);
 }
 
-void instr_new_value_for_user_state_type (const char *type_name, const char *value, const char *color)
+void instr_new_value_for_user_state_type(std::string type_name, const char* value, const char* color)
 {
   recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Type::getRootType());
 }