acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
raw_array.h
1#pragma once
2
3
4#include "acme/prototype/collection/array_base.h"
5
6
7//raw_array_base is an array that does not call constructors or destructor in elements
8// array is an array that call only copy constructor and destructor in elements
9// array is an array that call default constructors, copy constructs and destructors in elements
10
11
12template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
14 public array_base < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >
15{
16public:
17
18
19 using BASE_TYPE = TYPE;
20 using BASE_ARG_TYPE = ARG_TYPE;
21 using BASE_ARRAY = array_base < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >;
22 using ARRAY_BASE = base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >;
23 using BASE_RAW_RANGE = typename BASE_ARRAY::BASE_RAW_RANGE;
24 using iterator = typename ARRAY_BASE::iterator;
25 using const_iterator = typename ARRAY_BASE::const_iterator;
26
27
28 using BASE_ARRAY::BASE_ARRAY;
29 using BASE_ARRAY::operator =;
30
31 //raw_array_base() {}
32 //raw_array_base(std::initializer_list < TYPE > initializer_list) : ARRAY_BASE(initializer_list) {}
33 //raw_array_base(constraw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & a);
34 //raw_array_base(raw_array_base <TYPE,ARG_TYPE, TYPED, MEMORY, t_etypeContainer > && a) noexcept;
35 //raw_array_base(ARG_TYPE t, ::collection::count n);
36 //raw_array_base(::range < const_iterator > constrange) : ARRAY_BASE(constrange) {}
37 //raw_array_base(const_iterator begin, const_iterator end) : ARRAY_BASE(begin, end) { }
38 //raw_array_base(const TYPE * ptypea, ::collection::count n);
39 //virtual ~raw_array_base();
40
41
44
45
46
47
48 void erase_last();
49
50 ::collection::count erase_all();
51 void clear();
52
53
54
55
56 // Accessing elements
57 inline const TYPE& get_at(::collection::index nIndex) const;
58 inline TYPE& get_at(::collection::index nIndex);
59 inline void set_at(::collection::index nIndex, ARG_TYPE newElement);
60
61
62 // Direct Access to the matter data (may return nullptr)
63 inline const TYPE* get_data() const;
64 inline TYPE* get_data();
65
66 // Potentially growing theraw_array_base
67 //void set_at_grow(::collection::index nIndex, ARG_TYPE newElement);
68 //TYPE & element_at_grow(::collection::index nIndex);
69 TYPE get_at_grow(::collection::index nIndex);
70 ::collection::index add(ARG_TYPE newElement) { return add_item(newElement); }
71 ::collection::index add_item(ARG_TYPE newElement);
72 ::collection::index append(const TYPE * p, ::collection::count c);
73 ::collection::index append(const raw_array_base& src);
74 TYPE * add_new(::collection::count count);
75 TYPE & add_new();
76
77 //::collection::index append(const raw_array_base& src);
78 //void copy(const raw_array_base& src);
79
80
81 inline TYPE pop(::collection::index i = -1);
82 inline ::collection::index push(ARG_TYPE newElement);
83 inline void pop_back(::collection::index i = -1);
84
85
86
87 //iterator erase(iterator pos);
88 //iterator erase(iterator first, iterator last);
89 //iterator begin()
90 //{
91 // return iterator(0, this);
92 //}
93
94 //iterator end()
95 //{
96 // return iterator(this->get_size(), this);
97 //}
98
99
100 // overloaded operator helpers
101 //inline const TYPE& operator[](::collection::index nIndex) const;
102 //inline TYPE& operator[](::collection::index nIndex);
103
104 //that transfer elements around
105 TYPE & insert_at(::collection::index nIndex, ARG_TYPE newElement, ::collection::count nCount = 1);
106 //::collection::index erase_at(::collection::index nIndex, ::collection::count nCount = 1);
107 //void _001RemoveIndexes(index_array & ia);
108 //void erase_indexes(const index_array & ia); // erase indexes from ::collection::index raw_array_base upper bound to ::collection::index raw_array_base lower bound
109 //void erase_descending_indexes(const index_array & ia); // erase indexes from ::collection::index raw_array_base lower bound to ::collection::index raw_array_base upper bound
110 //::collection::index insert_at(::collection::index nStartIndex, raw_array_base* pNewArray);
111 //void __swap(::collection::index index1, ::collection::index index2);
112
113 //raw_array_base & operator = (const raw_array_base & src);
114
115 ::collection::index find_first(ARG_TYPE t, ::collection::index (* pfnCompare)(ARG_TYPE, ARG_TYPE), ::collection::index start = 0, ::collection::index last = -1) const;
116
117 ::collection::index raw_find_first(TYPE * p, ::collection::index first = 0, ::collection::index last = -1) const;
118
119 template < class DERIVED >
120 ::collection::index find_first(DERIVED * p, ::collection::index first = 0, ::collection::index last = -1)
121 {
122 return raw_find_first(dynamic_cast < TYPE * > (p), first, last);
123 }
124
125 template < class ARRAY >
126 ::collection::count get_array(ARRAY & a, ::collection::index iStart = 0, ::collection::count nCount = -1)
127 {
128
129 ::collection::count ca = 0;
130
131 ::collection::index iEnd;
132
133 if(nCount < 0)
134 iEnd = this->get_upper_bound(nCount);
135 else
136 iEnd = iStart + nCount - 1;
137
138 for(::collection::index i = iStart; i <= iEnd; i++)
139 {
140
141 a.add(this->element_at(i));
142 ca++;
143
144 }
145
146 return ca;
147
148 }
149
150
151 raw_array_base & operator += (const raw_array_base & a);
152 raw_array_base operator + (const raw_array_base & a) const;
153
154
155 //using base_array < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator =;
156 //inline raw_array_base & operator = (raw_array_base && a);
157 //inline raw_array_base & transfer(raw_array_base && a);
158
159
160 //operator TYPE *() { return this->m_begin; }
161 //operator const TYPE *() const { return this->m_begin; }
162
163
164
165 operator ::collection::count () const { return this->get_count(); }
166
167
168};
169
170//
171// template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
172// class raw_array_base :
173// virtual public ::particle,
174// public raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >
175// {
176// public:
177//
178//
179// raw_array_base() : raw_array_base< TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >() {}
180// template < typename ...Args >
181// raw_array_base(Args&&... args) :
182// raw_array_base< TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >(::std::forward < Args >(args)...)
183// {
184// }
185// raw_array_base(std::initializer_list < TYPE > initializer_list) : raw_array_base< TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >(initializer_list) {}
186//
187//
188// };
189//
190
191template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
192inline ::collection::count raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::erase_all()
193{
194
195 return this->allocate(0, false, false);
196
197}
198
199
200template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
201void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::clear()
202{
203
204 erase_all();
205
206}
207
208
209template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
210inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::erase_last()
211{
212
213 this->erase_at(this->get_upper_bound());
214
215}
216
217
218template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
219inline TYPE& raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_at(::collection::index nIndex)
220{
221
222 return get_data()[nIndex];
223
224}
225
226
227template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
228inline const TYPE& raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_at(::collection::index nIndex) const
229{
230
231 return get_data()[nIndex];
232
233}
234
235
236template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
237inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::set_at(::collection::index nIndex, ARG_TYPE newElement)
238{
239
240 get_data()[nIndex] = newElement;
241
242}
243
244
245template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
246inline const TYPE* raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_data() const
247{
248
249 return (const TYPE*)this->m_begin;
250
251}
252
253
254template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
255inline TYPE* raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_data()
256{
257
258 return (TYPE*)this->m_begin;
259
260}
261
262
263template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
264inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add_item(ARG_TYPE newElement)
265{
266
267 ::collection::index nIndex = this->size();
268
269 this->set_at_grow(nIndex, newElement);
270
271 return nIndex;
272
273}
274
275
276template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
277inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::append(const TYPE * p, ::collection::count c)
278{
279
280 return ARRAY_BASE::append(p, c);
281
282}
283
284
285template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
286inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::append(const raw_array_base & src)
287{
288
289 return ARRAY_BASE::append(src);
290
291}
292
293
294template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
295inline TYPE * raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add_new(::collection::count count)
296{
297
298 this->allocate(this->size() + count, false, true);
299
300 return this->m_begin + (this->get_size() - count);
301
302}
303
304
305template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
306inline TYPE & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add_new()
307{
308
309 this->allocate(this->size() + 1, false, true);
310
311 return this->last();
312
313}
314
315
316template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
317inline TYPE raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::pop(::collection::index n)
318{
319
320 ::collection::index i = this->get_upper_bound(n);
321
322 TYPE t = this->element_at(i);
323
324 this->erase_at(i);
325
326 return t;
327
328}
329
330template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
331inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::pop_back(::collection::index n)
332{
333
334 this->erase_at(this->get_upper_bound(n));
335
336}
337
338
339template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
340inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::push(ARG_TYPE newElement)
341{
342
343 return this->index_of(&insert_at(this->size(), newElement));
344
345}
346
347//
348//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
349//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add(ARG_TYPE newElement, ::collection::index n)
350//{
351// insert_at(this->get_upper_bound(n), newElement);
352//}
353
354
355//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
356//inline const TYPE& raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator[](::collection::index nIndex) const
357//{
358//
359// return this->element_at(nIndex);
360//
361//}
362//
363//
364//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
365//inline TYPE& raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator[](::collection::index nIndex)
366//{
367//
368// return this->element_at(nIndex);
369//
370//}
371
372
373//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
374//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::__swap(::collection::index index1, ::collection::index index2)
375//{
376// TYPE t = get_data()[index1];
377// get_data()[index1] = get_data()[index2];
378// get_data()[index2] = t;
379//}
380
381//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
382//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator = (const raw_array_base & src)
383//{
384// if(&src != this)
385// {
386// this->copy(src);
387// }
388// return *this;
389//}
390//
391//
392//
393// out-of-line functions
394
395
396
397//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
398//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(::std::initializer_list < TYPE > l)
399//{
400// for(auto & item : l)
401// {
402// add((ARG_TYPE) item);
403// }
404//}
405
406
407
408//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
409//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(const raw_array_base & array):
410// ARRAY_BASE(array)
411//{
412//
413//}
414//
415//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
416//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(raw_array_base <TYPE,ARG_TYPE, TYPED, MEMORY, t_etypeContainer > && a) noexcept :
417// ARRAY_BASE(::transfer(a))
418//{
419//
420//}
421//
428//
429//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
430//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(ARG_TYPE t, ::collection::count n)
431//{
432// insert_at(0, t, n);
433//}
434//
435//
436//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
437//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(const TYPE * ptypea, ::collection::count n)
438//{
439//
440// this->set_size(n);
441//
442// ::memory_copy(this->m_begin, ptypea, this->length_in_bytes());
443//
444//}
445//
446//
447//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
448//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::~raw_array_base()
449//{
450//
451// this->destroy();
452//
453//}
454
455//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
456//void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::destroy()
457//{
458// if (m_begin != nullptr)
459// {
460// for( ::i32 i = 0; i < m_nSize; i++ )
461// destruct_element(m_begin + i)->~TYPE();
462// delete[] (::u8*)m_begin;
463// m_begin = nullptr;
464// m_nSize = 0;
465// m_countAllocation = 0;
466// }
467//
468//}
469
470
471//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
472//::collection::count raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::set_size(::collection::count nNewSize, ::collection::count nGrowBy)
473//{
474// return allocate(nNewSize, nGrowBy);
475//}
476//
477//
478//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
479//::collection::count raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::resize(::collection::count nNewSize, ::collection::count nGrowBy)
480//{
481// return allocate(nNewSize, nGrowBy);
482//}
483//
484//
485//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
486//::collection::count raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::allocate_in_bytes(::collection::count nNewSize, ::collection::count nGrowBy)
487//{
488// if(nGrowBy < 0)
489// {
490// return allocate(nNewSize / sizeof(TYPE), -1);
491// }
492// else
493// {
494// return allocate(nNewSize / sizeof(TYPE), nGrowBy / sizeof(TYPE));
495// }
496//}
497
498//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
499//::collection::count raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::allocate(::collection::count nNewSize, ::collection::count nGrowBy)
500//{
501// ::collection::count countOld = get_count();
502// ASSERT_OK(this);
503// ASSERT(nNewSize >= 0);
504//
505// if(nNewSize < 0 )
506// throw ::exception(error_bad_argument);
507//
508// if (nGrowBy >= 0)
509// m_countAddUp = nGrowBy; // set aaa_memory_new i32_size
510//
511// if (nNewSize == 0)
512// {
513// // shrink to nothing
514// if (m_begin != nullptr)
515// {
518// delete[] (::u8*)m_begin;
519// m_begin = nullptr;
520// }
521// m_nSize = m_countAllocation = 0;
522// }
523// else if (m_begin == nullptr)
524// {
525// // create buffer big enough to hold number of requested elements or
526// // m_countAddUp elements, whichever is larger.
527//#ifdef SIZE_T_MAX
528// if(nNewSize > SIZE_T_MAX/sizeof(TYPE))
529// throw ::exception(error_no_memory);
530// ASSERT(nNewSize <= SIZE_T_MAX/sizeof(TYPE)); // no overflow
531//#endif
532// ::collection::count nAllocSize = maximum(nNewSize, m_countAddUp);
534// m_begin = (TYPE*) allocateø< ::u8[(size_t)nAllocSize * sizeof >(TYPE)];
535// //memory_set((void *)m_begin, 0, (size_t)nAllocSize * sizeof(TYPE));
537// // ::allocateø< ( (void *) >( m_begin + i ) ) TYPE;
539// m_nSize = nNewSize;
540// m_countAllocation = nAllocSize;
541// }
542// else if (nNewSize <= m_countAllocation)
543// {
544// // it fits
545// if (nNewSize > m_nSize)
546// {
547// // initialize the ___new elements
553// }
554// else if (m_nSize > nNewSize)
555// {
556// // destroy the old elements
558// // (m_begin + nNewSize + i)->~TYPE();
559// }
560// m_nSize = nNewSize;
561// }
562// else
563// {
564// // otherwise, grow aaa_base_array
565// nGrowBy = m_countAddUp;
566// if (nGrowBy == 0)
567// {
568// // heuristically determine growth when nGrowBy == 0
569// // (this avoids heap fragmentation in many situations)
570// nGrowBy = m_nSize / 8;
571// nGrowBy = (nGrowBy < 4) ? 4 : ((nGrowBy > 1024) ? 1024 : nGrowBy);
572// }
573// ::collection::count nNewMax;
574// if (nNewSize < m_countAllocation + nGrowBy)
575// nNewMax = m_countAllocation + nGrowBy; // granularity
576// else
577// nNewMax = nNewSize; // no slush
578//
579// ASSERT(nNewMax >= m_countAllocation); // no wrap around
580//
581// if(nNewMax < m_countAllocation)
582// throw ::exception(error_bad_argument);
583//
584//#ifdef SIZE_T_MAX
585// ASSERT(nNewMax <= SIZE_T_MAX/sizeof(TYPE)); // no overflow
586//#endif
587//
588// TYPE* pNewData = (TYPE*) allocateø< ::u8[(size_t)nNewMax * sizeof >(TYPE)];
589//
590//
591// // copy ___new data from old
592// ::safe_memory_copy(pNewData, (size_t)nNewMax * sizeof(TYPE),
593// m_begin, (size_t)m_nSize * sizeof(TYPE));
594//
595// // construct remaining elements
596// ASSERT(nNewSize > m_nSize);
602// // get rid of old stuff (note: no destructors called)
603// delete[] (::u8*)m_begin;
604// m_begin = pNewData;
605// m_nSize = nNewSize;
606// m_countAllocation = nNewMax;
607// }
608// return countOld;
609//}
610//
611
612//
613//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
614//void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::free_extra()
615//{
616// ASSERT_OK(this);
617//
618// if (m_nSize != m_countAllocation)
619// {
620// // shrink to desired i32_size
621//#ifdef SIZE_T_MAX
622// ASSERT(m_nSize <= SIZE_T_MAX/sizeof(TYPE)); // no overflow
623//#endif
624// TYPE* pNewData = nullptr;
625// if (m_nSize != 0)
626// {
627// pNewData = (TYPE*) allocateø< ::u8[m_nSize * sizeof >(TYPE)];
628// // copy ___new data from old
629// ::safe_memory_copy(pNewData, m_nSize * sizeof(TYPE),
630// m_begin, m_nSize * sizeof(TYPE));
631// }
632//
633// // get rid of old stuff (note: no destructors called)
634// delete[] (::u8*)m_begin;
635// m_begin = pNewData;
636// m_countAllocation = m_nSize;
637// }
638//}
639
640//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
641//void base_array < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::set_at_grow(::collection::index nIndex, ARG_TYPE newElement)
642//{
643// //ASSERT_OK(this);
644// //ASSERT(nIndex >= 0);
645//
646// if(nIndex < 0)
647// throw ::exception(error_bad_argument);
648//
649// if (nIndex >= this->m_nSize)
650// this->allocate(nIndex+1, -1);
651// get_data()[nIndex] = newElement;
652//}
653
654template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
655inline TYPE raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_at_grow(::collection::index nIndex)
656{
657
658 return this->element_at_grow(nIndex);
659
660}
661
662
663//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
664//inline TYPE & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::element_at_grow(::collection::index nIndex)
665//{
666// if (nIndex >= this->m_nSize)
667// this->allocate(nIndex+1, -1);
668// return get_data()[nIndex];
669//}
670
671
672template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
673TYPE & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::insert_at(::collection::index nIndex, ARG_TYPE newElement, ::collection::count nCount /*=1*/)
674{
675
676 return base_array < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::insert_at(nIndex, newElement,nCount);
677
678}
679
680
681//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
682//::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::insert_at(::collection::index nStartIndex, raw_array_base * pNewArray)
683//{
684// ASSERT_OK(this);
685// ASSERT(pNewArray != nullptr);
686// ASSERT_OK(pNewArray);
687// ASSERT(nStartIndex >= 0);
688//
689// if(pNewArray == nullptr || nStartIndex < 0)
690// throw ::exception(error_bad_argument);
691//
692// if (pNewArray->get_size() > 0)
693// {
694// insert_at(nStartIndex, pNewArray->element_at(0), pNewArray->get_size());
695// for (::collection::index i = 1; i < pNewArray->get_size(); i++)
696// insert_at(nStartIndex + i, pNewArray->element_at(i));
697// }
698//
699// return nStartIndex;
700//
701//}
702
703
704//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
705//void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::dump(dump_context & dumpcontext) const
706//{
707//
708// matter::dump(dumpcontext);
709//
710// dumpcontext << "with " << this->m_nSize << " elements";
711//
712// if (dumpcontext.GetDepth() > 0)
713// {
714//
715// dumpcontext << "\n";
716//
717// dump_elements<TYPE>(dumpcontext,get_data(), this->m_nSize);
718//
719// }
720//
721// dumpcontext << "\n";
722//
723//}
724
725
726//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
727//void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::assert_ok() const
728//{
729//
730// matter::assert_ok();
731//
732//
733// if (get_data() == nullptr)
734// {
735//
736// ASSERT(this->m_nSize == 0);
737// ASSERT(this->m_countAllocation >= 0);
738//
739// }
740// else
741// {
742//
743// ASSERT(this->m_nSize >= 0);
744// ASSERT(this->m_countAllocation >= 0);
745// ASSERT(this->m_nSize <= this->m_countAllocation);
746// ASSERT(is_memory_segment_ok(this->m_begin, (::memsize_cast) this->m_countAllocation * sizeof(TYPE)));
747//
748// }
749//
750//}
751
752
753//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
754//typename raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::iterator raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::erase(iterator pos)
755//{
756// if(pos.m_parray == this)
757// {
758// this->erase_at(pos.m_i32);
759// return iterator(pos.m_i32, this);
760// }
761// else
762// {
763// return this->end();
764// }
765//}
766
767//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
768//typename raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::iterator raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::erase(iterator begin, iterator last)
769//{
770// if(begin.m_parray == this && last.m_parray == this)
771// {
772// if(begin.m_i32 >= 0 && begin.m_i32 < this->get_size())
773// {
774// ::collection::count nCount = last.m_i32 - begin.m_i32;
775// erase_at(begin.m_i32, nCount);
776// return iterator(begin.m_i32, this);
777// }
778// else
779// {
780// return this->end();
781// }
782// }
783// else
784// {
785// return this->end();
786// }
787//}
788//
789//
790template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
791::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_find_first(TYPE *p, ::collection::index find, ::collection::index last) const
792{
793
794 if(find < 0)
795 find += this->get_count();
796
797 if(last < 0)
798 last += this->get_count();
799
800 for(; find <= last; find++)
801 {
802
803 if (&this->element_at(find) == p)
804 {
805
806 return find;
807
808 }
809
810 }
811
812 return -1;
813
814}
815
816
817template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
818::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::find_first(ARG_TYPE t, ::collection::index ( * pfnCompare )(ARG_TYPE, ARG_TYPE), ::collection::index find, ::collection::index last) const
819
820{
821 if(find < 0)
822 find += this->get_count();
823 if(last < 0)
824 last += this->get_count();
825 for(; find <= last; find++)
826 {
827 if(pfnCompare((ARG_TYPE)this->element_at(find), (ARG_TYPE)t) == 0)
828
829 return find;
830 }
831 return -1;
832}
833
834
835
836
837template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
838raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator += (const raw_array_base & a)
839{
840
841 if(&a == this)
842 {
843 raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > aCopy(a);
844 append(aCopy);
845 }
846 else
847 {
848 append(a);
849 }
850 return *this;
851
852}
853
854template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
855raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator + (const raw_array_base & a) const
856{
857 raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > aNew(*this);
858 aNew += a;
859 return a;
860}
861
862
863
864
865
866
867
868
869//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
870//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator =(raw_array_base && a)
871//{
872//
873// return transfer(::transfer(a));
874//
875//}
876//
877
878
879
880
881//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
882//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::transfer(raw_array_base && a)
883//{
884//
885// if (&a != this)
886// {
887// this->destroy();
888//
889// this->m_countAddUp = a.m_countAddUp;
890// this->m_begin = a.m_begin;
891// this->m_end = a.m_end;
892// this->m_countAllocation = a.m_countAllocation;
893//
894// a.m_begin = nullptr;
895// a.m_end = nullptr;
896// a.m_countAllocation = 0;
897//
898// }
899//
900// return *this;
901//
902//}
903//
904//
905
906
907
908//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
909//inline ::collection::count raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::erase_all()
910//{
911// return this->allocate(0, -1);
912//}
913//
914//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
915//void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::
916//clear()
917//{
918// erase_all();
919//}
920//
921//
922//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
923//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::erase_last()
924//{
925//
926// this->erase_at(this->get_upper_bound());
927//
928//}
929//
930//
931//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
932//inline TYPE& raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_at(::collection::index nIndex)
933//{
934//
935// return get_data()[nIndex];
936//}
937//
938//
939//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
940//inline const TYPE& raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_at(::collection::index nIndex) const
941//{
942//
943// return get_data()[nIndex];
944//
945//}
946//
947//
948//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
949//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::set_at(::collection::index nIndex, ARG_TYPE newElement)
950//{
951//
952// get_data()[nIndex] = newElement;
953//
954//}
955//
956//
957//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
958//inline const TYPE* raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_data() const
959//{
960//
961// return (const TYPE*)this->m_begin;
962//
963//}
964//
965//
966//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
967//inline TYPE* raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_data()
968//{
969//
970// return (TYPE*)this->m_begin;
971//
972//}
973//
974//
975//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
976//inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add(ARG_TYPE newElement)
977//{
978//
979// ::collection::index nIndex = (::index_cast ) this->m_nSize;
980//
981// set_at_grow(nIndex, newElement);
982//
983// return nIndex;
984//
985//}
986//
987//
988//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
989//inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add(const raw_array_base & src)
990//{
991//
992// return this->append(src);
993//
994//}
995//
996//
997//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
998//inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add_new(::collection::count count)
999//{
1000//
1001// this->allocate(this->size() + count);
1002//
1003// return this->get_upper_bound();
1004//
1005//}
1006//
1007//
1008//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1009//inline TYPE & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add_new()
1010//{
1011//
1012// this->allocate(this->size() + 1);
1013//
1014// return this->last();
1015//
1016//}
1017//
1018//
1019//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1020//inline TYPE raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::pop(::collection::index n)
1021//{
1022//
1023// ::collection::index i = this->get_upper_bound(n);
1024//
1025// TYPE t = this->element_at(i);
1026//
1027// this->erase_at(i);
1028//
1029// return t;
1030//
1031//}
1032//
1033//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1034//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::pop_back(::collection::index n)
1035//{
1036//
1037// this->erase_at(this->get_upper_bound(n));
1038//
1039//}
1040//
1041//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1042//inline ::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::push(ARG_TYPE newElement, ::collection::index n)
1043//{
1044// return insert_at(this->get_upper_bound(n), newElement);
1045//}
1046//
1047//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1048//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::add(ARG_TYPE newElement, ::collection::index n)
1049//{
1050// insert_at(this->get_upper_bound(n), newElement);
1051//}
1052//
1053//
1070//
1071//
1072//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1073//inline void raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::__swap(::collection::index index1, ::collection::index index2)
1074//{
1075// TYPE t = get_data()[index1];
1076// get_data()[index1] = get_data()[index2];
1077// get_data()[index2] = t;
1078//}
1079//
1080//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1081//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator = (const raw_array_base & src)
1082//{
1083// if(&src != this)
1084// {
1085// this->copy(src);
1086// }
1087// return *this;
1088//}
1089//
1090//
1091//
1093//
1094//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1095//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(::particle * pparticle)
1098//{
1099//
1100//}
1101//
1102//
1103//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1104//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(::std::initializer_list < TYPE > l)
1105//{
1106// forallref(l)
1107// {
1108// add((ARG_TYPE) item);
1109// }
1110//}
1111//
1112//
1113//
1114//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1115//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(const raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & a)// :
1117//{
1118// ::base_array < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator = (a);
1119//}
1120//
1121//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1122//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(raw_array_base <TYPE,ARG_TYPE, TYPED, MEMORY, t_etypeContainer > && a) //:
1124//{
1125//
1126// this->m_countAddUp = a.m_countAddUp;
1127// this->m_begin = a.m_begin;
1128// this->m_nSize = a.m_nSize;
1129// this->m_countAllocation = a.m_countAllocation;
1130//
1131// //a.m_countAddUp = 0;
1132// a.m_begin = nullptr;
1133// //a.m_nSize = 0;
1134// //a.m_countAllocation = 0;
1135//
1136//}
1137//
1138//
1139//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1140//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >:: raw_array_base(::collection::count n)
1141//{
1142// this->allocate(n);
1143//}
1144//
1145//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1146//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(ARG_TYPE t, ::collection::count n)
1147//{
1148// insert_at(0, t, n);
1149//}
1150//
1151//
1152//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1153//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_array_base(TYPE * ptypea, ::collection::count n)
1154//{
1155//
1156// this->allocate(n);
1157//
1158// for(::i32 i = 0; i < n; i++)
1159// {
1160//
1161// this->element_at(i) = ptypea[i];
1162//
1163// }
1164//
1165//}
1166//
1167//
1168//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1169//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::~raw_array_base()
1170//{
1171//
1172// this->destroy();
1173//
1174//}
1175//
1190//
1191//
1218//
1332//
1360//
1374//
1375//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1376//inline TYPE raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::get_at_grow(::collection::index nIndex)
1377//{
1378// return element_at_grow(nIndex);
1379//}
1380//
1381//
1389//
1390//
1391//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1392//::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::insert_at(::collection::index nIndex, ARG_TYPE newElement, ::collection::count nCount /*=1*/)
1393//{
1394//
1395// return base_array < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::insert_at(nIndex, newElement,nCount);
1396//
1397//}
1398//
1399//
1421//
1422//
1443//
1444//
1470//
1471//
1485//
1509//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1510//::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::raw_find_first(TYPE *point, ::collection::index find, ::collection::index last) const
1511//{
1512// if(find < 0)
1513// find += this->get_count();
1514// if(last < 0)
1515// last += this->get_count();
1516// for(; find <= last; find++)
1517// {
1518// if(&this->element_at(find) == point)
1519// return find;
1520// }
1521// return -1;
1522//}
1523//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1524//::collection::index raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::find_first(ARG_TYPE t, ::collection::index ( * pfnCompare )(ARG_TYPE, ARG_TYPE), ::collection::index find, ::collection::index last) const
1525//
1526//{
1527// if(find < 0)
1528// find += this->get_count();
1529// if(last < 0)
1530// last += this->get_count();
1531// for(; find <= last; find++)
1532// {
1533// if(pfnCompare((ARG_TYPE)this->element_at(find), (ARG_TYPE)t) == 0)
1534//
1535// return find;
1536// }
1537// return -1;
1538//}
1539//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1540//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator += (const raw_array_base & a)
1541//{
1542//
1543// if(&a == this)
1544// {
1545// raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > aCopy(a);
1546// add(aCopy);
1547// }
1548// else
1549// {
1550// add(a);
1551// }
1552// return *this;
1553//
1554//}
1555//
1556//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1557//raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator + (const raw_array_base & a) const
1558//{
1559// raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > aNew(*this);
1560// aNew += a;
1561// return a;
1562//}
1563//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1564//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::operator =(raw_array_base && a)
1565//{
1566//
1567// return transfer(::transfer(a));
1568//
1569//}
1570//
1571//template < typename TYPE, typename ARG_TYPE, typename TYPED, typename MEMORY, ::enum_type t_etypeContainer >
1572//inline raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer > & raw_array_base < TYPE, ARG_TYPE, TYPED, MEMORY,t_etypeContainer >::transfer(raw_array_base && a)
1573//{
1574//
1575// if (&a != this)
1576// {
1577// this->destroy();
1578//
1579// this->m_countAddUp = a.m_countAddUp;
1580// this->m_begin = a.m_begin;
1581// this->m_nSize = a.m_nSize;
1582// this->m_countAllocation = a.m_countAllocation;
1583//
1584// a.m_begin = nullptr;
1585//
1586// }
1587//
1588// return *this;
1589//
1590//}
1591//
1592//
1593//
1594
1595
1596
Definition raw_array.h:15