STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
cliext::impl::vector_impl< _Value_t, _Is_ref > Class Template Reference
Inheritance diagram for cliext::impl::vector_impl< _Value_t, _Is_ref >:
cliext::impl::vector_base< _Value_t, _Is_ref > cliext::impl::vector_select< _Value_t, _Is_ref > cliext::impl::vector_select< _Value_t, __is_ref_class(_Dehandle< _Value_t >::type)&&!is_handle< _Value_t >::value > cliext::vector< _Value_t >

Public Types

typedef vector_impl< _Value_t, _Is_ref > _Mytype_t
 
typedef _STLCLR IVector< _Value_t > _Mycont_it
 
typedef cli::array< _Value_t > _Myarray_t
 
typedef System::Collections::Generic::IEnumerable< _Value_t > _Myenum_it
 
typedef _Cont_make_value< _Value_t, _Is_ref > _Mymake_t
 
typedef RandomAccessIterator< _Mytype_titerator
 
typedef ConstRandomAccessIterator< _Mytype_tconst_iterator
 
typedef ReverseRandomAccessIterator< _Mytype_treverse_iterator
 
typedef ReverseRandomAccessIterator< _Mytype_tconst_reverse_iterator
 
typedef int size_type
 
typedef int difference_type
 
typedef _Value_t value_type
 
typedef value_type reference
 
typedef value_type const_reference
 
typedef _Mycont_it generic_container
 
typedef value_type generic_value
 
typedef _STLCLR Generic::ContainerRandomAccessIterator< _Value_t > generic_iterator
 
typedef _STLCLR Generic::ReverseRandomAccessIterator< _Value_t > generic_reverse_iterator
 

Public Member Functions

 vector_impl ()
 
vector_impl operator= (vector_impl%_Right)
 
 vector_impl (_Mytype_t%_Right)
 
 vector_impl (size_type _Count)
 
 vector_impl (size_type _Count, value_type _Val)
 
template<typename _InIt_t >
 vector_impl (_InIt_t _First, _InIt_t _Last)
 
template<typename _InIt_t >
void _Construct (_InIt_t _Count, _InIt_t _Val, _Int_iterator_tag%)
 
template<typename _InIt_t >
void _Construct (_InIt_t _First, _InIt_t _Last, input_iterator_tag%)
 
template<typename _InIt_t >
void _Construct (_InIt_t _First, _InIt_t _Last, forward_iterator_tag%)
 
 vector_impl (_Myenum_it^_Right)
 
 ~vector_impl ()
 
unsigned long get_generation ()
 
size_type get_bias (iterator _Where)
 
bool valid_bias (size_type _Bias)
 
reference at (size_type _Pos)
 
reference at_bias (size_type _Bias)
 
reference front ()
 
reference back ()
 
_Myarray_t to_array ()
 
iterator make_iterator (size_type _Bias)
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
void reserve (size_type _Capacity)
 
size_type capacity ()
 
virtual void resize (size_type _Newsize)
 
void resize (size_type _Newsize, value_type _Val)
 
size_type size ()
 
bool empty ()
 
void push_back (value_type _Val)
 
void pop_back ()
 
void assign (size_type _Count, value_type _Val)
 
void assign (_STLCLR Generic::IInputIterator< _Value_t >^_First, _STLCLR Generic::IInputIterator< _Value_t >^_Last)
 
void assign (_Myenum_it^_Right)
 
void assign (System::Collections::IEnumerable^_Right)
 
iterator insert (iterator _Where, value_type _Val)
 
void insert (iterator _Where, size_type _Count, value_type _Val)
 
void insert (iterator _Where_iter, _STLCLR Generic::IInputIterator< _Value_t >^_First, _STLCLR Generic::IInputIterator< _Value_t >^_Last)
 
void insert (iterator _Where_iter, _Myenum_it^_Right)
 
void insert (iterator _Where_iter, System::Collections::IEnumerable^_Right)
 
template<typename _InIt_t >
void _Insert_self (size_type _Where, _InIt_t _First, _InIt_t _Last)
 
size_type insert_n (size_type _Where, size_type _Count, value_type _Val)
 
iterator erase (iterator _Where)
 
iterator erase (iterator _First, iterator _Last)
 
size_type erase_n (size_type _First, size_type _Last)
 
void reverse_n (size_type _First, size_type _Last)
 
void clear ()
 
void swap (_Mytype_t%_Right)
 
 return (_Capacity)
 
size_type _Copy (_Myarray_t^_Source, size_type _First, size_type _Last, size_type _Dest)
 
void _Copyback (size_type _First, size_type _Last, size_type _Dest)
 
size_type _Fill_n (size_type _First, size_type _Count, value_type _Val)
 
size_type _Insert_space (size_type _Where, size_type _Count)
 
virtual System::Object Clone ()
 

Public Attributes

property value_type default [size_type]
 
property value_type front_item
 
property value_type back_item
 
_STLCLR_FIELD_ACCESS __pad0__: size_type _Buy(size_type _Capacity) { _Mygen = 0
 
_Myarray_t _Myarray
 
size_type _Mysize
 
unsigned long _Mygen
 

Static Public Attributes

static const int _Maxsize = MAX_CONTAINER_SIZE
 

Private Attributes

property size_type Count
 
property bool IsSynchronized
 
property System::Object SyncRoot
 

Member Typedef Documentation

template<typename _Value_t, bool _Is_ref>
typedef cli::array<_Value_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::_Myarray_t
template<typename _Value_t, bool _Is_ref>
typedef _STLCLR IVector<_Value_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::_Mycont_it
template<typename _Value_t, bool _Is_ref>
typedef System::Collections::Generic::IEnumerable<_Value_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::_Myenum_it
template<typename _Value_t, bool _Is_ref>
typedef _Cont_make_value<_Value_t, _Is_ref> cliext::impl::vector_impl< _Value_t, _Is_ref >::_Mymake_t
template<typename _Value_t, bool _Is_ref>
typedef vector_impl<_Value_t, _Is_ref> cliext::impl::vector_impl< _Value_t, _Is_ref >::_Mytype_t
template<typename _Value_t, bool _Is_ref>
typedef ConstRandomAccessIterator<_Mytype_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::const_iterator
template<typename _Value_t, bool _Is_ref>
typedef value_type cliext::impl::vector_impl< _Value_t, _Is_ref >::const_reference
template<typename _Value_t, bool _Is_ref>
typedef ReverseRandomAccessIterator<_Mytype_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::const_reverse_iterator
template<typename _Value_t, bool _Is_ref>
typedef int cliext::impl::vector_impl< _Value_t, _Is_ref >::difference_type
template<typename _Value_t, bool _Is_ref>
typedef _Mycont_it cliext::impl::vector_impl< _Value_t, _Is_ref >::generic_container
template<typename _Value_t, bool _Is_ref>
typedef _STLCLR Generic::ContainerRandomAccessIterator<_Value_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::generic_iterator
template<typename _Value_t, bool _Is_ref>
typedef _STLCLR Generic::ReverseRandomAccessIterator<_Value_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::generic_reverse_iterator
template<typename _Value_t, bool _Is_ref>
typedef value_type cliext::impl::vector_impl< _Value_t, _Is_ref >::generic_value
template<typename _Value_t, bool _Is_ref>
typedef RandomAccessIterator<_Mytype_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::iterator
template<typename _Value_t, bool _Is_ref>
typedef value_type cliext::impl::vector_impl< _Value_t, _Is_ref >::reference
template<typename _Value_t, bool _Is_ref>
typedef ReverseRandomAccessIterator<_Mytype_t> cliext::impl::vector_impl< _Value_t, _Is_ref >::reverse_iterator
template<typename _Value_t, bool _Is_ref>
typedef int cliext::impl::vector_impl< _Value_t, _Is_ref >::size_type
template<typename _Value_t, bool _Is_ref>
typedef _Value_t cliext::impl::vector_impl< _Value_t, _Is_ref >::value_type

Constructor & Destructor Documentation

template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::vector_impl ( )
inline
51  { // construct empty vector
52  _Buy(0);
53  }
template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::vector_impl ( _Mytype_t _Right)
inline
70  { // construct by copying _Right
71  for (size_type _Idx = _Buy(_Right.size()); 0 <= --_Idx; )
72  _Myarray[_Idx] = _Mymake_t::make_value(_Right.at(_Idx));
73  _Mysize = _Right.size();
74  }
size_type _Mysize
Definition: vector:583
static _Value_t make_value(_Value_t%_Val)
Definition: xutility:87
_Myarray_t _Myarray
Definition: vector:582
int size_type
Definition: vector:33
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::vector_impl ( size_type  _Count)
inlineexplicit
77  { // construct from _Count * value_type()
78  _Mysize = _Fill_n(0, _Buy(_Count), value_type());
79  }
size_type _Mysize
Definition: vector:583
size_type _Fill_n(size_type _First, size_type _Count, value_type _Val)
Definition: vector:541
_Value_t value_type
Definition: vector:35
_Diff _Count
Definition: algorithm:1941
template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::vector_impl ( size_type  _Count,
value_type  _Val 
)
inline
82  { // construct from _Count * _Val
83  _Mysize = _Fill_n(0, _Buy(_Count), _Val);
84  }
size_type _Mysize
Definition: vector:583
size_type _Fill_n(size_type _First, size_type _Count, value_type _Val)
Definition: vector:541
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
template<typename _InIt_t >
cliext::impl::vector_impl< _Value_t, _Is_ref >::vector_impl ( _InIt_t  _First,
_InIt_t  _Last 
)
inline
88  { // construct from [_First, _Last)
89  _Construct(_First, _Last, _Iter_category(_First));
90  }
iterator_traits< _Iter_t >::iterator_category _Iter_category(_Iter_t)
Definition: xutility:654
void _Construct(_InIt_t _Count, _InIt_t _Val, _Int_iterator_tag%)
Definition: vector:93
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::vector_impl ( _Myenum_it _Right)
inline
121  { // initialize with enumeration
122  _Buy(0);
123  for each (value_type _Val in _Right)
124  push_back(_Val);
125  }
void push_back(value_type _Val)
Definition: vector:306
_Value_t value_type
Definition: vector:35
_FwdIt const _Ty _Val
Definition: algorithm:1938
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::~vector_impl ( )
inline
129  { // destroy the object
130  clear();
131  _Myarray = nullptr;
132  _Mysize = 0;
133  ++_Mygen;
134  }
void clear()
Definition: vector:492
size_type _Mysize
Definition: vector:583
_Myarray_t _Myarray
Definition: vector:582
unsigned long _Mygen
Definition: vector:584

Member Function Documentation

template<typename _Value_t, bool _Is_ref>
template<typename _InIt_t >
void cliext::impl::vector_impl< _Value_t, _Is_ref >::_Construct ( _InIt_t  _Count,
_InIt_t  _Val,
_Int_iterator_tag  
)
inline
95  { // initialize with _Count * _Val
97  }
size_type _Mysize
Definition: vector:583
size_type _Fill_n(size_type _First, size_type _Count, value_type _Val)
Definition: vector:541
int size_type
Definition: vector:33
_Value_t value_type
Definition: vector:35
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
template<typename _InIt_t >
void cliext::impl::vector_impl< _Value_t, _Is_ref >::_Construct ( _InIt_t  _First,
_InIt_t  _Last,
input_iterator_tag  
)
inline
102  { // initialize with [_First, _Last), input iterators
103  _Buy(_First != _Last ? 1 : 0); // buy at least one if non-empty
104  for (; _First != _Last; ++_First)
105  insert_n(size(), 1, (value_type)*_First);
106  }
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
template<typename _InIt_t >
void cliext::impl::vector_impl< _Value_t, _Is_ref >::_Construct ( _InIt_t  _First,
_InIt_t  _Last,
forward_iterator_tag  
)
inline
111  { // initialize with [_First, _Last), forward iterators
113 
114  _Buy(_Size);
115  for (size_type _Idx = 0; _Idx < _Size; ++_Idx, ++_First)
116  _Myarray[_Idx] = _Mymake_t::make_value(value_type(*_First));
117  _Mysize = _Size;
118  }
size_type _Mysize
Definition: vector:583
static _Value_t make_value(_Value_t%_Val)
Definition: xutility:87
_Myarray_t _Myarray
Definition: vector:582
int size_type
Definition: vector:33
_CRT_BEGIN_C_HEADER _Check_return_ _Ret_maybenull_ _In_ size_t _Size
Definition: corecrt_malloc.h:58
_Value_t value_type
Definition: vector:35
int distance(_InIt_t _First, _InIt_t _Last)
Definition: xutility:720
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::_Copy ( _Myarray_t _Source,
size_type  _First,
size_type  _Last,
size_type  _Dest 
)
inline
529  { // copy [_First, _Last) in _Source to _Dest
530  for (; _First != _Last; ++_First, ++_Dest)
531  _Myarray[_Dest] = _Source[_First];
532  return (_Dest);
533  }
_Myarray_t _Myarray
Definition: vector:582
unsigned _Dest
Definition: mbstring.h:107
_Source
Definition: corecrt_wstring.h:187
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::_Copyback ( size_type  _First,
size_type  _Last,
size_type  _Dest 
)
inline
536  { // copy [_First, _Last) to [..., _Dest)
537  for (; _First != _Last; )
538  _Myarray[--_Dest] = _Myarray[--_Last];
539  }
_Myarray_t _Myarray
Definition: vector:582
unsigned _Dest
Definition: mbstring.h:107
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::_Fill_n ( size_type  _First,
size_type  _Count,
value_type  _Val 
)
inline
542  { // copy initializing _Count * _Val
543  for (; 0 < _Count; --_Count, ++_First)
545  return (_First);
546  }
static _Value_t make_value(_Value_t%_Val)
Definition: xutility:87
_Myarray_t _Myarray
Definition: vector:582
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
template<typename _InIt_t >
void cliext::impl::vector_impl< _Value_t, _Is_ref >::_Insert_self ( size_type  _Where,
_InIt_t  _First,
_InIt_t  _Last 
)
inline
417  { // insert [_First, _Last] at _Where, from this container
418  size_type _Oldsize = size();
419 
420  if (!valid_bias(_Where))
421  throw gcnew System::InvalidOperationException();
422 
423  for (; _First != _Last; ++_First)
424  insert_n(size(), 1, (value_type)*_First);
425  reverse_n(_Where, _Oldsize);
426  reverse_n(_Oldsize, size());
427  reverse_n(_Where, size());
428  }
int size_type
Definition: vector:33
bool valid_bias(size_type _Bias)
Definition: vector:149
void reverse_n(size_type _First, size_type _Last)
Definition: vector:476
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::_Insert_space ( size_type  _Where,
size_type  _Count 
)
inline
549  { // dig a hole for _Count elements at _Where
550  size_type _Capacity = capacity();
551 
552  if (_Where < 0 || size() < _Where
553  || _Count < 0 || _Maxsize - size() < _Count)
554  throw gcnew System::ArgumentOutOfRangeException();
555  else if (_Capacity < size() + _Count)
556  { // not enough room, reallocate
557  _Myarray_t^ _Oldarray = _Myarray;
558 
559  _Capacity = _Maxsize - _Capacity < _Capacity
560  ? 0 : 2 * _Capacity; // try to double capacity
561  if (_Capacity < size() + _Count)
562  _Capacity = size() + _Count;
563  _Myarray = gcnew _Myarray_t(_Capacity);
564 
565  _Copy(_Oldarray, 0, _Where, 0);
566  _Mysize = _Copy(_Oldarray, _Where, _Mysize, _Where + _Count);
567  }
568  else if (size() - _Where < _Count)
569  _Mysize = _Copy(_Myarray, _Where, size(),
570  _Where + _Count); // new stuff spills off end
571  else
572  { // new stuff can all be assigned
573  size_type _Oldend = size();
574 
575  _Mysize = _Copy(_Myarray, _Oldend - _Count, _Oldend, _Oldend);
576  _Copyback(_Where, _Oldend - _Count, _Oldend);
577  }
578  return (_Where);
579  }
size_type _Mysize
Definition: vector:583
cli::array< _Value_t > _Myarray_t
Definition: vector:20
_Myarray_t _Myarray
Definition: vector:582
size_type _Copy(_Myarray_t^_Source, size_type _First, size_type _Last, size_type _Dest)
Definition: vector:527
int size_type
Definition: vector:33
void _Copyback(size_type _First, size_type _Last, size_type _Dest)
Definition: vector:535
size_type size()
Definition: vector:292
static const int _Maxsize
Definition: vector:47
size_type capacity()
Definition: vector:271
_Diff _Count
Definition: algorithm:1941
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::assign ( size_type  _Count,
value_type  _Val 
)
inline
317  { // assign _Count * _Val
318  clear();
319  insert_n(0, _Count, _Val);
320  }
void clear()
Definition: vector:492
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::assign ( _STLCLR Generic::IInputIterator< _Value_t >^  _First,
_STLCLR Generic::IInputIterator< _Value_t >^  _Last 
)
inline
324  { // initialize with [_First, _Last), input iterators
325  if (_Iter_container(_First) != this)
326  clear();
327 
328  size_type _Oldsize = size();
329 
330  for (; !_First->equal_to(_Last); _First->next())
331  insert_n(size(),
332  1, (value_type)_First->get_cref()); // append new stuff
333  erase_n(0, _Oldsize); // erase any leftover old stuff
334  }
void clear()
Definition: vector:492
int size_type
Definition: vector:33
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
System::Object _Iter_container(_Iter_t%_Next)
Definition: iterator:4248
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::assign ( _Myenum_it _Right)
inline
337  { // initialize with enumeration
338  size_type _Oldsize = size();
339 
340  for each (value_type _Val in _Right)
341  insert_n(size(), 1, _Val); // append new stuff
342  erase_n(0, _Oldsize); // erase any leftover old stuff
343  }
int size_type
Definition: vector:33
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::assign ( System::Collections::IEnumerable^  _Right)
inline
346  { // initialize with enumeration
347  size_type _Oldsize = size();
348 
349  for each (value_type _Val in _Right)
350  insert_n(size(), 1, _Val); // append new stuff
351  erase_n(0, _Oldsize); // erase any leftover old stuff
352  }
int size_type
Definition: vector:33
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
reference cliext::impl::vector_impl< _Value_t, _Is_ref >::at ( size_type  _Pos)
inline
155  { // subscript mutable sequence with checking
156  if (_Pos < 0 || size() <= _Pos)
157  throw gcnew System::ArgumentOutOfRangeException();
158 
159  return (_Myarray[_Pos]);
160  }
_Myarray_t _Myarray
Definition: vector:582
size_type size()
Definition: vector:292
template<typename _Value_t, bool _Is_ref>
reference cliext::impl::vector_impl< _Value_t, _Is_ref >::at_bias ( size_type  _Bias)
inline
163  { // subscript mutable sequence with checking, biased
164  return (at(_Bias));
165  }
reference at(size_type _Pos)
Definition: vector:154
template<typename _Value_t, bool _Is_ref>
reference cliext::impl::vector_impl< _Value_t, _Is_ref >::back ( )
inline
214  { // get last element of mutable sequence
215  if (empty())
216  throw gcnew System::NullReferenceException();
217  return (at(size() - 1));
218  }
size_type size()
Definition: vector:292
bool empty()
Definition: vector:297
reference at(size_type _Pos)
Definition: vector:154
template<typename _Value_t, bool _Is_ref>
iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::begin ( )
inline
237  { // return iterator for beginning of mutable sequence
238  return (make_iterator(0));
239  }
iterator make_iterator(size_type _Bias)
Definition: vector:231
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::capacity ( )
inline
272  { // return current length of allocated storage
273  return (_Myarray == nullptr ? 0 : _Myarray->Length);
274  }
_Myarray_t _Myarray
Definition: vector:582
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::clear ( )
inline
493  { // erase all
494  erase_n(0, size());
495  }
size_type size()
Definition: vector:292
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
template<typename _Value_t, bool _Is_ref>
virtual System::Object cliext::impl::vector_impl< _Value_t, _Is_ref >::Clone ( )
inlinevirtual

Reimplemented in cliext::vector< _Value_t >.

589  { // clone the vector
590  return (gcnew vector_impl(*this));
591  }
vector_impl()
Definition: vector:50
template<typename _Value_t, bool _Is_ref>
bool cliext::impl::vector_impl< _Value_t, _Is_ref >::empty ( )
inline
298  { // test if sequence is empty
299  return (size() == 0);
300  }
size_type size()
Definition: vector:292
template<typename _Value_t, bool _Is_ref>
iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::end ( )
inline
241  { // return iterator for end of mutable sequence
242  return (make_iterator(size()));
243  }
size_type size()
Definition: vector:292
iterator make_iterator(size_type _Bias)
Definition: vector:231
template<typename _Value_t, bool _Is_ref>
iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::erase ( iterator  _Where)
inline
448  { // erase element at _Where
449  size_type _Bias = get_bias(_Where);
450 
451  return (make_iterator(erase_n(_Bias, _Bias + 1)));
452  }
int size_type
Definition: vector:33
size_type get_bias(iterator _Where)
Definition: vector:142
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
iterator make_iterator(size_type _Bias)
Definition: vector:231
template<typename _Value_t, bool _Is_ref>
iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::erase ( iterator  _First,
iterator  _Last 
)
inline
455  { // erase [_First, _Last)
456  return (make_iterator(
457  erase_n(get_bias(_First), get_bias(_Last))));
458  }
size_type get_bias(iterator _Where)
Definition: vector:142
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
iterator make_iterator(size_type _Bias)
Definition: vector:231
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::erase_n ( size_type  _First,
size_type  _Last 
)
inline
461  { // erase [_First, _Last)
462  if (_First < 0 || _Last < _First || size() < _Last)
463  throw gcnew System::InvalidOperationException();
464 
465  if (_First != _Last)
466  { // worth doing, copy down over hole
467  for (size_type _Next = _First; _Next != _Last; ++_Next)
468  _Mymake_t::unmake_value(at(_Next));
469 
470  _Mysize = _Copy(_Myarray, _Last, size(), _First);
471  ++_Mygen;
472  }
473  return (_First);
474  }
size_type _Mysize
Definition: vector:583
_Myarray_t _Myarray
Definition: vector:582
size_type _Copy(_Myarray_t^_Source, size_type _First, size_type _Last, size_type _Dest)
Definition: vector:527
int size_type
Definition: vector:33
size_type size()
Definition: vector:292
reference at(size_type _Pos)
Definition: vector:154
unsigned long _Mygen
Definition: vector:584
static void unmake_value(_Value_t%)
Definition: xutility:92
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
reference cliext::impl::vector_impl< _Value_t, _Is_ref >::front ( )
inline
207  { // get first element of mutable sequence
208  if (empty())
209  throw gcnew System::NullReferenceException();
210  return (at(0));
211  }
bool empty()
Definition: vector:297
reference at(size_type _Pos)
Definition: vector:154
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::get_bias ( iterator  _Where)
inline
143  { // get offset from valid iterator
144  if (_Where.container() != this)
145  throw gcnew System::ArgumentException();
146  return (_Where.get_bias());
147  }
template<typename _Value_t, bool _Is_ref>
unsigned long cliext::impl::vector_impl< _Value_t, _Is_ref >::get_generation ( )
inline
138  { // get underlying container generation
139  return (_Mygen);
140  }
unsigned long _Mygen
Definition: vector:584
template<typename _Value_t, bool _Is_ref>
iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::insert ( iterator  _Where,
value_type  _Val 
)
inline
355  { // insert _Val at _Where
356  return (make_iterator(
357  insert_n(get_bias(_Where), 1, _Val)));
358  }
size_type get_bias(iterator _Where)
Definition: vector:142
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
iterator make_iterator(size_type _Bias)
Definition: vector:231
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::insert ( iterator  _Where,
size_type  _Count,
value_type  _Val 
)
inline
362  { // insert _Count * _Val at _Where
363  insert_n(get_bias(_Where), _Count, _Val);
364  }
size_type get_bias(iterator _Where)
Definition: vector:142
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::insert ( iterator  _Where_iter,
_STLCLR Generic::IInputIterator< _Value_t >^  _First,
_STLCLR Generic::IInputIterator< _Value_t >^  _Last 
)
inline
369  { // insert [_First, _Last) at _Where, input iterators
370  size_type _Where = get_bias(_Where_iter);
371  size_type _Oldsize = size();
372 
373  if (!valid_bias(_Where))
374  throw gcnew System::InvalidOperationException();
375 
376  for (; !_First->equal_to(_Last); _First->next())
377  insert_n(size(), 1, (value_type)_First->get_cref());
378  reverse_n(_Where, _Oldsize);
379  reverse_n(_Oldsize, size());
380  reverse_n(_Where, size());
381  }
int size_type
Definition: vector:33
size_type get_bias(iterator _Where)
Definition: vector:142
bool valid_bias(size_type _Bias)
Definition: vector:149
void reverse_n(size_type _First, size_type _Last)
Definition: vector:476
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::insert ( iterator  _Where_iter,
_Myenum_it _Right 
)
inline
385  { // insert enumeration at _Where, possibly from this container
386  size_type _Where = get_bias(_Where_iter);
387  size_type _Oldsize = size();
388 
389  if (!valid_bias(_Where))
390  throw gcnew System::InvalidOperationException();
391 
392  for each (value_type _Val in _Right)
393  insert_n(size(), 1, _Val);
394  reverse_n(_Where, _Oldsize);
395  reverse_n(_Oldsize, size());
396  reverse_n(_Where, size());
397  }
int size_type
Definition: vector:33
size_type get_bias(iterator _Where)
Definition: vector:142
bool valid_bias(size_type _Bias)
Definition: vector:149
void reverse_n(size_type _First, size_type _Last)
Definition: vector:476
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::insert ( iterator  _Where_iter,
System::Collections::IEnumerable^  _Right 
)
inline
401  { // insert enumeration at _Where, possibly from this container
402  size_type _Where = get_bias(_Where_iter);
403  size_type _Oldsize = size();
404 
405  if (!valid_bias(_Where))
406  throw gcnew System::InvalidOperationException();
407 
408  for each (value_type _Val in _Right)
409  insert_n(size(), 1, _Val);
410  reverse_n(_Where, _Oldsize);
411  reverse_n(_Oldsize, size());
412  reverse_n(_Where, size());
413  }
int size_type
Definition: vector:33
size_type get_bias(iterator _Where)
Definition: vector:142
bool valid_bias(size_type _Bias)
Definition: vector:149
void reverse_n(size_type _First, size_type _Last)
Definition: vector:476
_Value_t value_type
Definition: vector:35
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::insert_n ( size_type  _Where,
size_type  _Count,
value_type  _Val 
)
inline
432  { // insert _Count * _Val at _Where
433  if (_Count < 0)
434  throw gcnew System::ArgumentOutOfRangeException();
435 
436  if (_Count == 0)
437  return (_Where);
438  else
439  { // insert finite sequence
440  _Insert_space(_Where, _Count);
441  _Fill_n(_Where, _Count, _Val);
442  ++_Mygen;
443  return (_Where + _Count - 1);
444  }
445  }
size_type _Fill_n(size_type _First, size_type _Count, value_type _Val)
Definition: vector:541
unsigned long _Mygen
Definition: vector:584
size_type _Insert_space(size_type _Where, size_type _Count)
Definition: vector:548
_Diff _Count
Definition: algorithm:1941
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::make_iterator ( size_type  _Bias)
inline
232  { // return iterator for offset
233  return (iterator(this, _Bias));
234  }
RandomAccessIterator< _Mytype_t > iterator
Definition: vector:25
template<typename _Value_t, bool _Is_ref>
vector_impl cliext::impl::vector_impl< _Value_t, _Is_ref >::operator= ( vector_impl< _Value_t, _Is_ref >%  _Right)
inline
56  { // assign
57  if ((Object^)this != %_Right)
58  { // worth doing, do it
59  clear();
60  reserve(_Right.size());
61 
62  for (size_type _Idx = 0; _Idx < _Right.size(); ++_Idx)
63  insert_n(size(), 1, _Right.at(_Idx));
64  }
65  return (*this);
66  }
void clear()
Definition: vector:492
int size_type
Definition: vector:33
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
constexpr const _Ty &() _Right
Definition: algorithm:3723
void reserve(size_type _Capacity)
Definition: vector:256
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::pop_back ( )
inline
312  { // erase element at end
313  erase_n(size() - 1, size()); // discard from end
314  }
size_type size()
Definition: vector:292
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::push_back ( value_type  _Val)
inline
307  { // insert element at end
308  insert_n(size(), 1, _Val);
309  }
size_type size()
Definition: vector:292
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
reverse_iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::rbegin ( )
inline
246  { // return reverse iterator for beginning of mutable sequence
247  return (reverse_iterator(end()));
248  }
ReverseRandomAccessIterator< _Mytype_t > reverse_iterator
Definition: vector:29
iterator end()
Definition: vector:240
template<typename _Value_t, bool _Is_ref>
reverse_iterator cliext::impl::vector_impl< _Value_t, _Is_ref >::rend ( )
inline
251  { // return reverse iterator for end of mutable sequence
252  return (reverse_iterator(begin()));
253  }
iterator begin()
Definition: vector:236
ReverseRandomAccessIterator< _Mytype_t > reverse_iterator
Definition: vector:29
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::reserve ( size_type  _Capacity)
inline
257  { // determine new minimum length of allocated storage
258  if (_Capacity < 0)
259  throw gcnew System::ArgumentOutOfRangeException();
260 
261  if (capacity() < _Capacity)
262  { // not enough room, reallocate
263  _Myarray_t^ _Oldarray = _Myarray;
264 
265  _Myarray = gcnew _Myarray_t(_Capacity);
266  for (size_type _Idx = size(); 0 <= --_Idx; )
267  _Myarray[_Idx] = _Oldarray[_Idx];
268  }
269  }
cli::array< _Value_t > _Myarray_t
Definition: vector:20
_Myarray_t _Myarray
Definition: vector:582
int size_type
Definition: vector:33
size_type size()
Definition: vector:292
size_type capacity()
Definition: vector:271
template<typename _Value_t, bool _Is_ref>
virtual void cliext::impl::vector_impl< _Value_t, _Is_ref >::resize ( size_type  _Newsize)
inlinevirtual
277  { // determine new length, padding with value_type elements
278  resize(_Newsize, value_type());
279  }
virtual void resize(size_type _Newsize)
Definition: vector:276
_Value_t value_type
Definition: vector:35
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::resize ( size_type  _Newsize,
value_type  _Val 
)
inline
282  { // determine new length, padding with _Val elements
283  if (_Newsize < 0)
284  throw gcnew System::ArgumentOutOfRangeException();
285 
286  if (size() < _Newsize)
287  insert_n(size(), _Newsize - size(), _Val);
288  else if (_Newsize < size())
289  erase_n(_Newsize, size());
290  }
size_type size()
Definition: vector:292
size_type erase_n(size_type _First, size_type _Last)
Definition: vector:460
size_type insert_n(size_type _Where, size_type _Count, value_type _Val)
Definition: vector:430
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<typename _Value_t, bool _Is_ref>
cliext::impl::vector_impl< _Value_t, _Is_ref >::return ( _Capacity  )
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::reverse_n ( size_type  _First,
size_type  _Last 
)
inline
477  { // reverse a subrange
478  bool _Changed = false;
479 
480  for (; _First != _Last && _First != --_Last; ++_First)
481  { // swap distinct _First and _Last
482  value_type _Temp = _Myarray[_First];
483 
484  _Myarray[_First] = _Myarray[_Last];
485  _Myarray[_Last] = _Temp;
486  _Changed = true;
487  }
488  if (_Changed)
489  ++_Mygen;
490  }
_Myarray_t _Myarray
Definition: vector:582
_Value_t value_type
Definition: vector:35
unsigned long _Mygen
Definition: vector:584
_FwdIt _Last
Definition: algorithm:1936
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::size ( )
inline
293  { // return length of sequence
294  return (_Mysize);
295  }
size_type _Mysize
Definition: vector:583
template<typename _Value_t, bool _Is_ref>
void cliext::impl::vector_impl< _Value_t, _Is_ref >::swap ( _Mytype_t _Right)
inline
498  { // exchange contents with _Right
499  if ((Object^)this != %_Right)
500  { // worth doing, swap
501  _Myarray_t^ _Tarray = _Myarray;
502  size_type _Tsize = _Mysize;
503 
504  _Myarray = _Right._Myarray;
505  _Right._Myarray = _Tarray;
506 
507  _Mysize = _Right._Mysize;
508  _Right._Mysize = _Tsize;
509 
510  ++_Mygen;
511  ++_Right._Mygen;
512  }
513  }
size_type _Mysize
Definition: vector:583
cli::array< _Value_t > _Myarray_t
Definition: vector:20
_Myarray_t _Myarray
Definition: vector:582
int size_type
Definition: vector:33
unsigned long _Mygen
Definition: vector:584
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Value_t, bool _Is_ref>
_Myarray_t cliext::impl::vector_impl< _Value_t, _Is_ref >::to_array ( )
inline
222  { // convert to array
223  _Myarray_t^ _Ans = gcnew _Myarray_t(size());
224 
225  for (int _Idx = size(); 0 <= --_Idx; )
226  _Ans[_Idx] = _Mymake_t::make_value(_Myarray[_Idx]);
227  return (_Ans);
228  }
cli::array< _Value_t > _Myarray_t
Definition: vector:20
static _Value_t make_value(_Value_t%_Val)
Definition: xutility:87
_Myarray_t _Myarray
Definition: vector:582
size_type size()
Definition: vector:292
template<typename _Value_t, bool _Is_ref>
bool cliext::impl::vector_impl< _Value_t, _Is_ref >::valid_bias ( size_type  _Bias)
inline
150  { // test if _Bias is currently a valid bias
151  return (0 <= _Bias && _Bias <= size());
152  }
size_type size()
Definition: vector:292

Member Data Documentation

template<typename _Value_t, bool _Is_ref>
_STLCLR_FIELD_ACCESS cliext::impl::vector_impl< _Value_t, _Is_ref >::__pad0__
template<typename _Value_t, bool _Is_ref>
const int cliext::impl::vector_impl< _Value_t, _Is_ref >::_Maxsize = MAX_CONTAINER_SIZE
static
template<typename _Value_t, bool _Is_ref>
_Myarray_t cliext::impl::vector_impl< _Value_t, _Is_ref >::_Myarray
template<typename _Value_t, bool _Is_ref>
unsigned long cliext::impl::vector_impl< _Value_t, _Is_ref >::_Mygen
template<typename _Value_t, bool _Is_ref>
size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::_Mysize
template<typename _Value_t, bool _Is_ref>
property value_type cliext::impl::vector_impl< _Value_t, _Is_ref >::back_item
Initial value:
{
virtual value_type get()
{
return (back());
}
virtual void set(value_type _Val)
{
back() = _Val;
}
}
template<typename _Value_t, bool _Is_ref>
property size_type cliext::impl::vector_impl< _Value_t, _Is_ref >::Count
private
Initial value:
{
virtual size_type get() sealed
{
return (size());
}
}
template<typename _Value_t, bool _Is_ref>
property value_type cliext::impl::vector_impl< _Value_t, _Is_ref >::default[size_type]
Initial value:
{
virtual value_type get(size_type _Pos)
{
return (at(_Pos));
}
virtual void set(size_type _Pos, value_type _Val)
{
at(_Pos) = _Val;
}
}
template<typename _Value_t, bool _Is_ref>
property value_type cliext::impl::vector_impl< _Value_t, _Is_ref >::front_item
Initial value:
{
virtual value_type get()
{
return (front());
}
virtual void set(value_type _Val)
{
front() = _Val;
}
}
template<typename _Value_t, bool _Is_ref>
property bool cliext::impl::vector_impl< _Value_t, _Is_ref >::IsSynchronized
private
Initial value:
{
virtual bool get() sealed
{
return (false);
}
}
template<typename _Value_t, bool _Is_ref>
property System::Object cliext::impl::vector_impl< _Value_t, _Is_ref >::SyncRoot
private
Initial value:
{
virtual System::Object^ get() sealed
{
return (this);
}
}

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