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
1585  : _Eng(), _Nx(0)
1586  { // construct
1587  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( const _Engine &  _Ex)
inlineexplicit
1590  : _Eng(_Ex), _Nx(0)
1591  { // construct with engine initializer _Ex
1592  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( result_type  _Seed)
inlineexplicit
1595  : _Eng(_Seed), _Nx(0)
1596  { // construct from specified seed value
1597  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
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
1603  : _Eng(_Seq), _Nx(0)
1604  { // construct from seed sequence
1605  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686

Member Function Documentation

template<class _Engine, int _Px, int _Rx>
bool discard_block< _Engine, _Px, _Rx >::_Equals ( const _Myt _Right) const
inline
1664  { // return true if *this will generate same sequence as _Right
1665  return (_Eng == _Right._Eng && _Nx == _Right._Nx);
1666  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
constexpr const _Ty &() _Right
Definition: algorithm:3591
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
1672  { // read state from _Istr
1673  return (_Istr >> _Eng >> _Nx);
1674  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
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
1680  { // write state to _Ostr
1681  return (_Ostr << _Eng << ' ' << _Nx);
1682  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
template<class _Engine, int _Px, int _Rx>
const base_type& discard_block< _Engine, _Px, _Rx >::base ( ) const
inline
1631  { // return const reference to engine
1632  return (_Eng);
1633  }
base_type _Eng
Definition: random:1685
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::discard ( unsigned long long  _Nskip)
inline
1658  { // discard _Nskip elements
1659  for (; 0 < _Nskip; --_Nskip)
1660  (*this)();
1661  }
template<class _Engine, int _Px, int _Rx>
result_type() discard_block< _Engine, _Px, _Rx >::max ( ) const
inline
1641  { // return maximum possible generated value
1642  return ((_Eng.max)());
1643  }
base_type _Eng
Definition: random:1685
template<class _Engine, int _Px, int _Rx>
result_type() discard_block< _Engine, _Px, _Rx >::min ( ) const
inline
1636  { // return minimum possible generated value
1637  return ((_Eng.min)());
1638  }
base_type _Eng
Definition: random:1685
template<class _Engine, int _Px, int _Rx>
result_type discard_block< _Engine, _Px, _Rx >::operator() ( )
inline
1646  { // return next value
1647  if (_Rx <= _Nx)
1648  { // discard values
1649  while (_Nx++ < _Px)
1650  _Eng();
1651  _Nx = 0;
1652  }
1653  ++_Nx;
1654  return (_Eng());
1655  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::seed ( )
inline
1609  { // seed engine from default value
1610  _Eng.seed();
1611  _Nx = 0;
1612  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::seed ( result_type  _X0)
inline
1615  { // seed engine from specified value
1616  _Eng.seed(_X0);
1617  _Nx = 0;
1618  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686
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
1624  { // seed engine from seed sequence
1625  _Eng.seed(_Seq);
1626  _Nx = 0;
1627  }
base_type _Eng
Definition: random:1685
int _Nx
Definition: random:1686

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: