STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
_Temp_iterator< _Ty > Class Template Reference
Inheritance diagram for _Temp_iterator< _Ty >:
iterator< _Category, _Ty, _Diff, _Pointer, _Reference >

Classes

struct  _Bufpar
 

Public Types

typedef _Ty * _Pty
 
- Public Types inherited from iterator< _Category, _Ty, _Diff, _Pointer, _Reference >
typedef _Category iterator_category
 
typedef _Ty value_type
 
typedef _Diff difference_type
 
typedef _Diff distance_type
 
typedef _Pointer pointer
 
typedef _Reference reference
 

Public Member Functions

 _Temp_iterator (ptrdiff_t _Count=0)
 
 _Temp_iterator (const _Temp_iterator< _Ty > &_Right)
 
 ~_Temp_iterator () _NOEXCEPT
 
_Temp_iterator< _Ty > & operator= (const _Temp_iterator< _Ty > &_Right)
 
_Temp_iterator< _Ty > & operator= (const _Ty &_Val)
 
_Temp_iterator< _Ty > & operator= (_Ty &&_Val)
 
_Temp_iterator< _Ty > & operator* ()
 
_Temp_iterator< _Ty > & operator++ ()
 
_Temp_iterator< _Ty > & operator++ (int)
 
_Temp_iterator< _Ty > & _Init ()
 
_Pty _First () const
 
_Pty _Last () const
 
ptrdiff_t _Maxlen ()
 

Private Attributes

_Bufpar _Buf
 
_Bufpar_Pbuf
 

Member Typedef Documentation

template<class _Ty>
typedef _Ty* _Temp_iterator< _Ty >::_Pty

Constructor & Destructor Documentation

template<class _Ty>
_Temp_iterator< _Ty >::_Temp_iterator ( ptrdiff_t  _Count = 0)
inline
748  { // construct from desired temporary buffer size
749  _Buf._Begin = 0;
750  _Buf._Current = 0;
751  _Buf._Hiwater = 0;
752  _Buf._Size = _Count; // memorize size for lazy allocation
753  _Pbuf = &_Buf;
754  }
_Bufpar * _Pbuf
Definition: xmemory:865
Definition: regex:1520
_Bufpar _Buf
Definition: xmemory:864
int _Size() const
Definition: regex:1532
_Diff _Count
Definition: algorithm:1941
template<class _Ty>
_Temp_iterator< _Ty >::_Temp_iterator ( const _Temp_iterator< _Ty > &  _Right)
inline
757  { // construct from _Right (share active buffer)
758  _Buf._Begin = 0; // clear stored buffer, for safe destruction
759  _Buf._Current = 0;
760  _Buf._Hiwater = 0;
761  _Buf._Size = 0;
762  *this = _Right;
763  }
Definition: regex:1520
int _Size() const
Definition: regex:1532
const _Ty & _Right
Definition: algorithm:4087
template<class _Ty>
_Temp_iterator< _Ty >::~_Temp_iterator ( )
inline
766  { // destroy the object
767  if (_Buf._Begin != 0)
768  { // destroy any constructed elements in buffer
769  for (_Pty _Next = _Buf._Begin;
770  _Next != _Buf._Hiwater; ++_Next)
771  _Destroy(&*_Next);
773  }
774  }
Definition: regex:1520
void _Destroy(_Ty *_Ptr)
Definition: xmemory0:53
void return_temporary_buffer(_Ty *_Pbuf)
Definition: xmemory:39
_Ty * _Pty
Definition: xmemory:745

Member Function Documentation

template<class _Ty>
_Pty _Temp_iterator< _Ty >::_First ( ) const
inline
831  { // return pointer to beginning of buffer
832  return (_Pbuf->_Begin);
833  }
_Bufpar * _Pbuf
Definition: xmemory:865
_Pty _Begin
Definition: xmemory:859
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::_Init ( )
inline
825  { // set pointer at beginning of buffer
827  return (*this);
828  }
_Bufpar * _Pbuf
Definition: xmemory:865
_Pty _Begin
Definition: xmemory:859
_Pty _Current
Definition: xmemory:860
template<class _Ty>
_Pty _Temp_iterator< _Ty >::_Last ( ) const
inline
836  { // return pointer past end of buffer contents
837  return (_Pbuf->_Current);
838  }
_Bufpar * _Pbuf
Definition: xmemory:865
_Pty _Current
Definition: xmemory:860
template<class _Ty>
ptrdiff_t _Temp_iterator< _Ty >::_Maxlen ( )
inline
841  { // return size of buffer
842  if (_Pbuf->_Begin == 0 && 0 < _Pbuf->_Size)
843  { // allocate buffer on first size query
844  pair<_Pty, ptrdiff_t> _Pair =
845 
846  _STD get_temporary_buffer<_Ty>(_Pbuf->_Size);
847 
848  _Pbuf->_Begin = _Pair.first;
849  _Pbuf->_Current = _Pair.first;
850  _Pbuf->_Hiwater = _Pair.first;
851  _Pbuf->_Size = _Pair.second;
852  }
853  return (_Pbuf->_Size);
854  }
_Bufpar * _Pbuf
Definition: xmemory:865
ptrdiff_t _Size
Definition: xmemory:862
_Pty _Begin
Definition: xmemory:859
_Ty1 first
Definition: utility:198
_Pty _Current
Definition: xmemory:860
Definition: utility:80
second
Definition: utility:167
_Pty _Hiwater
Definition: xmemory:861
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::operator* ( )
inline
810  { // pretend to return designated value
811  return (*this);
812  }
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::operator++ ( )
inline
815  { // pretend to preincrement
816  return (*this);
817  }
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::operator++ ( int  )
inline
820  { // pretend to postincrement
821  return (*this);
822  }
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::operator= ( const _Temp_iterator< _Ty > &  _Right)
inline
777  { // assign _Right (share active buffer)
778  _Pbuf = _Right._Pbuf;
779  return (*this);
780  }
_Bufpar * _Pbuf
Definition: xmemory:865
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::operator= ( const _Ty &  _Val)
inline
783  { // assign or construct value into active buffer, and increment
784  if (_Pbuf->_Current < _Pbuf->_Hiwater)
785  *_Pbuf->_Current++ = _Val; // below high water mark, assign
786  else
787  { // above high water mark, construct
788  _Pty _Ptr = &*_Pbuf->_Current;
789  _Construct(_Ptr, _Val);
791  }
792  return (*this);
793  }
_Bufpar * _Pbuf
Definition: xmemory:865
void _Construct(_Ty1 *_Ptr, _Ty2 &&_Val)
Definition: xmemory0:37
_Pty _Current
Definition: xmemory:860
_Ty * _Pty
Definition: xmemory:745
_FwdIt const _Ty _Val
Definition: algorithm:1938
_Pty _Hiwater
Definition: xmemory:861
template<class _Ty>
_Temp_iterator<_Ty>& _Temp_iterator< _Ty >::operator= ( _Ty &&  _Val)
inline
796  { // move or construct value into active buffer, and increment
797  if (_Pbuf->_Current < _Pbuf->_Hiwater)
798  *_Pbuf->_Current++ =
799  _STD forward<_Ty>(_Val); // below high water mark, move
800  else
801  { // above high water mark, construct
802  _Pty _Ptr = &*_Pbuf->_Current;
803  _Construct(_Ptr, _STD forward<_Ty>(_Val));
805  }
806  return (*this);
807  }
_Bufpar * _Pbuf
Definition: xmemory:865
void _Construct(_Ty1 *_Ptr, _Ty2 &&_Val)
Definition: xmemory0:37
_Pty _Current
Definition: xmemory:860
_Ty * _Pty
Definition: xmemory:745
_FwdIt const _Ty _Val
Definition: algorithm:1938
_Pty _Hiwater
Definition: xmemory:861

Member Data Documentation

template<class _Ty>
_Bufpar _Temp_iterator< _Ty >::_Buf
private
template<class _Ty>
_Bufpar* _Temp_iterator< _Ty >::_Pbuf
private

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