NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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 static boost::thread_specific_ptr<boost::random::mt19937> g_rng;
32 
33 boost::random::mt19937&
35 {
36  if (g_rng.get() == nullptr) {
37  g_rng.reset(new boost::random::mt19937());
38  }
39  return *g_rng;
40 }
41 
42 void
44 {
45  g_rng.reset();
46 }
47 
48 } // namespace nfd
static boost::thread_specific_ptr< boost::random::mt19937 > g_rng
Definition: random.cpp:31
void resetGlobalRng()
Definition: random.cpp:43
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
boost::random::mt19937 & getGlobalRng()
Definition: random.cpp:34