Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / examples / s4u / app-bittorrent / s4u-bittorrent.hpp
index b2113ca..1c53685 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
@@ -8,7 +8,7 @@
 #define BITTORRENT_BITTORRENT_HPP_
 
 #include <simgrid/s4u.hpp>
-#include <xbt/RngStream.h>
+#include <xbt/random.hpp>
 
 constexpr char TRACKER_MAILBOX[] = "tracker_mailbox";
 /** Max number of peers sent by the tracker to clients */
@@ -77,23 +77,4 @@ public:
       : type(type), peer_id(peer_id), return_mailbox(return_mailbox), piece(piece){};
 };
 
-class HostBittorrent {
-  std::unique_ptr<std::remove_pointer<RngStream>::type, std::function<void(RngStream)>> stream_ = {
-      nullptr, [](RngStream stream) { RngStream_DeleteStream(&stream); }};
-  simgrid::s4u::Host* host = nullptr;
-
-public:
-  static simgrid::xbt::Extension<simgrid::s4u::Host, HostBittorrent> EXTENSION_ID;
-
-  explicit HostBittorrent(simgrid::s4u::Host* ptr) : host(ptr)
-  {
-    std::string descr = std::string("RngSream<") + host->get_cname() + ">";
-    stream_.reset(RngStream_CreateStream(descr.c_str()));
-  }
-  HostBittorrent(const HostBittorrent&) = delete;
-  HostBittorrent& operator=(const HostBittorrent&) = delete;
-
-  RngStream getStream() { return stream_.get(); };
-};
-
 #endif /* BITTORRENT_BITTORRENT_HPP_ */