STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
discard_block< _Engine, _Px, _Rx > Class Template Reference
Inheritance diagram for discard_block< _Engine, _Px, _Rx >:
discard_block_engine< _Engine, _Px, _Rx >

Public Types

typedef discard_block< _Engine, _Px, _Rx > _Myt
 
typedef _Engine base_type
 
typedef _Engine::result_type result_type
 

Public Member Functions

 discard_block ()
 
 discard_block (const _Engine &_Ex)
 
 discard_block (result_type _Seed)
 
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt, _Engine>::type>
 discard_block (_Seed_seq &_Seq)
 
void seed ()
 
void seed (result_type _X0)
 
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
void seed (_Seed_seq &_Seq)
 
const base_typebase () const _NOEXCEPT
 
result_type() min () const
 
result_type() max () const
 
result_type operator() ()
 
void discard (unsigned long long _Nskip)
 
bool _Equals (const _Myt &_Right) const
 
template<class _Elem , class _Traits >
basic_istream< _Elem, _Traits > & _Read (basic_istream< _Elem, _Traits > &_Istr)
 
template<class _Elem , class _Traits >
basic_ostream< _Elem, _Traits > & _Write (basic_ostream< _Elem, _Traits > &_Ostr) const
 

Static Public Attributes

static constexpr int block_size = _Px
 
static constexpr int used_block = _Rx
 

Private Attributes

base_type _Eng
 
int _Nx
 

Member Typedef Documentation

template<class _Engine, int _Px, int _Rx>
typedef discard_block<_Engine, _Px, _Rx> discard_block< _Engine, _Px, _Rx >::_Myt
template<class _Engine, int _Px, int _Rx>
typedef _Engine discard_block< _Engine, _Px, _Rx >::base_type
template<class _Engine, int _Px, int _Rx>
typedef _Engine::result_type discard_block< _Engine, _Px, _Rx >::result_type

Constructor & Destructor Documentation

template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( )
inline
1618  : _Eng(), _Nx(0)
1619  { // construct
1620  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( const _Engine &  _Ex)
inlineexplicit
1623  : _Eng(_Ex), _Nx(0)
1624  { // construct with engine initializer _Ex
1625  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( result_type  _Seed)
inlineexplicit
1628  : _Eng(_Seed), _Nx(0)
1629  { // construct from specified seed value
1630  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt, _Engine>::type>
discard_block< _Engine, _Px, _Rx >::discard_block ( _Seed_seq &  _Seq)
inlineexplicit
1636  : _Eng(_Seq), _Nx(0)
1637  { // construct from seed sequence
1638  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719

Member Function Documentation

template<class _Engine, int _Px, int _Rx>
bool discard_block< _Engine, _Px, _Rx >::_Equals ( const _Myt _Right) const
inline
1697  { // return true if *this will generate same sequence as _Right
1698  return (_Eng == _Right._Eng && _Nx == _Right._Nx);
1699  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Engine, int _Px, int _Rx>
template<class _Elem , class _Traits >
basic_istream<_Elem, _Traits>& discard_block< _Engine, _Px, _Rx >::_Read ( basic_istream< _Elem, _Traits > &  _Istr)
inline
1705  { // read state from _Istr
1706  return (_Istr >> _Eng >> _Nx);
1707  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
template<class _Elem , class _Traits >
basic_ostream<_Elem, _Traits>& discard_block< _Engine, _Px, _Rx >::_Write ( basic_ostream< _Elem, _Traits > &  _Ostr) const
inline
1713  { // write state to _Ostr
1714  return (_Ostr << _Eng << ' ' << _Nx);
1715  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
const base_type& discard_block< _Engine, _Px, _Rx >::base ( ) const
inline
1664  { // return const reference to engine
1665  return (_Eng);
1666  }
base_type _Eng
Definition: random:1718
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::discard ( unsigned long long  _Nskip)
inline
1691  { // discard _Nskip elements
1692  for (; 0 < _Nskip; --_Nskip)
1693  (*this)();
1694  }
template<class _Engine, int _Px, int _Rx>
result_type() discard_block< _Engine, _Px, _Rx >::max ( ) const
inline
1674  { // return maximum possible generated value
1675  return ((_Eng.max)());
1676  }
base_type _Eng
Definition: random:1718
template<class _Engine, int _Px, int _Rx>
result_type() discard_block< _Engine, _Px, _Rx >::min ( ) const
inline
1669  { // return minimum possible generated value
1670  return ((_Eng.min)());
1671  }
base_type _Eng
Definition: random:1718
template<class _Engine, int _Px, int _Rx>
result_type discard_block< _Engine, _Px, _Rx >::operator() ( )
inline
1679  { // return next value
1680  if (_Rx <= _Nx)
1681  { // discard values
1682  while (_Nx++ < _Px)
1683  _Eng();
1684  _Nx = 0;
1685  }
1686  ++_Nx;
1687  return (_Eng());
1688  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::seed ( )
inline
1642  { // seed engine from default value
1643  _Eng.seed();
1644  _Nx = 0;
1645  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::seed ( result_type  _X0)
inline
1648  { // seed engine from specified value
1649  _Eng.seed(_X0);
1650  _Nx = 0;
1651  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719
template<class _Engine, int _Px, int _Rx>
template<class _Seed_seq , class = typename _Enable_if_seed_seq<_Seed_seq, _Myt>::type>
void discard_block< _Engine, _Px, _Rx >::seed ( _Seed_seq &  _Seq)
inline
1657  { // seed engine from seed sequence
1658  _Eng.seed(_Seq);
1659  _Nx = 0;
1660  }
base_type _Eng
Definition: random:1718
int _Nx
Definition: random:1719

Member Data Documentation

template<class _Engine, int _Px, int _Rx>
base_type discard_block< _Engine, _Px, _Rx >::_Eng
private
template<class _Engine, int _Px, int _Rx>
int discard_block< _Engine, _Px, _Rx >::_Nx
private
template<class _Engine, int _Px, int _Rx>
const int discard_block< _Engine, _Px, _Rx >::block_size = _Px
static
template<class _Engine, int _Px, int _Rx>
const int discard_block< _Engine, _Px, _Rx >::used_block = _Rx
static

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