acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa__array_impl2.h
1#pragma once
2
3//
4// see collection_array_decl.h for declaration
5//
6// raw_array is an array that does not call constructors or destructor in elements
7// array is an array that call only copy constructor and destructor in elements
8// array is an array that call default constructors, copy constructs and destructors in elements
9
10//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
11//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_size() const
12//{
13// return this->m_nSize;
14//}
15
16
17//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
18//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_count() const
19//{
20// return this->m_nSize;
21//}
22
23
24//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
25//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_length() const
26//{
27// return this->m_nSize;
28//}
29
30
31//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
32//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_size_in_bytes() const
33//{
34// return this->m_nSize * sizeof(TYPE);
35//}
36
37
38//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
39//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_byte_count() const
40//{
41// return this->m_nSize * sizeof(TYPE);
42//}
43
44
45//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
46//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::size() const
47//{
48// return this->get_size();
49//}
50
51
52//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
53//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::collection::count() const
54//{
55// return this->get_count();
56//}
57
58//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
59//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::length() const
60//{
61// return this->get_length();
62//}
63
64//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
65//inline bool base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::is_empty(::collection::count countMinimum) const
66//{
67// return this->size() < countMinimum;
68//}
69
70
71//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
72//inline bool base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::empty(::collection::count countMinimum) const
73//{
74// return is_empty(countMinimum);
75//}
76
77//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
78//inline bool base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::isEmpty(::collection::count countMinimum) const
79//{
80// return empty(countMinimum);
81//}
82
83//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
84//inline bool base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::has_elements(::collection::count countMinimum) const
85//{
86// return this->size() >= countMinimum;
87//}
88//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
89//inline ::collection::index base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::upper_bound(::collection::index iIndex) const
90//{
91// return (::collection::index)this->size() + iIndex;
92//}
93
94//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
95//inline ::collection::index base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::middle_index(::collection::index iIndex) const
96//{
97// return (::collection::index) +iIndex;
98//}
99
100
101//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
102//inline ::collection::index base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_upper_bound(::collection::index iIndex) const
103//{
104// return this->size() + iIndex;
105//}
106
107//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
108//inline ::collection::index base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_middle_index(::collection::index iIndex) const
109//{
110// return this->size() / 2 + iIndex;
111//}
112
113
114//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
115//inline bool base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::bounds(::collection::index i) const
116//{
117// return i >= 0 && i < this->size();
118//}
119
120
121//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
122//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::erase_all()
123//{
124// return allocate(0, -1);
125//}
126
127
128//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
129//inline ::collection::count base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::set_size(::collection::index nNewSize, ::collection::count nGrowBy) // does not call default constructors on aaa_primitive_new items/elements
130//{
131// return allocate(nNewSize, nGrowBy);
132//}
133
134
135//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
136//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::clear()
137//{
138// erase_all();
139//}
140
141
142//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
143//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::erase_last()
144//{
145// ASSERT(this->size() > 0);
146// erase_at(get_upper_bound());
147//}
148
149
150//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
151//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::zero(::collection::index iStart,::collection::count c)
152//{
153// if(c < 0)
154// {
155// c = get_size() - iStart;
156// }
157// ::zero(&m_pData[iStart],c * sizeof(TYPE));
158//}
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
186//inline TYPE& array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_at(::collection::index nIndex)
187//{
188//
189// ASSERT(nIndex >= 0 && nIndex < this->m_nSize);
190//
191// return get_data()[nIndex];
192//
193//}
194
195
196//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
197//inline const TYPE& array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_at(::collection::index nIndex) const
198//{
199//
200// ASSERT(nIndex >= 0 && nIndex < this->m_nSize);
201//
202// return get_data()[nIndex];
203//
204//}
205
206
207//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
208//inline void array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::set_at(::collection::index nIndex, ARG_TYPE newElement)
209//{
210//
211// ASSERT(nIndex >= 0 && nIndex < this->m_nSize);
212//
213// get_data()[nIndex] = newElement;
214//
215//}
216
217
218//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
219//inline const TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::element_at(::collection::index nIndex) const
220//{
221//
222// ASSERT(nIndex >= 0 && nIndex < this->m_nSize);
223//
224// return m_pData[nIndex];
225//
226//}
227
228
229//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
230//inline TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::element_at(::collection::index nIndex)
231//{
232//
233// ASSERT(nIndex >= 0 && nIndex < this->m_nSize);
234//
235// return m_pData[nIndex];
236//
237//}
238
239//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
240//inline const TYPE& array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::first(::collection::index nIndex) const
241//{
242// return this->element_at(nIndex);
243//}
244//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
245//inline TYPE& array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::first(::collection::index nIndex)
246//{
247// return this->element_at(nIndex);
248//}
249//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
250//inline const TYPE& array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::last(::collection::index i) const
251//{
252// return this->element_at(this->get_upper_bound(i);
253//}
254//
255//
256//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
257//inline TYPE& array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::last(::collection::index i)
258//{
259// return this->element_at(this->get_upper_bound(i);
260//}
261
262
263
264
265//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
266//inline const TYPE* array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_data() const
267//{
268// return (const TYPE*)this->m_pData;
269//}
270
271//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
272//inline TYPE* array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::get_data()
273//{
274// return (TYPE*)this->m_pData;
275//}
276
277
278//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
279//inline ::collection::index array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::add_item(ARG_TYPE newElement)
280//{
281//
282// ::collection::index nIndex = (::index_cast) this->m_nSize;
283//
284// this->allocate(nIndex + 1);
285//
286// this->last() = newElement;
287//
288// return nIndex;
289//
290//}
291
292
293//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
294//inline ::collection::index array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::add(ARG_TYPE newElement)
295//{
296//
297// return add_item(newElement);
298//
299//}
300
301
302//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
303//inline ::collection::index array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::add(const array & src)
304//{
305// return append(src);
306//}
307
308//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
309//inline ::collection::index array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::append(ARG_TYPE newElement)
310//{
311// return add(newElement);
312//}
313
314
315//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
316//inline const TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::operator[](::collection::index i) const
317//{
318//
319// return m_pData[i];
320//
321//}
322
323
324//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
325//inline TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::operator[](::collection::index i)
326//{
327//
328// return m_pData[i];
329//
330//}
331
332
333//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
334//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::__swap(::collection::index index1, ::collection::index index2)
335//{
336//
337// ::swap(m_pData[index1], m_pData[index2]);
338//
339//}
340
341
342//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
343//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::__swap(iterator it1, iterator it2)
344//{
345// TYPE t = *it1;
346// *it1 = *it2;
347// *it2 = t;
348//}
349
350
351//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
352//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::__swap(const_iterator it1, const_iterator it2)
353//{
354// TYPE t = get_data()[it1.m_i];
355// get_data()[it1.m_i] = get_data()[it2.m_i];
356// get_data()[it2.m_i] = t;
357//}
358
359//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
360//inline array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > & array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::operator = (const array & src)
361//{
362// if(&src != this)
363// {
364// copy(src);
365// }
366// return *this;
367//}
368
369
370
371// out-of-line functions
372
373//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
374//array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::array(::particle * pparticle, ::collection::count nGrowBy) //:
375// //::matter(pparticle)
376//{
380//}
381
382
383//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
384//array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::array(const array & a) //:
386//{
387//
388// operator = (a);
389//
390//}
391
392
393//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
394//inline array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::array(::std::initializer_list < TYPE > l)
395//{
396// forallref(l)
397// {
398// add((ARG_TYPE) item);
399// }
400//}
401
402
403
404
405//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
406//array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > :: array(e_create_new, ::collection::count n)
407//{
411// this->allocate(n);
412//}
413
414//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
415//array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::array(::collection::count n, ARG_TYPE t)
416//{
417// while (n > 0)
418// {
419// add(t);
420// n--;
421// }
422//}
423
424
425
426//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
427//array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::~array()
428//{
429// this->erase_all(); // on_destruct_element is virtual and won't be available for base_array
430//}
431
432
433
434
435//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
436//inline ::collection::index array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::append(const array& src)
437//{
438// // ASSERT_OK(this);
439// ASSERT(this != &src); // cannot append to itself
440//
441// if(this == &src)
442// throw ::exception(error_bad_argument);
443//
444// ::collection::count nOldSize = this->m_nSize;
445// this->allocate(this->m_nSize) + __count(src.m_nSize);
446// CopyElements<TYPE>(&this->m_pData[nOldSize], src.m_pData, src.m_nSize);
447// return nOldSize;
448//}
449
450//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
451//inline void array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::copy(const array& src)
452//{
453//
454// // ASSERT_OK(this);
455//
456// ASSERT(this != &src);
457//
458// if(this != &src)
459// {
460//
461// auto nSrcSize = src.m_nSize;
462//
463// this->allocate(nSrcSize);
464//
465// CopyElements<TYPE>(this->m_pData,src.m_pData, nSrcSize);
466//
467// }
468//
469//}
470
471
472
473
474
475
476
477//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
478//void array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::dump(dump_context & dumpcontext) const
479//{
480//
482//
483// dumpcontext << "with ";
484//
485// dumpcontext.write(this->m_nSize);
486//
487// dumpcontext << " elements";
488//
489// if (dumpcontext.GetDepth() > 0)
490// {
491//
492// dumpcontext << "\n";
493//
494// dump_elements<TYPE>(dumpcontext, this->get_data(), this->m_nSize);
495//
496// }
497//
498// dumpcontext << "\n";
499//
500//}
501//
502//
503//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
504//void array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::assert_ok() const
505//{
506//
507// //matter::assert_ok();
508//
509// if (this->m_pData == nullptr)
510// {
511//
512// ASSERT(this->m_nSize) == 0;
513// ASSERT(this->m_nMaxSize == 0);
514//
515// }
516// else
517// {
518//
519// ASSERT(this->m_nSize) >= 0;
520// ASSERT(this->m_nMaxSize >= 0);
521// ASSERT(this->m_nSize) <= this->m_nMaxSize;
522// ASSERT(is_memory_segment_ok(this->m_pData, (::memsize_cast) this->m_nMaxSize * sizeof(TYPE)));
523//
524// }
525//
526//}
527
528
529//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
530//inline typename base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::iterator base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::erase(iterator pos)
531//{
532// if(pos >= begin() && pos < end())
533// {
534// this->erase_at(pos - begin());
535// return pos;
536// }
537// else
538// {
539// return this->end();
540// }
541//}
542
543//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
544//inline typename base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::iterator base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::erase(iterator begin, iterator last)
545//{
546// if(begin >= m_pData && last < m_pData + this->size())
547// {
548// if(begin < m_pData + this->size())
549// {
550// ::collection::count nCount = last - begin;
551// erase_at(begin - m_pData, nCount);
552// return begin;
553// }
554// else
555// {
556// return this->end();
557// }
558// }
559// else
560// {
561// return this->end();
562// }
563//}
564
565
566
567
568
569//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
570//inline array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > & array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::operator += (const array & a)
571//{
572//
573// if(&a == this)
574// {
575// array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > aCopy(a);
576// add(aCopy);
577// }
578// else
579// {
580// add(a);
581// }
582// return *this;
583//
584//}
585
586//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
587//inline array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::operator + (const array & a) const
588//{
589// array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > aNew(*this);
590// aNew += a;
591// return a;
592//}
593
594
595//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
596//inline TYPE & array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::add_new()
597//{
598//
599// this->set_size(this->m_nSize) + 1;
600//
601// return this->last();
602//
603//}
604
605
606//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
607//inline ::collection::index array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::add_new(::collection::count count)
608//{
609//
610// this->set_size(this->m_nSize) + count;
611//
612// return this->get_upper_bound();
613//
614//}
615
616
617//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
618//inline TYPE base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::pop(::collection::index n)
619//{
620//
621// ::collection::index i = this->get_upper_bound(n);
622//
623// TYPE t = element_at(i);
624//
625// this->erase_at(i);
626//
627// return t;
628//
629//}
630
631//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
632//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::pop_back(::collection::index n)
633//{
634//
635// erase_at(this->get_upper_bound(n));
636//
637//}
638
639//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
640//inline ::collection::index base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::push(ARG_TYPE newElement,::collection::index n)
641//{
642// return insert_at(this->get_upper_bound(n),newElement);
643//}
644
645//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
646//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::push_back(ARG_TYPE newElement,::collection::index n)
647//{
648// insert_at(this->get_upper_bound(n),newElement);
649//}
650
651//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
652//inline TYPE base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::takeAt(::collection::index i)
653//{
654//
655// TYPE t = element_at(i);
656//
657// this->erase_at(i);
658//
659// return t;
660//
661//}
662
663
664//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
665//inline TYPE base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::takeFirst(::collection::index i)
666//{
667//
668// TYPE t = element_at(i);
669//
670// this->erase_at(i);
671//
672// return t;
673//
674//}
675
676
677//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
678//inline TYPE base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::takeLast(::collection::index n)
679//{
680//
681// ::collection::index i = this->get_upper_bound(n);
682//
683// TYPE t = element_at(i);
684//
685// this->erase_at(i);
686//
687// return t;
688//
689//}
690
691
692//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
693//inline void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::set_at_grow(::collection::index nIndex, ARG_TYPE newElement, ::collection::count nGrowBy)
694//{
695//
696// ASSERT(nIndex >= 0);
697//
698// if (nIndex >= this->m_nSize)
699// {
700//
701// this->set_size(nIndex + 1, nGrowBy);
702//
703// }
704//
705// get_data()[nIndex] = newElement;
706//
707//}
708
709
710//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
711//inline TYPE & base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > ::element_at_grow(::collection::index nIndex, ::collection::count nGrowBy)
712//{
713//
714// ASSERT(nIndex >= 0);
715//
716// if (nIndex >= this->m_nSize)
717// {
718//
719// this->set_size(nIndex + 1, nGrowBy);
720//
721// }
722//
723// return get_data()[nIndex];
724//
725//}
726
727
728//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
729//array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::array(array && a)
730//{
731//
732// this->m_nGrowBy = a.m_nGrowBy;
733// this->m_pData = a.m_pData;
734// this->m_nSize = a.m_nSize;
735// this->m_nMaxSize = a.m_nMaxSize;
736//
737// a.m_pData = nullptr;
738// a.m_nSize = 0;
739// a.m_nMaxSize = 0;
740//
741//}
742
743
744//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
745//inline array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > & array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::transfer(array && a)
746//{
747//
748// if(&a != this)
749// {
750//
751// this->destroy();
752//
753// this->m_nGrowBy = a.m_nGrowBy;
754// this->m_pData = a.m_pData;
755// this->m_nSize = a.m_nSize;
756// this->m_nMaxSize = a.m_nMaxSize;
757//
758// a.m_pData = nullptr;
759// a.m_nSize = 0;
760// a.m_nMaxSize = 0;
761//
762// }
763//
764// return *this;
765//
766//}
767
768
769//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
770//inline array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer > & array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::operator = (array && a)
771//{
772//
773// transfer(::transfer(a));
774//
775// return *this;
776//
777//}
778
779
780//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
781//inline const TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::element_at(::collection::index nIndex) const
782//{
783//
784// return m_pData[nIndex];
785//
786//}
787//
788//
789//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
790//inline TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::element_at(::collection::index nIndex)
791//{
792//
793// return m_pData[nIndex];
794//
795//}
796
797
798//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
799//inline const TYPE& base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::first(::collection::index nIndex) const
800//{
801//
802// return this->element_at(nIndex);
803//
804//}
805
806
807//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
808//inline TYPE & base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::first(::collection::index nIndex)
809//{
810// return this->element_at(nIndex);
811//}
812
813
814//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
815//inline const TYPE & base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::last(::collection::index i) const
816//{
817// return element_at(this->get_upper_bound(i));
818//}
819
820
821//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
822//inline TYPE & base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::last(::collection::index i)
823//{
824//
825// return element_at(this->get_upper_bound(i));
826//
827//}
828
829
830//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
831//inline const TYPE & base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::middle(::collection::index i) const
832//{
833//
834// return element_at(this->get_middle_index(i));
835//
836//}
837
838
839//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
840//inline TYPE & base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::middle(::collection::index i)
841//{
842//
843// return element_at(this->get_middle_index(i));
844//
845//}
846
847//template < typename TYPE, typename ARG_TYPE, typename ALLOCATOR, ::enum_type t_etypeContainer >
848//void base_array < TYPE, ARG_TYPE, TYPED, MEMORY, t_etypeContainer >::set_all(const TYPE & t)
849//{
850//
851// for (::collection::index i = 0; i < get_count(); i++)
852// {
853//
854// m_pData[i] = t;
855//
856// }
857//
858//}
859
860
861