20 #ifndef __MINILIB_CONTAINER_DYNAMIC_ARRAY_H__
21 #define __MINILIB_CONTAINER_DYNAMIC_ARRAY_H__
23 #include "../mn_config.hpp"
29 #include "../mn_deleter.hpp"
30 #include "../mn_def.hpp"
31 #include "../mn_functional.hpp"
32 #include "../mn_typetraits.hpp"
34 #include "../utils/mn_utils.hpp"
35 #include "../container/mn_pair.hpp"
40 template<
typename TArray>
47 using pointer =
typename array_type::pointer;
52 using deleter =
typename array_type::deleter;
53 using iterator =
typename array_type::iterator;
84 return !(*
this == other);
217 if(_newArData ==
nullptr)
return false;
221 for(
int i = 0; i < _cpysize; i++)
256 mn::fill_n<value_type>(
begin(),
size(), val);
278 template <
typename T,
class TAllocator,
class TDeleter >
284 template <
typename T,
class TAllocator,
class TDeleter >
291 template <
typename T,
class TAllocator,
class TDeleter >
295 if(a[i] >= b[i])
return false;
299 template <
typename T,
class TAllocator,
class TDeleter >
303 if(a[i] > b[i])
return false;
307 template <
typename T,
class TAllocator,
class TDeleter >
311 if(a[i] <= b[i])
return false;
315 template <
typename T,
class TAllocator,
class TDeleter >
319 if(a[i] < b[i])
return false;
323 template <
typename T,
class TAllocator,
class TDeleter >
329 template <
typename T,
class TAllocator,
class TDeleter >
334 template <
typename T,
class TAllocator,
class TDeleter >
340 template <
typename T,
Helper class for array iterators.
Definition: mn_array.hpp:62
self_type & operator++()
Definition: mn_array.hpp:91
mn::size_t size_type
Definition: mn_array.hpp:70
reference operator[](size_type index)
Definition: mn_array.hpp:112
basic_array_iterator(pointer _valuePtr, uint32_t pos) noexcept
Definition: mn_array.hpp:74
bool operator!=(const self_type &other) const
Definition: mn_array.hpp:83
self_type & operator=(const self_type &other) noexcept
Definition: mn_array.hpp:106
pointer m_valuePtr
Definition: mn_array.hpp:120
T value_type
Definition: mn_array.hpp:65
T & reference
Definition: mn_array.hpp:67
self_type & operator--()
Definition: mn_array.hpp:94
basic_array_iterator(const self_type &&other) noexcept
Definition: mn_array.hpp:80
reference operator*()
Definition: mn_array.hpp:98
basic_array_iterator(const self_type &other) noexcept
Definition: mn_array.hpp:77
bool operator==(const self_type &other) const
Definition: mn_array.hpp:87
const T & const_reference
Definition: mn_array.hpp:68
uint32_t m_iPosition
Definition: mn_array.hpp:121
mn::ptrdiff_t difference_type
Definition: mn_array.hpp:69
T * pointer
Definition: mn_array.hpp:66
const_reference operator*() const
Definition: mn_array.hpp:102
Lightweight c++11 array implementation.
Definition: mn_array.hpp:128
iterator end()
Definition: mn_array.hpp:179
const_reference back() const noexcept
Definition: mn_array.hpp:186
constexpr bool is_empty() const noexcept
Definition: mn_array.hpp:193
reference operator[](size_type pos) noexcept
Definition: mn_array.hpp:247
allocator_type m_alloCator
Definition: mn_array.hpp:273
T * pointer
Definition: mn_array.hpp:131
mn::size_t size_type
Definition: mn_array.hpp:135
~basic_array()
Definition: mn_array.hpp:169
const T & const_reference
Definition: mn_array.hpp:133
T value_type
Definition: mn_array.hpp:130
const_iterator begin() const
Definition: mn_array.hpp:177
const_iterator end() const
Definition: mn_array.hpp:180
size_type size() const noexcept
Definition: mn_array.hpp:188
TAllocator allocator_type
Definition: mn_array.hpp:136
reference front() noexcept
Definition: mn_array.hpp:182
int push(value_type entry)
Definition: mn_array.hpp:200
void deconstruct(pointer ptr, size_type size)
Definition: mn_array.hpp:265
T & reference
Definition: mn_array.hpp:132
size_type m_szSize
Definition: mn_array.hpp:270
const_reference at(size_type pos) const
Definition: mn_array.hpp:191
void fill(const value_type &val)
Definition: mn_array.hpp:255
basic_array(const self_type &other)
Definition: mn_array.hpp:162
const_reference front() const noexcept
Definition: mn_array.hpp:183
pointer construct(size_type n)
Definition: mn_array.hpp:259
reference back() noexcept
Definition: mn_array.hpp:185
reference at(size_type pos)
Definition: mn_array.hpp:190
reference pop()
Definition: mn_array.hpp:209
bool resize(size_type newSize)
Definition: mn_array.hpp:215
TDeleter deleter_type
Definition: mn_array.hpp:137
iterator begin()
Definition: mn_array.hpp:176
basic_array_iterator< T > iterator
Definition: mn_array.hpp:138
static const size_type TypeSize
Definition: mn_array.hpp:141
basic_array_iterator< const T > const_iterator
Definition: mn_array.hpp:139
pointer m_arData
Definition: mn_array.hpp:269
bool is_equele(const self_type &other, bool bWithPos=false)
Definition: mn_array.hpp:233
void swap(self_type &other) noexcept
Definition: mn_array.hpp:243
constexpr const_reference operator[](size_type pos) const noexcept
Definition: mn_array.hpp:251
deleter_type m_dDeleter
Definition: mn_array.hpp:274
size_type m_szCurPos
Definition: mn_array.hpp:271
basic_array(pointer _ptrData, unsigned int _sSize)
Definition: mn_array.hpp:155
constexpr bool is_full() const noexcept
Definition: mn_array.hpp:196
mn::ptrdiff_t difference_type
Definition: mn_array.hpp:134
basic_array()
Definition: mn_array.hpp:145
A Simple template for a deleter.
Definition: mn_basic_deleter.hpp:37
Basic algorithmens This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniT...
void fill(basic_array< T, TAllocator, TDeleter > &a, const int val)
Definition: mn_array.hpp:330
bool operator<=(const basic_array< T, TAllocator, TDeleter > &a, const basic_array< T, TAllocator, TDeleter > &b)
Definition: mn_array.hpp:300
bool operator<(const basic_array< T, TAllocator, TDeleter > &a, const basic_array< T, TAllocator, TDeleter > &b)
Definition: mn_array.hpp:292
void swap(basic_any &x, basic_any &y) noexcept
Definition: mn_any.hpp:272
bool operator!=(const basic_array< T, TAllocator, TDeleter > &a, const basic_array< T, TAllocator, TDeleter > &b)
Definition: mn_array.hpp:285
bool operator>=(const basic_array< T, TAllocator, TDeleter > &a, const basic_array< T, TAllocator, TDeleter > &b)
Definition: mn_array.hpp:316
bool operator>(const basic_array< T, TAllocator, TDeleter > &a, const basic_array< T, TAllocator, TDeleter > &b)
Definition: mn_array.hpp:308
void zero(basic_array< T, TAllocator, TDeleter > &a)
Definition: mn_array.hpp:335
bool operator==(const basic_array< T, TAllocator, TDeleter > &a, const basic_array< T, TAllocator, TDeleter > &b)
Definition: mn_array.hpp:279
struct mn::memory::detail::ptr_difference T
Definition: mn_atomic_singleton.hpp:38
malloc_allocator< basic_allocator_filter > default_allocator
Definition: mn_default_allocator.hpp:30
Definition: mn_allocator_typetraits.hpp:25
T min(const T x, const T y)
Definition: mn_algorithm.hpp:307
fIt2 swap_ranges(fIt1 a, fIt1 b, fIt2 c)
Definition: mn_algorithm.hpp:331
size_t alignment_for(const size_t size) noexcept
Definition: mn_alignment.hpp:178
long ptrdiff_t
Definition: mn_def.hpp:49
void move(const T *src, const T *last, T *dest)
Definition: mn_algorithm.hpp:100
MN_THREAD_CONFIG_SIZE_TYPE size_t
Definition: mn_def.hpp:48
Definition: mn_iterator.hpp:35
Definition: mn_array.hpp:41
typename array_type::size_type size_type
Definition: mn_array.hpp:50
typename array_type::pointer pointer
Definition: mn_array.hpp:47
typename array_type::allocator allocator
Definition: mn_array.hpp:51
typename array_type::reference reference
Definition: mn_array.hpp:45
typename array_type::value_type value_type
Definition: mn_array.hpp:44
typename array_type::iterator iterator
Definition: mn_array.hpp:53
typename array_type::deleter deleter
Definition: mn_array.hpp:52
typename array_type::const_iterator const_iterator
Definition: mn_array.hpp:54
TArray array_type
Definition: mn_array.hpp:42
static const size_type TypeSize
Definition: mn_array.hpp:56
typename array_type::const_reference const_reference
Definition: mn_array.hpp:46
typename array_type::difference_type difference_type
Definition: mn_array.hpp:49