ReactOS  0.4.13-dev-922-g2fbff73
_Deque_base< _Tp, _Alloc > Class Template Reference

#include <_deque.h>

Collaboration diagram for _Deque_base< _Tp, _Alloc >:

Public Types

typedef _Tp value_type
 
typedef _Alloc allocator_type
 
typedef _STLP_alloc_proxy< size_t, value_type, allocator_type_Alloc_proxy
 
typedef _Alloc_traits< _Tp *, _Alloc >::allocator_type _Map_alloc_type
 
typedef _STLP_alloc_proxy< value_type **, value_type *, _Map_alloc_type_Map_alloc_proxy
 
typedef _Deque_iterator< _Tp, _Nonconst_traits< _Tp > > iterator
 
typedef _Deque_iterator< _Tp, _Const_traits< _Tp > > const_iterator
 

Public Member Functions

 _Deque_base (const allocator_type &__a, size_t __num_elements)
 
 _Deque_base (const allocator_type &__a)
 
 _Deque_base (__move_source< _Self > src)
 
 ~_Deque_base ()
 

Static Public Member Functions

static size_t _STLP_CALL buffer_size ()
 

Protected Types

enum  { _S_initial_map_size = 8 }
 

Protected Member Functions

void _M_initialize_map (size_t)
 
void _M_create_nodes (_Tp **__nstart, _Tp **__nfinish)
 
void _M_destroy_nodes (_Tp **__nstart, _Tp **__nfinish)
 

Protected Attributes

iterator _M_start
 
iterator _M_finish
 
_Map_alloc_proxy _M_map
 
_Alloc_proxy _M_map_size
 

Private Types

typedef _Deque_base< _Tp, _Alloc_Self
 

Detailed Description

template<class _Tp, class _Alloc>
class _Deque_base< _Tp, _Alloc >

Definition at line 340 of file _deque.h.

Member Typedef Documentation

◆ _Alloc_proxy

template<class _Tp, class _Alloc>
typedef _STLP_alloc_proxy<size_t, value_type, allocator_type> _Deque_base< _Tp, _Alloc >::_Alloc_proxy

Definition at line 346 of file _deque.h.

◆ _Map_alloc_proxy

template<class _Tp, class _Alloc>
typedef _STLP_alloc_proxy<value_type**, value_type*, _Map_alloc_type> _Deque_base< _Tp, _Alloc >::_Map_alloc_proxy

Definition at line 349 of file _deque.h.

◆ _Map_alloc_type

template<class _Tp, class _Alloc>
typedef _Alloc_traits<_Tp*, _Alloc>::allocator_type _Deque_base< _Tp, _Alloc >::_Map_alloc_type

Definition at line 348 of file _deque.h.

◆ _Self

template<class _Tp, class _Alloc>
typedef _Deque_base<_Tp, _Alloc> _Deque_base< _Tp, _Alloc >::_Self
private

Definition at line 341 of file _deque.h.

◆ allocator_type

template<class _Tp, class _Alloc>
typedef _Alloc _Deque_base< _Tp, _Alloc >::allocator_type

Definition at line 345 of file _deque.h.

◆ const_iterator

template<class _Tp, class _Alloc>
typedef _Deque_iterator<_Tp, _Const_traits<_Tp> > _Deque_base< _Tp, _Alloc >::const_iterator

Definition at line 352 of file _deque.h.

◆ iterator

template<class _Tp, class _Alloc>
typedef _Deque_iterator<_Tp, _Nonconst_traits<_Tp> > _Deque_base< _Tp, _Alloc >::iterator

Definition at line 351 of file _deque.h.

◆ value_type

template<class _Tp, class _Alloc>
typedef _Tp _Deque_base< _Tp, _Alloc >::value_type

Definition at line 343 of file _deque.h.

Member Enumeration Documentation

◆ anonymous enum

template<class _Tp, class _Alloc>
anonymous enum
protected
Enumerator
_S_initial_map_size 

Definition at line 382 of file _deque.h.

Constructor & Destructor Documentation

◆ _Deque_base() [1/3]

template<class _Tp, class _Alloc>
_Deque_base< _Tp, _Alloc >::_Deque_base ( const allocator_type __a,
size_t  __num_elements 
)
inline

Definition at line 356 of file _deque.h.

357  : _M_start(), _M_finish(), _M_map(_STLP_CONVERT_ALLOCATOR(__a, _Tp*), 0),
358  _M_map_size(__a, (size_t)0)
359  { _M_initialize_map(__num_elements); }
#define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
Definition: _alloc.h:183
iterator _M_start
Definition: _deque.h:385
void _M_initialize_map(size_t)
Definition: _deque.c:48
_Map_alloc_proxy _M_map
Definition: _deque.h:387
_Alloc_proxy _M_map_size
Definition: _deque.h:388
iterator _M_finish
Definition: _deque.h:386

◆ _Deque_base() [2/3]

template<class _Tp, class _Alloc>
_Deque_base< _Tp, _Alloc >::_Deque_base ( const allocator_type __a)
inline

Definition at line 361 of file _deque.h.

362  : _M_start(), _M_finish(), _M_map(_STLP_CONVERT_ALLOCATOR(__a, _Tp*), 0),
363  _M_map_size(__a, (size_t)0) {}
#define _STLP_CONVERT_ALLOCATOR(__a, _Tp)
Definition: _alloc.h:183
iterator _M_start
Definition: _deque.h:385
_Map_alloc_proxy _M_map
Definition: _deque.h:387
_Alloc_proxy _M_map_size
Definition: _deque.h:388
iterator _M_finish
Definition: _deque.h:386

◆ _Deque_base() [3/3]

template<class _Tp, class _Alloc>
_Deque_base< _Tp, _Alloc >::_Deque_base ( __move_source< _Self src)
inline

Definition at line 366 of file _deque.h.

367  : _M_start(src.get()._M_start), _M_finish(src.get()._M_finish),
369  _M_map_size(__move_source<_Alloc_proxy>(src.get()._M_map_size)) {
370  src.get()._M_map._M_data = 0;
371  src.get()._M_map_size._M_data = 0;
372  src.get()._M_finish = src.get()._M_start;
373  }
iterator _M_start
Definition: _deque.h:385
_Value _M_data
Definition: _alloc.h:478
_Map_alloc_proxy _M_map
Definition: _deque.h:387
GLenum src
Definition: glext.h:6340
_Alloc_proxy _M_map_size
Definition: _deque.h:388
iterator _M_finish
Definition: _deque.h:386

◆ ~_Deque_base()

template<class _Tp , class _Alloc >
_STLP_BEGIN_NAMESPACE _STLP_MOVE_TO_PRIV_NAMESPACE _Deque_base< _Tp, _Alloc >::~_Deque_base ( )

Definition at line 40 of file _deque.c.

40  {
41  if (_M_map._M_data) {
42  _M_destroy_nodes(_M_start._M_node, this->_M_finish._M_node + 1);
44  }
45 }
iterator _M_start
Definition: _deque.h:385
_Value _M_data
Definition: _alloc.h:478
_Map_alloc_proxy _M_map
Definition: _deque.h:387
_Map_pointer _M_node
Definition: _deque.h:104
_Alloc_proxy _M_map_size
Definition: _deque.h:388
void _M_destroy_nodes(_Tp **__nstart, _Tp **__nfinish)
Definition: _deque.c:80

Member Function Documentation

◆ _M_create_nodes()

template<class _Tp, class _Alloc >
void _Deque_base< _Tp, _Alloc >::_M_create_nodes ( _Tp **  __nstart,
_Tp **  __nfinish 
)
protected

Definition at line 69 of file _deque.c.

70  {
71  _Tp** __cur = __nstart;
72  _STLP_TRY {
73  for (; __cur < __nfinish; ++__cur)
74  *__cur = _M_map_size.allocate(this->buffer_size());
75  }
76  _STLP_UNWIND(_M_destroy_nodes(__nstart, __cur))
77 }
_Tp * allocate(size_type __n, size_type &__allocated_n)
Definition: _alloc.h:525
#define _STLP_UNWIND(action)
Definition: features.h:824
_Alloc_proxy _M_map_size
Definition: _deque.h:388
#define _STLP_TRY
Definition: features.h:817
void _M_destroy_nodes(_Tp **__nstart, _Tp **__nfinish)
Definition: _deque.c:80

◆ _M_destroy_nodes()

template<class _Tp, class _Alloc >
void _Deque_base< _Tp, _Alloc >::_M_destroy_nodes ( _Tp **  __nstart,
_Tp **  __nfinish 
)
protected

Definition at line 80 of file _deque.c.

81  {
82  for (_Tp** __n = __nstart; __n < __nfinish; ++__n)
83  _M_map_size.deallocate(*__n, this->buffer_size());
84 }
return __n
Definition: _algo.h:75
_Alloc_proxy _M_map_size
Definition: _deque.h:388

◆ _M_initialize_map()

template<class _Tp , class _Alloc >
void _Deque_base< _Tp, _Alloc >::_M_initialize_map ( size_t  __num_elements)
protected

Definition at line 48 of file _deque.c.

48  {
49  size_t __num_nodes = __num_elements / this->buffer_size() + 1 ;
50 
51  _M_map_size._M_data = (max)((size_t) _S_initial_map_size, __num_nodes + 2);
53 
54  _Tp** __nstart = _M_map._M_data + (_M_map_size._M_data - __num_nodes) / 2;
55  _Tp** __nfinish = __nstart + __num_nodes;
56 
57  _STLP_TRY {
58  _M_create_nodes(__nstart, __nfinish);
59  }
62  _M_start._M_set_node(__nstart);
63  this->_M_finish._M_set_node(__nfinish - 1);
64  _M_start._M_cur = _M_start._M_first;
65  this->_M_finish._M_cur = this->_M_finish._M_first + __num_elements % this->buffer_size();
66 }
iterator _M_start
Definition: _deque.h:385
#define max(a, b)
Definition: svc.c:63
static size_t _STLP_CALL buffer_size()
Definition: _deque.h:354
_Value _M_data
Definition: _alloc.h:478
_Tp * allocate(size_type __n, size_type &__allocated_n)
Definition: _alloc.h:525
#define _STLP_UNWIND(action)
Definition: features.h:824
_Map_alloc_proxy _M_map
Definition: _deque.h:387
_Alloc_proxy _M_map_size
Definition: _deque.h:388
#define _STLP_TRY
Definition: features.h:817
iterator _M_finish
Definition: _deque.h:386
void _M_create_nodes(_Tp **__nstart, _Tp **__nfinish)
Definition: _deque.c:69

Referenced by _Deque_base< String, _Alloc >::_Deque_base().

◆ buffer_size()

template<class _Tp, class _Alloc>
static size_t _STLP_CALL _Deque_base< _Tp, _Alloc >::buffer_size ( )
inlinestatic

Definition at line 354 of file _deque.h.

static size_t _S_buffer_size()
Definition: _deque.h:86

Member Data Documentation

◆ _M_finish

template<class _Tp, class _Alloc>
iterator _Deque_base< _Tp, _Alloc >::_M_finish
protected

Definition at line 386 of file _deque.h.

◆ _M_map

template<class _Tp, class _Alloc>
_Map_alloc_proxy _Deque_base< _Tp, _Alloc >::_M_map
protected

Definition at line 387 of file _deque.h.

◆ _M_map_size

template<class _Tp, class _Alloc>
_Alloc_proxy _Deque_base< _Tp, _Alloc >::_M_map_size
protected

Definition at line 388 of file _deque.h.

◆ _M_start

template<class _Tp, class _Alloc>
iterator _Deque_base< _Tp, _Alloc >::_M_start
protected

Definition at line 385 of file _deque.h.


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