FRX SDK Documentation 2025 SP0
Loading...
Searching...
No Matches
_AcArray.h
Go to the documentation of this file.
1#pragma once
2
3//
4// (C) Copyright 2005-2024 by Graebert GmbH.
5//
6// Permission to use, copy, modify, and distribute this software in
7// object code form for any purpose and without fee is hereby granted,
8// provided that the above copyright notice appears in all copies and
9// that both that copyright notice and the limited warranty and
10// restricted rights notice below appear in all supporting
11// documentation.
12//
13// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
14// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
15// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
16// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
17// UNINTERRUPTED OR ERROR FREE.
18
19template < typename Param1 > class AcArrayMemCopyReallocator;
20template <class T> class AcArrayObjectCopyReallocator
21{
22public:
23 typedef unsigned int size_type;
24
25 static inline void copy(
27 const T* pSource,
29 {
30 while (numObjects--)
31 {
34 pSource++;
35 }
36 }
37
38 static inline void move(
40 const T* pSource,
42 {
44 {
46 }
47 else
48 {
49 while (numObjects--)
50 {
52 }
53 }
54 }
60 static inline void construct(
61 T* pObject)
62 {
63#ifdef new
64#undef new
65#endif
66 ::new (pObject) T;
67 }
74 static inline void construct(
75 T* pObject,
76 const T& value)
77 {
78#ifdef new
79#undef new
80#endif
81 ::new (pObject) T(value);
82 }
90 static inline void constructn(
93 const T& value)
94 {
95 while (numObjects--)
96 {
98 }
99 }
100
101 static inline void constructn(
104 {
105 while (numObjects--)
106 {
108 }
109 }
110
111 static inline void constructn(
113 const T* pSource,
115 {
116 while (numObjects--)
117 {
119 pDestination++;
120 pSource++;
121 }
122 }
123
124 static inline void destroy(
125 T* pObject)
126 {
127 pObject->~T();
128 pObject = 0;
129 }
130
131 static inline void destroy(
132 T* objects,
134 {
135 while (numObjects--)
136 {
138 }
139 }
140
141 static inline bool useRealloc()
142 {
143 return true;
144 }
145};
146class AcGePoint2d;
147class AcGePoint3d;
148
149struct AcImplArrayBuffer;
150template <class T> class AcImplObjectsAllocator;
151template <class T, class A> class AcImplArray;
152
153template < typename Param1, typename Param2 = AcArrayMemCopyReallocator<Param1> >
155{
156public:
157 Param1 & at(int index)
158 {
159 return(mpArray.at(index));
160 }
161
162 Param1 & first(void)
163 {
164 return(mpArray.first());
165 }
166
168 {
169 return(mpArray.begin());
170 }
171
172 const Param1* begin(void) const
173 {
174 return(mpArray.begin());
175 }
176
177 Param1* end(void)
178 {
179 return(mpArray.end());
180 }
181
182 const Param1* end(void) const
183 {
184 return(mpArray.end());
185 }
186
187 Param1 & last(void)
188 {
189 return(mpArray.last());
190 }
191
192 Param1 & operator[](int index)
193 {
194 return(mpArray[index]);
195 }
196
198 {
199 return(mpArray.asArrayPtr());
200 }
201
202 Param1 const & at(int index)const
203 {
204 return(mpArray.at(index));
205 }
206
207 Param1 const & first(void)const
208 {
209 return(mpArray.first());
210 }
211
212 Param1 const & last(void)const
213 {
214 return(mpArray.last());
215 }
216
217 Param1 const & operator[](int index)const
218 {
219 return(mpArray[index]);
220 }
221
222 Param1 const * asArrayPtr(void)const
223 {
224 return(mpArray.asArrayPtr());
225 }
226
228 {
229 mpArray = source.mpArray;
230 }
231
233 {
234 }
235
239
243
245 {
246 }
247
248 bool contains(Param1 const &value, int start = 0)const
249 {
250 return(mpArray.contains(value, start));
251 }
252
253 bool find(Param1 const &value, int &index, int start = 0)const
254 {
255 unsigned int uIndex;
256 bool result = mpArray.find(value, uIndex, start);
257 if (result && uIndex < INT_MAX)
258 {
259 index = uIndex;
260 return(result);
261 }
262 else
263 {
264 return(false);
265 }
266 }
267
268 bool isEmpty(void)const
269 {
270 return(mpArray.isEmpty());
271 }
272
274 {
275 return(mpArray.operator==(array.mpArray));
276 }
277
278 bool remove(Param1 const &value, int start = 0)
279 {
280 return(mpArray.remove(value, start));
281 }
282
284 {
285 mpArray.append(array.mpArray);
286 return(*this);
287 }
288
289 AcArray<Param1, Param2> & insertAt(int index, Param1 const &value)
290 {
291 mpArray.insertAt(index, value);
292 return(*this);
293 }
294
296 {
297 mpArray.operator=(array.mpArray);
298 return(*this);
299 }
300
302 {
303 mpArray.clear();
304 return(*this);
305 }
306
308 {
309 mpArray.removeAt(index);
310 return(*this);
311 }
312
314 {
315 mpArray.removeFirst();
316 return(*this);
317 }
318
320 {
321 mpArray.removeLast();
322 return(*this);
323 }
324
326 {
327 mpArray.removeSubArray(start, end);
328 return(*this);
329 }
330
332 {
333 mpArray.reverse();
334 return(*this);
335 }
336
338 {
339 mpArray.setAll(value);
340 return(*this);
341 }
342
343 AcArray<Param1, Param2> & setAt(int index, Param1 const &value)
344 {
345 mpArray.setAt(index, value);
346 return(*this);
347 }
348
350 {
351 mpArray.setGrowLength(growLength);
352 return(*this);
353 }
354
356 {
357 mpArray.setLogicalLength(logicalLength);
358 return(*this);
359 }
360
362 {
363 mpArray.setPhysicalLength(physicalLength);
364 return(*this);
365 }
366
368 {
369 mpArray.swap(first, second);
370 return(*this);
371 }
372
373 int append(Param1 const &value)
374 {
375 return(mpArray.append(value));
376 }
377
378 int find(Param1 const &value)const
379 {
380 unsigned int uIndex;
381 int index;
382 bool result = mpArray.find(value, uIndex, 0);
383 if (result && uIndex < INT_MAX)
384 {
385 index = uIndex;
386 return(index);
387 }
388 else
389 {
390 return(-1);
391 }
392 }
393
394 int findFrom(Param1 const &value, int start)const
395 {
396 unsigned int uIndex;
397 int index;
398 bool result = mpArray.find(value, uIndex, start);
399 if (uIndex < INT_MAX)
400 {
401 index = uIndex;
402 return(index);
403 }
404 else
405 {
406 return(-1);
407 }
408 }
409
410 int growLength(void)const
411 {
412 return(mpArray.growLength());
413 }
414
415 int length(void)const
416 {
417 return(mpArray.length());
418 }
419
420 int logicalLength(void)const
421 {
422 return(mpArray.logicalLength());
423 }
424
425 int physicalLength(void)const
426 {
427 return(mpArray.physicalLength());
428 }
429
430protected:
431 bool isValid(int index)const
432 {
433 return(mpArray.isValid(index));
434 }
435
436protected:
438};
439
440//---------------------------------------------------------------------------------------------------------------------
441
442template <class T> class AcArrayMemCopyReallocator
443{
444public:
445 typedef unsigned int size_type;
446
447 static inline void copy(T* pDestination, const T* pSource, size_type numObjects)
448 {
449 while (numObjects--)
450 {
452 pDestination++;
453 pSource++;
454 }
455 }
456
457 static inline void move(T* pDestination, const T* pSource, size_type numObjects)
458 {
460 {
462 }
463 else
464 {
465 while (numObjects--)
466 {
468 }
469 }
470 }
471
472 static inline void construct(T* pObject)
473 {
474#ifdef new
475#undef new
476#endif
477 ::new (pObject) T;
478 }
479 static inline void construct(T* pObject, const T& value)
480 {
481#ifdef new
482#undef new
483#endif
484 ::new (pObject) T(value);
485 }
486
487 static inline void constructn(T* pDestination, size_type numObjects, const T& value)
488 {
489 while (numObjects--)
490 {
492 }
493 }
495 {
496 while (numObjects--)
497 {
499 }
500 }
501 static inline void constructn(T* pDestination, const T* pSource, size_type numObjects)
502 {
503 while (numObjects--)
504 {
506 pDestination++;
507 pSource++;
508 }
509 }
510
511 static inline void destroy(T* pObject)
512 {
513 pObject->~T();
514 pObject = 0;
515 }
516 static inline void destroy(T* objects, size_type numObjects)
517 {
518 while (numObjects--)
519 {
521 }
522 }
523
524 static inline bool useRealloc()
525 {
526 return false;
527 }
528};
529
531{
532 typedef unsigned int size_type;
533
534 //mutable AcImplRefCounter m_nRefCounter;
535 mutable int m_nRefCounter;
539
541};
542
543template <class T, class A> class AcImplArray
544{
545public:
546 typedef typename A::size_type size_type;
547 typedef T* iterator;
548 typedef const T* const_iterator;
549
551 {
552 T* data() const { return (T*)(this + 1); }
553
555 {
556 size_type nBytes2Allocate = sizeof(Buffer) + nLength2Allocate * sizeof(T);
557 //ODA_ASSERT(nBytes2Allocate > nLength2Allocate); // size_type overflow
559 {
561 if (pBuffer)
562 {
563 pBuffer->m_nRefCounter = 1;
564 pBuffer->mGrowLen = nGrowBy;
565 pBuffer->mPhysicalLen = nLength2Allocate;
566 pBuffer->mLogicalLen = 0;
567 return pBuffer;
568 }
569 }
570 throw 6;
571 }
572
573 static Buffer* _default()
574 {
576 }
577 void release()
578 {
579 //ODA_ASSERT(m_nRefCounter);
580 if ((--m_nRefCounter) == 0 && this != _default())
581 {
583 free(this);
584 }
585 }
586 void addref() const { ++m_nRefCounter; }
587 };
589 {
590 Buffer* m_pBuffer;
591 bool _may_use_realloc;
592 public:
593 inline reallocator(bool may_use_realloc = false) : _may_use_realloc(may_use_realloc)
594 {
595 if (!_may_use_realloc)
596 {
597 m_pBuffer = Buffer::_default();
598 m_pBuffer->addref();
599 }
600 }
602 {
603 if (!pArray->referenced())
604 {
605 if (nNewLen > pArray->physicalLength())
606 {
607 if (!_may_use_realloc)
608 {
609 m_pBuffer->release();
610 m_pBuffer = pArray->buffer();
611 m_pBuffer->addref(); // save buffer to ensure copy from itself would work (e.g insertAt)
612 }
613 pArray->copy_buffer(nNewLen, _may_use_realloc);
614 }
615 }
616 else
617 {
618 pArray->copy_buffer(nNewLen);
619 }
620 }
622 {
623 if (!_may_use_realloc) m_pBuffer->release();
624 }
625 };
626 friend class reallocator;
628 {
629 return begin();
630 }
632 {
633 return begin();
634 }
636 {
637 return end();
638 }
640 {
641 return end();
642 }
644 {
645 if (referenced())
646 copy_buffer(len);
647 else if (len > physicalLength())
649 }
651 {
652 if (referenced())
653 {
655 }
656 }
657 void copy_buffer(size_type len, bool may_use_realloc = false, bool force_size = false)
658 {
660 int nGrowBy = pOldBuffer->mGrowLen;
661 size_type len2 = len;
662 if (!force_size)
663 {
664 if (nGrowBy > 0)
665 {
666 len2 += nGrowBy;
667 len2 = ((--len2) / nGrowBy) * nGrowBy;
668 }
669 else
670 {
671 len2 = pOldBuffer->mLogicalLen;
672 len2 = len2 + -nGrowBy * len2 / 100;
673 if (len2 < len)
674 {
675 len2 = len;
676 }
677 }
678 }
679 if (may_use_realloc && A::useRealloc() && !empty())
680 {
681 Buffer* pNewBuffer = reinterpret_cast<Buffer*>(realloc(pOldBuffer, len2 * sizeof(T) + sizeof(Buffer)));
682 pNewBuffer->mPhysicalLen = len2;
683 pNewBuffer->mLogicalLen = ( pNewBuffer->mLogicalLen < len ) ? pNewBuffer->mLogicalLen : len;
684 m_pData = pNewBuffer->data();
685 }
686 else
687 {
689 len = ( pOldBuffer->mLogicalLen < len ) ? pOldBuffer->mLogicalLen : len;
690 A::constructn(pNewBuffer->data(), pOldBuffer->data(), len);
691 pNewBuffer->mLogicalLen = len;
692 m_pData = pNewBuffer->data();
693 pOldBuffer->release();
694 }
695 }
696 inline void assertValid(size_type index) const
697 {
698 if (!isValid(index))
699 {
700 //throw;
701 }
702 }
703
704 static inline void rise_error(int e)
705 {
706 throw e;
707 }
708
709public:
710 // STL-like interface
711
713 {
714 if (!empty())
715 {
717 return data();
718 }
719 return 0;
720 }
722 {
723 if (!empty())
724 {
725 return data();
726 }
727 return 0;
728 }
729
731 {
732 if (!empty())
733 {
735 return data() + length();
736 }
737 return 0;
738 }
740 {
741 if (!empty())
742 {
743 return data() + length();
744 }
745 return 0;
746 }
747
749 {
750 size_type len = length();
751 size_type index = (size_type)(before - begin_const());
753 {
754 if (afterLast > first)
755 {
757 reallocator r(first < begin() || first >= end());
758 r.reallocate(this, len + num2copy);
760 buffer()->mLogicalLen = len + num2copy;
761 T* pDestination = m_pData + index;
762 if (index != len)
763 {
764 A::move(pDestination + num2copy, pDestination, len - index);
765 }
767 }
768 }
769 else
770 {
771 rise_error(3);
772 }
773 }
774
775 void resize(size_type logicalLength, const T& value)
776 {
777 size_type len = length();
778 int d = logicalLength - len;
779 if (d > 0)
780 {
781 reallocator r(m_pData > &value || &value > (m_pData + len));
782 r.reallocate(this, logicalLength);
783 A::constructn(m_pData + len, d, value);
784 }
785 else if (d < 0)
786 {
787 d = -d;
788 if (!referenced())
789 {
791 }
792 else
793 {
795 }
796 }
798 }
799
801 {
802 size_type len = length();
803 int d = logicalLength - len;
804 if (d > 0)
805 {
806 copy_before_write(len + d, true);
807 A::constructn(m_pData + len, d);
808 }
809 else if (d < 0)
810 {
811 d = -d;
812 if (!referenced())
813 {
815 }
816 else
817 {
819 }
820 }
822 }
823
825 {
826 return buffer()->mLogicalLen;
827 }
828
829 bool empty() const
830 {
831 return size() == 0;
832 }
833
835 {
836 return buffer()->mPhysicalLen;
837 }
838
846
852
854 {
856 if (first != afterLast)
857 {
859 }
860 return begin_non_const() + i;
861 }
862
864 {
866 removeAt(i);
867 return begin_non_const() + i;
868 }
869
870 void clear()
871 {
873 }
874
875 void push_back(const T& value)
876 {
877 insertAt(length(), value);
878 }
879
880 iterator insert(iterator before, size_type numElements, const T& value)
881 {
882 size_type len = length();
883 size_type index = before - begin_const();
884 reallocator r(m_pData > &value || &value > (m_pData + len));
885 r.reallocate(this, len + numElements);
886 A::constructn(m_pData + len, numElements, value);
887 buffer()->mLogicalLen = len + numElements;
888 T* pData = data();
889 pData += index;
890 if (index != len)
891 {
892 A::move(pData + numElements, pData, len - index);
893 }
894 while (numElements--)
895 {
896 pData[numElements] = value;
897 }
898 return begin_non_const() + index;
899 }
900
901 iterator insert(iterator before, const T& value = T())
902 {
903 size_type index = before - begin_const();
904 insertAt(index, value);
905 return (begin_non_const() + index);
906 }
907
908 // ARX-like interface
909
910 bool contains(const T& value, size_type start = 0) const
911 {
913 return find(value, dummy, start);
914 }
915
917 {
918 return buffer()->mLogicalLen;
919 }
920
921 bool isEmpty() const
922 {
923 return length() == 0;
924 }
925
927 {
928 return length();
929 }
930
932 {
933 return buffer()->mPhysicalLen;
934 }
935
936 int growLength() const
937 {
938 return buffer()->mGrowLen;
939 }
940
941 const T* asArrayPtr() const
942 {
943 return data();
944 }
945
946 const T* getPtr() const
947 {
948 return data();
949 }
950
952 {
954 return data();
955 }
956
957 const T& operator [](size_type index) const
958 {
959 assertValid(index);
960 return m_pData[index];
961 }
963 {
964 assertValid(index);
966 return m_pData[index];
967 }
968
975 const T& at(size_type arrayIndex) const
976 {
978 return m_pData[arrayIndex];
979 }
980
982 {
985 m_pData[arrayIndex] = value;
986 return *this;
987 }
988
990 {
992 return m_pData[arrayIndex];
993 }
994
996 {
997 return *begin();
998 }
999 const T& first() const
1000 {
1001 return *begin();
1002 }
1003
1005 {
1006 return at(length() - 1);
1007 }
1008 const T& last() const
1009 {
1010 return at(length() - 1);
1011 }
1012
1013 size_type append(const T& value)
1014 {
1015 insertAt(length(), value);
1016 return length() - 1;
1017 }
1018
1020 {
1021 size_type i = append(T());
1022 return begin_non_const() + i;
1023 }
1024
1026 {
1027 return removeAt(0);
1028 }
1029
1031 {
1032 return removeAt(length() - 1);
1033 }
1034
1036 {
1037 if (growLength != 0)
1038 {
1041 }
1042 else
1043 {
1044 //ODA_FAIL();
1045 }
1046 return *this;
1047 }
1048
1050 {
1051 if (growLength == 0)
1052 {
1053 growLength = 8;
1054 }
1056 reallocator r(false);
1057 r.reallocate(this, 1);
1058 }
1059
1060 AcImplArray() : m_pData(Buffer::_default()->data())
1061 {
1062 buffer()->addref();
1063 reallocator r(false);
1064 r.reallocate(this, 1);
1065 }
1066
1067 AcImplArray(const AcImplArray& source) : m_pData((T*)source.data())
1068 {
1069 buffer()->addref();
1070 reallocator r(false);
1071 r.reallocate(this, 1);
1072 }
1073
1075 {
1076 buffer()->release();
1077 }
1078
1080 {
1081 source.buffer()->addref();
1082 buffer()->release();
1083 m_pData = source.m_pData;
1084 return *this;
1085 }
1086
1087 bool operator ==(const AcImplArray& array) const
1088 {
1089 if (length() == array.length())
1090 {
1091 for (size_type i = 0; i < length(); i++)
1092 {
1093 if (at(i) != array[i])
1094 {
1095 return false;
1096 }
1097 }
1098 return true;
1099 }
1100 return false;
1101 }
1102
1103 AcImplArray& setAll(const T& value)
1104 {
1106 T* pData = data();
1107 size_type n = length();
1108 while (n)
1109 {
1110 pData[--n] = value;
1111 }
1112 return *this;
1113 }
1114
1116 {
1117 insert(end_non_const(), otherArray.begin(), otherArray.end());
1118 return *this;
1119 }
1120
1122 {
1123 size_type len = length();
1124 if (arrayIndex == len)
1125 {
1126 resize(len + 1, value);
1127 }
1128 else if (arrayIndex < len)
1129 {
1130 T temp(value);
1131 reallocator r(m_pData > &value || &value > (m_pData + len));
1132 r.reallocate(this, len + 1);
1133 A::construct(m_pData + len);
1134 ++(buffer()->mLogicalLen);
1137 }
1138 else
1139 {
1140 //rise_error(24);
1141 return *this;
1142 }
1143 return *this;
1144 }
1145
1147 {
1148 if (!isValid(arrayIndex))
1149 return *this;
1150 size_type len = length();
1151 if (arrayIndex < --len)
1152 {
1154 T* pData = data();
1155 A::move(pData + arrayIndex, pData + arrayIndex + 1, len - arrayIndex);
1156 }
1157 resize(len);
1158
1159 return *this;
1160 }
1161
1163 {
1165 {
1166 //rise_error(24);
1167 return *this;
1168 }
1169 size_type len = length();
1171 T* pData = data();
1172 if (endIndex > len - 1)
1173 endIndex = len - 1;
1174 ++endIndex;
1176 A::move(pData + startIndex, pData + endIndex, len - endIndex);
1177 A::destroy(pData + len - n2remove, n2remove);
1179 return *this;
1180 }
1181
1182 bool find(const T& value, size_type& findIndex, size_type start = 0) const
1183 {
1184 if (!empty())
1185 {
1186 if (start >= length())
1187 return false;
1188
1189 size_type len = length();
1190 const T* pData = data();
1191 for (size_type i = start; i < len; ++i)
1192 {
1193 if (pData[i] == value)
1194 {
1195 findIndex = i;
1196 return true;
1197 }
1198 }
1199 }
1200 return false;
1201 }
1202
1204 {
1206 return *this;
1207 }
1208
1210 {
1211 if (physLength == 0)
1212 {
1213 *this = AcImplArray<T, A>();
1214 }
1215 else if (physLength != physicalLength())
1216 {
1217 copy_buffer(physLength, true, true);
1218 }
1219 return *this;
1220 }
1221
1223 {
1224 if (!empty())
1225 {
1227 T tmp;
1230 --iter2;
1231 while (iter1 < iter2)
1232 {
1233 tmp = *iter1;
1234 *iter1 = *iter2;
1235 *iter2 = tmp;
1236 ++iter1;
1237 --iter2;
1238 }
1239 }
1240 return *this;
1241 }
1242
1244 {
1246 {
1247 rise_error(24);
1248 }
1249 if (firstIndex != secondIndex)
1250 {
1251 const T tmp = at(firstIndex);
1253 at(secondIndex) = tmp;
1254 }
1255 return *this;
1256 }
1257
1258 bool remove(const T& value, size_type start = 0)
1259 {
1260 size_type i = 0;
1261 if (find(value, i, start))
1262 {
1263 removeAt(i);
1264 return true;
1265 }
1266 return false;
1267 }
1268
1270
1271 bool isValid(size_type i) const
1272 {
1273 return (i >= 0 && i < length());
1274 }
1275
1277 {
1278 return (length() ? m_pData : 0);
1279 }
1280
1281 const T* data() const
1282 {
1283 return m_pData;
1284 }
1285
1287 {
1288 return (reinterpret_cast<Buffer*>(const_cast<AcImplArray*>(this)->m_pData) - 1);
1289 }
1290 bool referenced() const
1291 {
1292 return (buffer()->m_nRefCounter > 1);
1293 }
1294};
#define ARX_API_STATIC
Definition FxARXAPI.h:25
AcImplArray< Param1, Param2 > mpArray
Definition _AcArray.h:437
AcArray< Param1, Param2 > & operator=(AcArray< Param1, Param2 > const &array)
Definition _AcArray.h:295
Param1 const & operator[](int index) const
Definition _AcArray.h:217
Param1 const & at(int index) const
Definition _AcArray.h:202
int find(Param1 const &value) const
Definition _AcArray.h:378
Param1 * begin(void)
Definition _AcArray.h:167
AcArray()
Definition _AcArray.h:232
AcArray< Param1, Param2 > & setGrowLength(int growLength)
Definition _AcArray.h:349
AcArray< Param1, Param2 > & removeFirst(void)
Definition _AcArray.h:313
int logicalLength(void) const
Definition _AcArray.h:420
Param1 const * asArrayPtr(void) const
Definition _AcArray.h:222
const Param1 * begin(void) const
Definition _AcArray.h:172
AcArray< Param1, Param2 > & removeAt(int index)
Definition _AcArray.h:307
bool find(Param1 const &value, int &index, int start=0) const
Definition _AcArray.h:253
AcArray(int physicalLength)
Definition _AcArray.h:236
bool remove(Param1 const &value, int start=0)
Definition _AcArray.h:278
AcArray< Param1, Param2 > & removeLast(void)
Definition _AcArray.h:319
AcArray< Param1, Param2 > & removeAll(void)
Definition _AcArray.h:301
int physicalLength(void) const
Definition _AcArray.h:425
int append(Param1 const &value)
Definition _AcArray.h:373
AcArray< Param1, Param2 > & setLogicalLength(int logicalLength)
Definition _AcArray.h:355
Param1 * asArrayPtr(void)
Definition _AcArray.h:197
int findFrom(Param1 const &value, int start) const
Definition _AcArray.h:394
Param1 & last(void)
Definition _AcArray.h:187
AcArray(int physicalLength, int growLength)
Definition _AcArray.h:240
AcArray< Param1, Param2 > & insertAt(int index, Param1 const &value)
Definition _AcArray.h:289
int length(void) const
Definition _AcArray.h:415
Param1 * end(void)
Definition _AcArray.h:177
bool isValid(int index) const
Definition _AcArray.h:431
Param1 const & first(void) const
Definition _AcArray.h:207
Param1 & first(void)
Definition _AcArray.h:162
bool contains(Param1 const &value, int start=0) const
Definition _AcArray.h:248
bool operator==(AcArray< Param1, Param2 > const &array) const
Definition _AcArray.h:273
AcArray< Param1, Param2 > & swap(int first, int second)
Definition _AcArray.h:367
int growLength(void) const
Definition _AcArray.h:410
AcArray< Param1, Param2 > & append(AcArray< Param1, Param2 > const &array)
Definition _AcArray.h:283
~AcArray(void)
Definition _AcArray.h:244
AcArray< Param1, Param2 > & setPhysicalLength(int physicalLength)
Definition _AcArray.h:361
Param1 const & last(void) const
Definition _AcArray.h:212
AcArray< Param1, Param2 > & setAt(int index, Param1 const &value)
Definition _AcArray.h:343
AcArray(AcArray< Param1, Param2 > const &source)
Definition _AcArray.h:227
const Param1 * end(void) const
Definition _AcArray.h:182
Param1 & operator[](int index)
Definition _AcArray.h:192
AcArray< Param1, Param2 > & removeSubArray(int start, int end)
Definition _AcArray.h:325
AcArray< Param1, Param2 > & reverse(void)
Definition _AcArray.h:331
AcArray< Param1, Param2 > & setAll(Param1 const &value)
Definition _AcArray.h:337
Param1 & at(int index)
Definition _AcArray.h:157
bool isEmpty(void) const
Definition _AcArray.h:268
static void constructn(T *pDestination, const T *pSource, size_type numObjects)
Definition _AcArray.h:501
static void destroy(T *pObject)
Definition _AcArray.h:511
static void copy(T *pDestination, const T *pSource, size_type numObjects)
Definition _AcArray.h:447
static void construct(T *pObject, const T &value)
Definition _AcArray.h:479
static void constructn(T *pDestination, size_type numObjects, const T &value)
Definition _AcArray.h:487
static void move(T *pDestination, const T *pSource, size_type numObjects)
Definition _AcArray.h:457
static void destroy(T *objects, size_type numObjects)
Definition _AcArray.h:516
static void construct(T *pObject)
Definition _AcArray.h:472
static bool useRealloc()
Definition _AcArray.h:524
static void constructn(T *pDestination, size_type numObjects)
Definition _AcArray.h:494
static void move(T *pDestination, const T *pSource, size_type numObjects)
Definition _AcArray.h:38
static void construct(T *pObject)
Definition _AcArray.h:60
static void construct(T *pObject, const T &value)
Definition _AcArray.h:74
static void constructn(T *pDestination, const T *pSource, size_type numObjects)
Definition _AcArray.h:111
static void destroy(T *pObject)
Definition _AcArray.h:124
static void constructn(T *pDestination, size_type numObjects, const T &value)
Definition _AcArray.h:90
static void constructn(T *pDestination, size_type numObjects)
Definition _AcArray.h:101
static void destroy(T *objects, size_type numObjects)
Definition _AcArray.h:131
static void copy(T *pDestination, const T *pSource, size_type numObjects)
Definition _AcArray.h:25
void reallocate(AcImplArray *pArray, size_type nNewLen)
Definition _AcArray.h:601
reallocator(bool may_use_realloc=false)
Definition _AcArray.h:593
size_type capacity() const
Definition _AcArray.h:834
bool remove(const T &value, size_type start=0)
Definition _AcArray.h:1258
T & at(size_type arrayIndex)
Definition _AcArray.h:969
int growLength() const
Definition _AcArray.h:936
static void rise_error(int e)
Definition _AcArray.h:704
Buffer * buffer() const
Definition _AcArray.h:1286
iterator erase(iterator where)
Definition _AcArray.h:863
void copy_before_write(size_type len, bool may_use_realloc=false)
Definition _AcArray.h:643
void assertValid(size_type index) const
Definition _AcArray.h:696
bool find(const T &value, size_type &findIndex, size_type start=0) const
Definition _AcArray.h:1182
bool empty() const
Definition _AcArray.h:829
void push_back(const T &value)
Definition _AcArray.h:875
const_iterator end_const()
Definition _AcArray.h:635
AcImplArray & operator=(const AcImplArray &source)
Definition _AcArray.h:1079
AcImplArray(size_type physicalLength, int growLength=8)
Definition _AcArray.h:1049
AcImplArray & setAt(size_type arrayIndex, const T &value)
Definition _AcArray.h:981
const T * asArrayPtr() const
Definition _AcArray.h:941
const T & last() const
Definition _AcArray.h:1008
bool isValid(size_type i) const
Definition _AcArray.h:1271
const T & getAt(size_type arrayIndex) const
Definition _AcArray.h:989
const T & operator[](size_type index) const
Definition _AcArray.h:957
AcImplArray(const AcImplArray &source)
Definition _AcArray.h:1067
bool referenced() const
Definition _AcArray.h:1290
void copy_buffer(size_type len, bool may_use_realloc=false, bool force_size=false)
Definition _AcArray.h:657
iterator end_non_const()
Definition _AcArray.h:639
size_type length() const
Definition _AcArray.h:916
const T * getPtr() const
Definition _AcArray.h:946
const_iterator begin() const
Definition _AcArray.h:721
iterator insert(iterator before, size_type numElements, const T &value)
Definition _AcArray.h:880
size_type logicalLength() const
Definition _AcArray.h:926
iterator end()
Definition _AcArray.h:730
void resize(size_type logicalLength, const T &value)
Definition _AcArray.h:775
bool contains(const T &value, size_type start=0) const
Definition _AcArray.h:910
iterator erase(iterator first, iterator afterLast)
Definition _AcArray.h:853
void reserve(size_type reserveLength)
Definition _AcArray.h:839
void insert(iterator before, const_iterator first, const_iterator afterLast)
Definition _AcArray.h:748
size_type physicalLength() const
Definition _AcArray.h:931
size_type size() const
Definition _AcArray.h:824
T * asArrayPtr()
Definition _AcArray.h:951
AcImplArray & append(const AcImplArray &otherArray)
Definition _AcArray.h:1115
A::size_type size_type
Definition _AcArray.h:546
iterator begin_non_const()
Definition _AcArray.h:631
AcImplArray & removeFirst()
Definition _AcArray.h:1025
const T * const_iterator
Definition _AcArray.h:548
iterator append()
Definition _AcArray.h:1019
AcImplArray & reverse()
Definition _AcArray.h:1222
AcImplArray & setPhysicalLength(size_type physLength)
Definition _AcArray.h:1209
const T & at(size_type arrayIndex) const
Definition _AcArray.h:975
AcImplArray & removeLast()
Definition _AcArray.h:1030
AcImplArray & setLogicalLength(size_type logLength)
Definition _AcArray.h:1203
AcImplArray & setAll(const T &value)
Definition _AcArray.h:1103
const_iterator begin_const() const
Definition _AcArray.h:627
void copy_if_referenced()
Definition _AcArray.h:650
void resize(size_type logicalLength)
Definition _AcArray.h:800
T & first()
Definition _AcArray.h:995
size_type append(const T &value)
Definition _AcArray.h:1013
AcImplArray & insertAt(size_type arrayIndex, const T &value)
Definition _AcArray.h:1121
bool isEmpty() const
Definition _AcArray.h:921
AcImplArray & setGrowLength(int growLength)
Definition _AcArray.h:1035
bool operator==(const AcImplArray &array) const
Definition _AcArray.h:1087
iterator begin()
Definition _AcArray.h:712
const_iterator end() const
Definition _AcArray.h:739
AcImplArray & removeSubArray(size_type startIndex, size_type endIndex)
Definition _AcArray.h:1162
const T & first() const
Definition _AcArray.h:999
AcImplArray & removeAt(size_type arrayIndex)
Definition _AcArray.h:1146
void assign(const_iterator first, const_iterator afterLast)
Definition _AcArray.h:847
const T * data() const
Definition _AcArray.h:1281
iterator insert(iterator before, const T &value=T())
Definition _AcArray.h:901
AcImplArray & swap(size_type firstIndex, size_type secondIndex)
Definition _AcArray.h:1243
void clear()
Definition _AcArray.h:870
void addref() const
Definition _AcArray.h:586
T * data() const
Definition _AcArray.h:552
static Buffer * _default()
Definition _AcArray.h:573
static Buffer * allocate(size_type nLength2Allocate, int nGrowBy)
Definition _AcArray.h:554
unsigned int size_type
Definition _AcArray.h:532
size_type mLogicalLen
Definition _AcArray.h:538
static ARX_API_STATIC AcImplArrayBuffer g_empty_array_buffer
Definition _AcArray.h:540
size_type mPhysicalLen
Definition _AcArray.h:537