A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::UniformRandomBitGenerator Class Reference

Wraps a UniformRandomVariable into a class that meets the requirements of a UniformRandomBitGenerator as specified by the C++11 standard, thus allowing the usage of ns-3 style UniformRandomVariables as generators in the functions of the standard random library. More...

#include "uniform-random-bit-generator.h"

+ Collaboration diagram for ns3::UniformRandomBitGenerator:

Public Types

using result_type = uint32_t
 Typedef needed to meet requirements. Result type must be an unsigned integer type.
 

Public Member Functions

 UniformRandomBitGenerator ()
 
Ptr< UniformRandomVariableGetRv () const
 
result_type operator() ()
 

Static Public Member Functions

static constexpr result_type max ()
 
static constexpr result_type min ()
 

Private Attributes

Ptr< UniformRandomVariablem_rv
 ns-3 style uniform random variable
 

Detailed Description

Wraps a UniformRandomVariable into a class that meets the requirements of a UniformRandomBitGenerator as specified by the C++11 standard, thus allowing the usage of ns-3 style UniformRandomVariables as generators in the functions of the standard random library.

Definition at line 35 of file uniform-random-bit-generator.h.

Member Typedef Documentation

◆ result_type

Typedef needed to meet requirements. Result type must be an unsigned integer type.

Definition at line 52 of file uniform-random-bit-generator.h.

Constructor & Destructor Documentation

◆ UniformRandomBitGenerator()

ns3::UniformRandomBitGenerator::UniformRandomBitGenerator ( )
inline

Definition at line 38 of file uniform-random-bit-generator.h.

Member Function Documentation

◆ GetRv()

Ptr< UniformRandomVariable > ns3::UniformRandomBitGenerator::GetRv ( ) const
inline
Returns
the ns-3 style uniform random variable

Definition at line 46 of file uniform-random-bit-generator.h.

References m_rv.

Referenced by ns3::Txop::Txop(), and ns3::WifiMac::AssignStreams().

+ Here is the caller graph for this function:

◆ max()

static constexpr result_type ns3::UniformRandomBitGenerator::max ( )
inlinestaticconstexpr
Returns
the largest value that operator() may return

Definition at line 65 of file uniform-random-bit-generator.h.

Referenced by operator()().

+ Here is the caller graph for this function:

◆ min()

static constexpr result_type ns3::UniformRandomBitGenerator::min ( )
inlinestaticconstexpr
Returns
the smallest value that operator() may return

Definition at line 57 of file uniform-random-bit-generator.h.

Referenced by operator()().

+ Here is the caller graph for this function:

◆ operator()()

result_type ns3::UniformRandomBitGenerator::operator() ( )
inline
Returns
a value in the closed interval [min(), max()]

Definition at line 73 of file uniform-random-bit-generator.h.

References ns3::UniformRandomVariable::GetInteger(), m_rv, max(), and min().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_rv

Ptr<UniformRandomVariable> ns3::UniformRandomBitGenerator::m_rv
private

ns-3 style uniform random variable

Definition at line 79 of file uniform-random-bit-generator.h.

Referenced by GetRv(), and operator()().


The documentation for this class was generated from the following file: