ReactOS 0.4.16-dev-401-g45b008d
sequence_buffer< _Sequence, _Buf_sz > Class Template Reference

#include <_rope.h>

Inheritance diagram for sequence_buffer< _Sequence, _Buf_sz >:
Collaboration diagram for sequence_buffer< _Sequence, _Buf_sz >:

Public Types

typedef _Sequence::value_type value_type
 
typedef sequence_buffer< _Sequence, _Buf_sz > _Self
 
- Public Types inherited from iterator< output_iterator_tag, void, void, void, void >
typedef output_iterator_tag iterator_category
 

Public Member Functions

void flush ()
 
 ~sequence_buffer ()
 
 sequence_buffer ()
 
 sequence_buffer (const _Self &__x)
 
 sequence_buffer (_Self &__x)
 
 sequence_buffer (_Sequence &__s)
 
_Selfoperator= (_Self &__x)
 
_Selfoperator= (const _Self &__x)
 
void push_back (value_type __x)
 
void append (const value_type *__s, size_t __len)
 
_Selfwrite (const value_type *__s, size_t __len)
 
_Selfput (value_type __x)
 
_Selfoperator= (const value_type &__rhs)
 
_Selfoperator* ()
 
_Selfoperator++ ()
 
_Selfoperator++ (int)
 

Protected Attributes

_Sequence * _M_prefix
 
value_type _M_buffer [_Buf_sz]
 
size_t _M_buf_count
 

Detailed Description

template<class _Sequence, size_t _Buf_sz = 100>
class sequence_buffer< _Sequence, _Buf_sz >

Definition at line 194 of file _rope.h.

Member Typedef Documentation

◆ _Self

template<class _Sequence , size_t _Buf_sz = 100>
typedef sequence_buffer<_Sequence , _Buf_sz > sequence_buffer< _Sequence, _Buf_sz >::_Self

Definition at line 202 of file _rope.h.

◆ value_type

template<class _Sequence , size_t _Buf_sz = 100>
typedef _Sequence::value_type sequence_buffer< _Sequence, _Buf_sz >::value_type

Definition at line 197 of file _rope.h.

Constructor & Destructor Documentation

◆ ~sequence_buffer()

template<class _Sequence , size_t _Buf_sz = 100>
sequence_buffer< _Sequence, _Buf_sz >::~sequence_buffer ( )
inline

Definition at line 221 of file _rope.h.

221{ flush(); }
void flush()
Definition: _rope.h:217

◆ sequence_buffer() [1/4]

template<class _Sequence , size_t _Buf_sz = 100>
sequence_buffer< _Sequence, _Buf_sz >::sequence_buffer ( )
inline

Definition at line 222 of file _rope.h.

222: _M_prefix(0), _M_buf_count(0) {}
size_t _M_buf_count
Definition: _rope.h:215
_Sequence * _M_prefix
Definition: _rope.h:213

◆ sequence_buffer() [2/4]

template<class _Sequence , size_t _Buf_sz = 100>
sequence_buffer< _Sequence, _Buf_sz >::sequence_buffer ( const _Self __x)
inline

Definition at line 223 of file _rope.h.

223 {
224 _M_prefix = __x._M_prefix;
225 _M_buf_count = __x._M_buf_count;
226 _STLP_STD::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
227 }
value_type _M_buffer[_Buf_sz]
Definition: _rope.h:214

◆ sequence_buffer() [3/4]

template<class _Sequence , size_t _Buf_sz = 100>
sequence_buffer< _Sequence, _Buf_sz >::sequence_buffer ( _Self __x)
inline

Definition at line 228 of file _rope.h.

228 {
229 __x.flush();
230 _M_prefix = __x._M_prefix;
231 _M_buf_count = 0;
232 }

◆ sequence_buffer() [4/4]

template<class _Sequence , size_t _Buf_sz = 100>
sequence_buffer< _Sequence, _Buf_sz >::sequence_buffer ( _Sequence &  __s)
inline

Definition at line 233 of file _rope.h.

233: _M_prefix(&__s), _M_buf_count(0) {}

Member Function Documentation

◆ append()

template<class _Sequence , size_t _Buf_sz = 100>
void sequence_buffer< _Sequence, _Buf_sz >::append ( const value_type __s,
size_t  __len 
)
inline

Definition at line 256 of file _rope.h.

256 {
257 if (__len + _M_buf_count <= _Buf_sz) {
258 size_t __i = _M_buf_count;
259 size_t __j = 0;
260 for (; __j < __len; __i++, __j++) {
261 _M_buffer[__i] = __s[__j];
262 }
263 _M_buf_count += __len;
264 } else if (0 == _M_buf_count) {
265 _M_prefix->append(__s, __s + __len);
266 } else {
267 flush();
268 append(__s, __len);
269 }
270 }
void append(const value_type *__s, size_t __len)
Definition: _rope.h:256

Referenced by sequence_buffer< _Sequence, _Buf_sz >::append(), and sequence_buffer< _Sequence, _Buf_sz >::write().

◆ flush()

◆ operator*()

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::operator* ( )
inline

Definition at line 283 of file _rope.h.

283{ return *this; }

◆ operator++() [1/2]

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::operator++ ( )
inline

Definition at line 284 of file _rope.h.

284{ return *this; }

◆ operator++() [2/2]

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::operator++ ( int  )
inline

Definition at line 285 of file _rope.h.

285{ return *this; }

◆ operator=() [1/3]

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::operator= ( _Self __x)
inline

Definition at line 234 of file _rope.h.

234 {
235 __x.flush();
236 _M_prefix = __x._M_prefix;
237 _M_buf_count = 0;
238 return *this;
239 }

◆ operator=() [2/3]

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::operator= ( const _Self __x)
inline

Definition at line 240 of file _rope.h.

240 {
241 _M_prefix = __x._M_prefix;
242 _M_buf_count = __x._M_buf_count;
243 _STLP_STD::copy(__x._M_buffer, __x._M_buffer + __x._M_buf_count, _M_buffer);
244 return *this;
245 }

◆ operator=() [3/3]

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::operator= ( const value_type __rhs)
inline

Definition at line 279 of file _rope.h.

279 {
280 push_back(__rhs);
281 return *this;
282 }
void push_back(value_type __x)
Definition: _rope.h:246

◆ push_back()

template<class _Sequence , size_t _Buf_sz = 100>
void sequence_buffer< _Sequence, _Buf_sz >::push_back ( value_type  __x)
inline

Definition at line 246 of file _rope.h.

246 {
247 if (_M_buf_count < _Buf_sz) {
248 _M_buffer[_M_buf_count] = __x;
249 ++_M_buf_count;
250 } else {
251 flush();
252 _M_buffer[0] = __x;
253 _M_buf_count = 1;
254 }
255 }

Referenced by sequence_buffer< _Sequence, _Buf_sz >::operator=(), and sequence_buffer< _Sequence, _Buf_sz >::put().

◆ put()

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::put ( value_type  __x)
inline

Definition at line 275 of file _rope.h.

275 {
276 push_back(__x);
277 return *this;
278 }

◆ write()

template<class _Sequence , size_t _Buf_sz = 100>
_Self & sequence_buffer< _Sequence, _Buf_sz >::write ( const value_type __s,
size_t  __len 
)
inline

Definition at line 271 of file _rope.h.

271 {
272 append(__s, __len);
273 return *this;
274 }

Member Data Documentation

◆ _M_buf_count

◆ _M_buffer

◆ _M_prefix


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