NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
random.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
random.hpp
"
27
#include <boost/thread/tss.hpp>
28
29
namespace
nfd
{
30
31
std::mt19937&
32
getGlobalRng
()
33
{
34
static
boost::thread_specific_ptr<std::mt19937> rng;
35
if
(rng.get() ==
nullptr
) {
36
std::random_device rd;
37
rng.reset(
new
std::mt19937(rd()));
38
}
39
return
*rng;
40
}
41
42
}
// namespace nfd
random.hpp
Declares the global pseudorandom number generator (PRNG) for NFD.
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::getGlobalRng
std::mt19937 & getGlobalRng()
Definition:
random.cpp:32
ndnSIM
NFD
core
random.cpp
Generated on Tue Aug 7 2018 16:19:17 for ndnSIM by
1.8.14