X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/214f188618ac52530034513e24a0a9b6353e0f95..0a17694bb29a7a91905f1ae1ad352bc5554b574f:/src/mc/mc_process.h diff --git a/src/mc/mc_process.h b/src/mc/mc_process.h index 4e301220e2..a453d464aa 100644 --- a/src/mc/mc_process.h +++ b/src/mc/mc_process.h @@ -7,7 +7,8 @@ #ifndef MC_PROCESS_H #define MC_PROCESS_H -#include +#include + #include #include @@ -135,6 +136,25 @@ public: return status_; } + template + typename std::enable_if< std::is_class::value && std::is_trivial::value, int >::type + send_message(M const& m) + { + return MC_protocol_send(this->socket_, &m, sizeof(M)); + } + + int send_message(e_mc_message_type message_id) + { + return MC_protocol_send_simple_message(this->socket_, message_id); + } + + template + typename std::enable_if< std::is_class::value && std::is_trivial::value, ssize_t >::type + receive_message(M& m) + { + return MC_receive_message(this->socket_, &m, sizeof(M), 0); + } + private: void init_memory_map_info(); void refresh_heap(); @@ -142,9 +162,7 @@ private: private: mc_process_flags_t process_flags; pid_t pid_; -public: // to be private - int socket; -private: + int socket_; int status_; bool running_; std::vector memory_map_;