STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | List of all members
_Vb_reference< _Alloc > Class Template Reference
Inheritance diagram for _Vb_reference< _Alloc >:
_Vb_iter_base< _Alloc > _Iterator012< random_access_iterator_tag, _Bool, _Alloc::difference_type, bool *, bool, _Iterator_base > _Iterator_base0

Public Member Functions

 _Vb_reference (const _Mybase &_Right)
 
_Mytypeoperator= (const _Mytype &_Right) _NOEXCEPT
 
_Mytypeoperator= (bool _Val) _NOEXCEPT
 
void flip () _NOEXCEPT
 
 operator bool () const _NOEXCEPT
 
const _Vbase_Getptr () const
 
- Public Member Functions inherited from _Vb_iter_base< _Alloc >
 _Vb_iter_base ()
 
 _Vb_iter_base (const _Vbase *_Ptr, _Sizet _Off, const _Container_base *_Mypvbool)
 
void _Advance (_Sizet _Off)
 
int _Valid (_Sizet _Inc) const
 
- Public Member Functions inherited from _Iterator_base0
void _Adopt (const void *)
 
const _Container_base0_Getcont () const
 

Protected Member Functions

_Vbase _Mask () const
 

Private Types

typedef _Vb_iter_base< _Alloc > _Mybase
 
typedef _Vb_reference< _Alloc > _Mytype
 

Private Member Functions

 _Vb_reference () _NOEXCEPT
 

Additional Inherited Members

- Public Types inherited from _Vb_iter_base< _Alloc >
typedef _Alloc::size_type _Sizet
 
typedef vector< _Bool, _Alloc > _Mycont
 
- Public Types inherited from _Iterator012< random_access_iterator_tag, _Bool, _Alloc::difference_type, bool *, bool, _Iterator_base >
typedef random_access_iterator_tag iterator_category
 
typedef _Bool value_type
 
typedef _Alloc::difference_type difference_type
 
typedef _Alloc::difference_type distance_type
 
typedef boolpointer
 
typedef bool reference
 
- Public Attributes inherited from _Vb_iter_base< _Alloc >
const _Vbase_Myptr
 
_Sizet _Myoff
 

Member Typedef Documentation

template<class _Alloc>
typedef _Vb_iter_base<_Alloc> _Vb_reference< _Alloc >::_Mybase
private
template<class _Alloc>
typedef _Vb_reference<_Alloc> _Vb_reference< _Alloc >::_Mytype
private

Constructor & Destructor Documentation

template<class _Alloc>
_Vb_reference< _Alloc >::_Vb_reference ( )
inlineprivate
1912  { // construct with null pointer (private)
1913  }
template<class _Alloc>
_Vb_reference< _Alloc >::_Vb_reference ( const _Mybase _Right)
inline
1917  : _Mybase(_Right._Myptr, _Right._Myoff, _Right._Getcont())
1918  { // construct with base
1919  }
_Vb_iter_base< _Alloc > _Mybase
Definition: vector:1908
const _Ty & _Right
Definition: algorithm:4087

Member Function Documentation

template<class _Alloc>
const _Vbase* _Vb_reference< _Alloc >::_Getptr ( ) const
inline
1946  { // get pointer to base word
1947  #if _ITERATOR_DEBUG_LEVEL == 2
1948  if (this->_Getcont() == 0
1949  || this->_Myptr == 0
1950  || 0 <= this->_Valid(0))
1951  { // report error
1952  _DEBUG_ERROR("vector<bool> iterator not dereferencable");
1954  }
1955 
1956  #elif _ITERATOR_DEBUG_LEVEL == 1
1957  _SCL_SECURE_VALIDATE(this->_Getcont() != 0 && this->_Myptr != 0);
1958  _SCL_SECURE_VALIDATE_RANGE(this->_Valid(0) < 0);
1959  #endif /* _ITERATOR_DEBUG_LEVEL */
1960 
1961  return (this->_Myptr);
1962  }
const _Container_base0 * _Getcont() const
Definition: xutility:57
#define _SCL_SECURE_OUT_OF_RANGE
Definition: yvals.h:351
const _Vbase * _Myptr
Definition: vector:1899
int _Valid(_Sizet _Inc) const
Definition: vector:1883
#define _SCL_SECURE_VALIDATE_RANGE(cond)
Definition: yvals.h:347
#define _DEBUG_ERROR(mesg)
Definition: xutility:32
#define _SCL_SECURE_VALIDATE(cond)
Definition: yvals.h:346
template<class _Alloc>
_Vbase _Vb_reference< _Alloc >::_Mask ( ) const
inlineprotected
1966  { // convert offset to mask
1967  return ((_Vbase)(1 << this->_Myoff));
1968  }
unsigned int _Vbase
Definition: vector:1847
_Sizet _Myoff
Definition: vector:1900
template<class _Alloc>
void _Vb_reference< _Alloc >::flip ( )
inline
1936  { // toggle the bit
1937  *(_Vbase *)_Getptr() ^= _Mask();
1938  }
const _Vbase * _Getptr() const
Definition: vector:1945
unsigned int _Vbase
Definition: vector:1847
_Vbase _Mask() const
Definition: vector:1965
template<class _Alloc>
_Vb_reference< _Alloc >::operator bool ( ) const
inline
1941  { // test if bit is set
1942  return ((*_Getptr() & _Mask()) != 0);
1943  }
const _Vbase * _Getptr() const
Definition: vector:1945
_Vbase _Mask() const
Definition: vector:1965
template<class _Alloc>
_Mytype& _Vb_reference< _Alloc >::operator= ( const _Mytype _Right)
inline
1922  { // assign _Vb_reference _Right to bit
1923  return (*this = bool(_Right));
1924  }
const _Ty & _Right
Definition: algorithm:4087
template<class _Alloc>
_Mytype& _Vb_reference< _Alloc >::operator= ( bool  _Val)
inline
1927  { // assign _Val to bit
1928  if (_Val)
1929  *(_Vbase *)_Getptr() |= _Mask();
1930  else
1931  *(_Vbase *)_Getptr() &= (~_Mask()); // STET
1932  return (*this);
1933  }
const _Vbase * _Getptr() const
Definition: vector:1945
unsigned int _Vbase
Definition: vector:1847
_Vbase _Mask() const
Definition: vector:1965
_FwdIt const _Ty _Val
Definition: algorithm:1938

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