NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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 Thu Nov 2 2017 03:30:29 for ndnSIM by
1.8.11