X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cdf6a962eb4e88efbed3df9c41343adabcf09e6c..0e1d6abd00fd704c14e115a4287a607d088ae664:/examples/s4u/app-bittorrent/s4u-tracker.hpp diff --git a/examples/s4u/app-bittorrent/s4u-tracker.hpp b/examples/s4u/app-bittorrent/s4u-tracker.hpp index d4af5d6404..acdb129379 100644 --- a/examples/s4u/app-bittorrent/s4u-tracker.hpp +++ b/examples/s4u/app-bittorrent/s4u-tracker.hpp @@ -1,11 +1,11 @@ -/* Copyright (c) 2012-2019. The SimGrid Team. +/* Copyright (c) 2012-2020. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#ifndef BITTORRENT_TRACKER_HPP_ -#define BITTORRENT_TRACKER_HPP_ +#ifndef BITTORRENT_TRACKER_HPP +#define BITTORRENT_TRACKER_HPP #include "s4u-bittorrent.hpp" #include @@ -17,8 +17,8 @@ class TrackerQuery { public: explicit TrackerQuery(int peer_id, simgrid::s4u::Mailbox* return_mailbox) : peer_id(peer_id), return_mailbox(return_mailbox){}; - int getPeerId() { return peer_id; } - simgrid::s4u::Mailbox* getReturnMailbox() { return return_mailbox; } + int getPeerId() const { return peer_id; } + simgrid::s4u::Mailbox* getReturnMailbox() const { return return_mailbox; } }; class TrackerAnswer { @@ -27,12 +27,12 @@ class TrackerAnswer { public: explicit TrackerAnswer(int /*interval*/) /*: interval(interval)*/ {} void addPeer(int peer) { peers.insert(peer); } - const std::set& getPeers() { return peers; } + const std::set& getPeers() const { return peers; } }; class Tracker { double deadline; - RngStream stream; + simgrid::xbt::random::XbtRandom random{42}; simgrid::s4u::Mailbox* mailbox; std::set known_peers;