core: use ndn-cxx's getRandomNumberEngine()
Change-Id: I3b5b3ac5238d47ac14481b21d0303c63d0c93b56
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index 63f9867..8a81a77 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -24,9 +24,10 @@
*/
#include "asf-probing-module.hpp"
-#include "core/random.hpp"
#include "algorithm.hpp"
+#include <ndn-cxx/util/random.hpp>
+
namespace nfd {
namespace fw {
namespace asf {
@@ -186,7 +187,7 @@
ProbingModule::getRandomNumber(double start, double end)
{
std::uniform_real_distribution<double> dist(start, end);
- return dist(getGlobalRng());
+ return dist(ndn::random::getRandomNumberEngine());
}
void
diff --git a/daemon/fw/ncc-strategy.cpp b/daemon/fw/ncc-strategy.cpp
index bb96009..df9a41b 100644
--- a/daemon/fw/ncc-strategy.cpp
+++ b/daemon/fw/ncc-strategy.cpp
@@ -25,7 +25,8 @@
#include "ncc-strategy.hpp"
#include "algorithm.hpp"
-#include "core/random.hpp"
+
+#include <ndn-cxx/util/random.hpp>
namespace nfd {
namespace fw {
@@ -176,7 +177,7 @@
if (isForwarded) {
std::uniform_int_distribution<time::nanoseconds::rep> dist(0, pitEntryInfo->maxInterval.count() - 1);
- time::nanoseconds deferNext = time::nanoseconds(dist(getGlobalRng()));
+ time::nanoseconds deferNext(dist(ndn::random::getRandomNumberEngine()));
pitEntryInfo->propagateTimer = scheduler::schedule(deferNext,
bind(&NccStrategy::doPropagate, this, inFaceId, weak_ptr<pit::Entry>(pitEntry)));
}
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 4dfe32e..3f364ea 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,7 +26,6 @@
#include "strategy.hpp"
#include "forwarder.hpp"
#include "core/logger.hpp"
-#include "core/random.hpp"
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>