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 discard_block &_Right)
 
 discard_block (discard_block &_Right)
 
 discard_block (const base_type &_Ex)
 
 discard_block (result_type _Seed)
 
template<class _Seed_seq , class = typename enable_if< !is_convertible<_Seed_seq, result_type>::value, void>::type>
 discard_block (_Seed_seq &_Seq)
 
void seed ()
 
void seed (result_type _X0)
 
template<class _Seed_seq >
enable_if< !is_convertible< _Seed_seq, result_type >::value, void >::type 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 const int block_size = _Px
 
static const 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
1666  : _Eng(), _Nx(0)
1667  { // construct
1668  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( const discard_block< _Engine, _Px, _Rx > &  _Right)
inline
1671  { // construct by copying
1672  *this = _Right;
1673  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( discard_block< _Engine, _Px, _Rx > &  _Right)
inline
1676  { // construct by copying
1677  *this = _Right;
1678  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( const base_type _Ex)
inlineexplicit
1681  : _Eng(_Ex), _Nx(0)
1682  { // construct with engine initializer _Ex
1683  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
discard_block< _Engine, _Px, _Rx >::discard_block ( result_type  _Seed)
inlineexplicit
1686  : _Eng(_Seed), _Nx(0)
1687  { // construct from specified seed value
1688  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
template<class _Seed_seq , class = typename enable_if< !is_convertible<_Seed_seq, result_type>::value, void>::type>
discard_block< _Engine, _Px, _Rx >::discard_block ( _Seed_seq &  _Seq)
inlineexplicit
1696  : _Eng(_Seq), _Nx(0)
1697  { // construct from seed sequence
1698  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780

Member Function Documentation

template<class _Engine, int _Px, int _Rx>
bool discard_block< _Engine, _Px, _Rx >::_Equals ( const _Myt _Right) const
inline
1758  { // return true if *this will generate same sequence as _Right
1759  return (_Eng == _Right._Eng && _Nx == _Right._Nx);
1760  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
const _Ty & _Right
Definition: algorithm:4087
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
1766  { // read state from _Istr
1767  return (_Istr >> _Eng >> _Nx);
1768  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
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
1774  { // write state to _Ostr
1775  return (_Ostr << _Eng << ' ' << _Nx);
1776  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
const base_type& discard_block< _Engine, _Px, _Rx >::base ( ) const
inline
1725  { // return const reference to engine
1726  return (_Eng);
1727  }
base_type _Eng
Definition: random:1779
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::discard ( unsigned long long  _Nskip)
inline
1752  { // discard _Nskip elements
1753  for (; 0 < _Nskip; --_Nskip)
1754  (*this)();
1755  }
template<class _Engine, int _Px, int _Rx>
result_type() discard_block< _Engine, _Px, _Rx >::max ( ) const
inline
1735  { // return maximum possible generated value
1736  return ((_Eng.max)());
1737  }
base_type _Eng
Definition: random:1779
template<class _Engine, int _Px, int _Rx>
result_type() discard_block< _Engine, _Px, _Rx >::min ( ) const
inline
1730  { // return minimum possible generated value
1731  return ((_Eng.min)());
1732  }
base_type _Eng
Definition: random:1779
template<class _Engine, int _Px, int _Rx>
result_type discard_block< _Engine, _Px, _Rx >::operator() ( )
inline
1740  { // return next value
1741  if (_Rx <= _Nx)
1742  { // discard values
1743  while (_Nx++ < _Px)
1744  _Eng();
1745  _Nx = 0;
1746  }
1747  ++_Nx;
1748  return (_Eng());
1749  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::seed ( )
inline
1702  { // seed engine from default value
1703  _Eng.seed();
1704  _Nx = 0;
1705  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
void discard_block< _Engine, _Px, _Rx >::seed ( result_type  _X0)
inline
1708  { // seed engine from specified value
1709  _Eng.seed(_X0);
1710  _Nx = 0;
1711  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780
template<class _Engine, int _Px, int _Rx>
template<class _Seed_seq >
enable_if< !is_convertible<_Seed_seq, result_type>::value, void>::type discard_block< _Engine, _Px, _Rx >::seed ( _Seed_seq &  _Seq)
inline
1718  { // seed engine from seed sequence
1719  _Eng.seed(_Seq);
1720  _Nx = 0;
1721  }
base_type _Eng
Definition: random:1779
int _Nx
Definition: random:1780

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: