X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b02538071ffda15d09efbe85f1459e2c4688f68d..0bfafcab47ae9cd7856bd8d129404c33079d6afe:/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 deleted file mode 100644 index d167dc0f0c..0000000000 --- a/examples/s4u/app-bittorrent/s4u-tracker.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (c) 2012-2014, 2017. 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_ - -#include "s4u-bittorrent.hpp" -#include - -class TrackerQuery { - int peer_id; // peer id - simgrid::s4u::MailboxPtr return_mailbox; -public: - explicit TrackerQuery(int peer_id, simgrid::s4u::MailboxPtr return_mailbox) - : peer_id(peer_id), return_mailbox(return_mailbox){}; - ~TrackerQuery() = default; - int getPeerId() { return peer_id; } - simgrid::s4u::MailboxPtr getReturnMailbox() { return return_mailbox; } -}; - -class TrackerAnswer { - // int interval; // how often the peer should contact the tracker (unused for now) - std::set* peers; // the peer list the peer has asked for. -public: - explicit TrackerAnswer(int /*interval*/) /*: interval(interval)*/ { peers = new std::set; } - TrackerAnswer(const TrackerAnswer&) = delete; - ~TrackerAnswer() { delete peers; }; - void addPeer(int peer) { peers->insert(peer); } - std::set* getPeers() { return peers; } -}; - -class Tracker { - double deadline; - RngStream stream; - simgrid::s4u::MailboxPtr mailbox; - std::set known_peers; - -public: - explicit Tracker(std::vector args); - void operator()(); -}; - -#endif /* BITTORRENT_TRACKER_HPP */