X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2d51e5b370a88386341d168e624a9c8c091f31de..ee1477d33506867034463d4d790279340382d7cc:/examples/cpp/dht-chord/s4u-dht-chord.hpp diff --git a/examples/cpp/dht-chord/s4u-dht-chord.hpp b/examples/cpp/dht-chord/s4u-dht-chord.hpp index 50ef4fdefe..ea42824e22 100644 --- a/examples/cpp/dht-chord/s4u-dht-chord.hpp +++ b/examples/cpp/dht-chord/s4u-dht-chord.hpp @@ -10,6 +10,8 @@ #include #include +namespace sg4 = simgrid::s4u; + constexpr double MAX_SIMULATION_TIME = 1000; constexpr double PERIODIC_STABILIZE_DELAY = 20; constexpr double PERIODIC_FIX_FINGERS_DELAY = 120; @@ -37,11 +39,11 @@ enum class MessageType { class ChordMessage { public: MessageType type; // type of message - std::string issuer_host_name = simgrid::s4u::this_actor::get_host()->get_name(); // used for logging + std::string issuer_host_name = sg4::this_actor::get_host()->get_name(); // used for logging int request_id = -1; // id (used by some types of messages) int request_finger = 1; // finger parameter (used by some types of messages) int answer_id = -1; // answer (used by some types of messages) - simgrid::s4u::Mailbox* answer_to = nullptr; // mailbox to send an answer to (if any) + sg4::Mailbox* answer_to = nullptr; // mailbox to send an answer to (if any) explicit ChordMessage(MessageType type) : type(type) {} @@ -56,7 +58,7 @@ class Node { int id_; // my id int pred_id_ = -1; // predecessor id simgrid::xbt::random::XbtRandom random; // random number generator for this node - simgrid::s4u::Mailbox* mailbox_; // my mailbox + sg4::Mailbox* mailbox_; // my mailbox std::vector fingers_; // finger table,(fingers[0] is my successor) int next_finger_to_fix; // index of the next finger to fix in fix_fingers()