Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use s4u API in example.
[simgrid.git] / src / instr / instr_smpi.hpp
index e212b46..8b08e92 100644 (file)
@@ -6,14 +6,11 @@
 #ifndef INSTR_SMPI_HPP
 #define INSTR_SMPI_HPP
 
-#ifdef __cplusplus
-#include <string>
-#endif
-
 #include "smpi/smpi.h"
 #include "src/instr/instr_private.hpp"
+#include <string>
 
-SG_BEGIN_DECL()
+extern "C" {
 
 XBT_PRIVATE void TRACE_internal_smpi_set_category(const char* category);
 XBT_PRIVATE const char* TRACE_internal_smpi_get_category();
@@ -39,21 +36,20 @@ XBT_PRIVATE char* smpi_container(int rank, char* container, int n);
 
 XBT_PRIVATE const char* encode_datatype(MPI_Datatype datatype, int* known);
 
-typedef struct smpi_trace_call_location {
+class smpi_trace_call_location_t {
+public:
   const char* filename;
   int linenumber;
 
   const char* previous_filename;
   int previous_linenumber;
 
-#ifdef __cplusplus
-  std::string get_composed_key() {
-    return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' + std::to_string(linenumber);
+  std::string get_composed_key()
+  {
+    return std::string(previous_filename) + ':' + std::to_string(previous_linenumber) + ':' + filename + ':' +
+           std::to_string(linenumber);
   }
-#endif
-
-} smpi_trace_call_location_t;
-
-SG_END_DECL()
+};
+}
 
 #endif