7#include <gtest/gtest.h>
9#include "arccore/collections/Array.h"
10#include "arccore/collections/IMemoryAllocator.h"
12#include "arccore/base/FatalErrorException.h"
13#include "arccore/base/Iterator.h"
15#include "TestArrayCommon.h"
18using namespace TestArccore;
22void _testArraySwap(
bool use_own_swap)
24 std::cout <<
"** TestArraySwap is_own=" << use_own_swap <<
"\n";
28 std::cout <<
"** C1_this = " << &c1 <<
"\n";
29 std::cout <<
"** C1_BASE = " << x1 <<
"\n";
32 std::cout <<
"** C2_this = " << &c2 <<
"\n";
33 std::cout <<
"** C2_BASE = " << x2 <<
"\n";
43 std::cout <<
"** C1_BASE_AFTER = " << after_x1 <<
" size=" << c1.size() <<
"\n";
44 std::cout <<
"** C2_BASE_AFTER = " << after_x2 <<
" size=" << c2.size() <<
"\n";
46 ASSERT_TRUE(x1 == after_x2) <<
"Bad value after swap [1]";
47 ASSERT_TRUE(x2 == after_x1) <<
"Bad value after swap [2]";
58 _testArraySwap(
false);
64Integer IntPtrSubClass::count = 0;
69template <
typename Container,
typename SubClass>
81 ARCCORE_UT_CHECK((c.size() == 3),
"Bad size (3)");
82 ARCCORE_UT_CHECK((c[0] == 1),
"Bad value [0]");
83 ARCCORE_UT_CHECK((c[1] == 2),
"Bad value [1]");
84 ARCCORE_UT_CHECK((c[2] == 3),
"Bad value [2]");
86 ARCCORE_UT_CHECK((c.size() == 0),
"Bad size (0)");
88 ARCCORE_UT_CHECK((c.size() == 5),
"Bad size");
90 ARCCORE_UT_CHECK((c.size() == 6),
"Bad size");
91 ARCCORE_UT_CHECK((c[5] == 6),
"Bad value [5]");
93 ASSERT_EQ(c.size(), c.capacity()) <<
"Bad capacity (test 1)";
96 ASSERT_EQ(c.size(), c.capacity()) <<
"Bad capacity (test 2)";
101 ASSERT_EQ(c.capacity(), 0) <<
"Bad capacity (test 3)";
106 for (
Integer i = 0; i < nb; ++i)
109 Int64 current_capacity = c.capacity();
110 ASSERT_EQ(current_capacity, (nb * 2)) <<
"Bad capacity (test 4)";
111 c.shrink(c.capacity() + 5);
112 ASSERT_EQ(c.capacity(), current_capacity) <<
"Bad capacity (test 5)";
114 ASSERT_EQ(c.capacity(), 32) <<
"Bad capacity (test 6)";
116 ASSERT_EQ(c.capacity(), c.size()) <<
"Bad capacity (test 7)";
122 for (Container& c : uc) {
129 for (
Integer i = 0; i < 50; ++i)
130 c.add(SubClass(i + 2));
133 for (
Integer i = 50; i < 100; ++i) {
134 c2.add(SubClass(i + 2));
142 for (
Integer i = 100; i < 150; ++i) {
143 c4.add(SubClass(i + 2));
146 ARCCORE_UT_CHECK((c.size() == 150),
"Bad size (150)");
148 ARCCORE_UT_CHECK((c.capacity() == 300),
"Bad capacity (300)");
149 for (
Integer i = 0; i < 50; ++i) {
152 ARCCORE_UT_CHECK((c.size() == 100),
"Bad size (100)");
153 for (
Integer i = 0; i < 50; ++i) {
155 ARCCORE_UT_CHECK((c[i] == ((i * 2) + 3)),
"Bad value");
157 for (
Integer i = 50; i < 100; ++i) {
159 ARCCORE_UT_CHECK((c[i] == (i + 52)),
"Bad value");
167void _testArrayNewInternal()
170 std::cout <<
"** TEST VECTOR NEW\n";
179 std::cout <<
"** TEST VECTOR NEW 2\n";
183 std::cout <<
"** COUNT = " << IntPtrSubClass::count <<
"\n";
185 std::cout <<
"** TEST VECTOR NEW 3\n";
189 std::cout <<
"** COUNT = " << IntPtrSubClass::count <<
"\n";
197 ARCCORE_UT_CHECK((c2.size() == 3),
"Bad value [3]");
198 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
199 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
200 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
201 ARCCORE_UT_CHECK((c2[0] == 5),
"Bad value [5]");
202 ARCCORE_UT_CHECK((c2[1] == 7),
"Bad value [7]");
203 ARCCORE_UT_CHECK((c2[2] == 3),
"Bad value [7]");
211 ARCCORE_UT_CHECK((c2.size() == 3),
"Bad value [3]");
212 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
213 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
214 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
215 ARCCORE_UT_CHECK((c2[0] == 5),
"Bad value [5]");
216 ARCCORE_UT_CHECK((c2[1] == 7),
"Bad value [7]");
217 ARCCORE_UT_CHECK((c2[2] == 3),
"Bad value [7]");
223 ARCCORE_UT_CHECK((c2.size() == 3),
"Bad value [3]");
224 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
225 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
226 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
227 ARCCORE_UT_CHECK((c2[0] == 5),
"Bad value [5]");
228 ARCCORE_UT_CHECK((c2[1] == 7),
"Bad value [7]");
229 ARCCORE_UT_CHECK((c2[2] == 3),
"Bad value [7]");
233 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
234 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
235 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
239 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
240 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
241 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
247 ARCCORE_UT_CHECK((cx.size() == 5),
"Bad value [5]");
252 ARCCORE_UT_CHECK((c2.size() == 3),
"Bad value [3]");
253 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
254 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
255 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
256 ARCCORE_UT_CHECK((c2[0] == 5),
"Bad value [5]");
257 ARCCORE_UT_CHECK((c2[1] == 7),
"Bad value [7]");
258 ARCCORE_UT_CHECK((c2[2] == 3),
"Bad value [7]");
259 for (
Integer i = 0; i < 50; ++i)
269 ASSERT_EQ(c22.size(),33);
279 ASSERT_EQ(c2.
size(),c3.size());
280 ASSERT_EQ(c2.
size(),c4.size());
282 ASSERT_EQ(c2.
size(),c3.size());
283 ASSERT_EQ(c2.
size(),c4.size());
288 ARCCORE_UT_CHECK((c2.
size() == 33),
"Bad value [3]");
289 ARCCORE_UT_CHECK((c2[0] == 5),
"Bad value [5]");
290 ARCCORE_UT_CHECK((c2[1] == 7),
"Bad value [7]");
291 ARCCORE_UT_CHECK((c2[32] == 3),
"Bad value [7]");
293 ASSERT_EQ(c2.
size(),1293);
294 ASSERT_EQ(c22.size(),2);
298 ASSERT_EQ(values1.
size(),3);
299 ASSERT_EQ(values1[0],-7);
300 ASSERT_EQ(values1[1],3);
301 ASSERT_EQ(values1[2],4);
302 values1 = { 2, -1, 9, 13 };
303 ASSERT_EQ(values1.
size(),4);
304 ASSERT_EQ(values1[0],2);
305 ASSERT_EQ(values1[1],-1);
306 ASSERT_EQ(values1[2],9);
307 ASSERT_EQ(values1[3],13);
309 ASSERT_EQ(values2,values1);
312 ASSERT_EQ(values1.
size(),0);
313 ASSERT_EQ(values2.
size(),0);
321 std::copy(std::begin(values2), std::end(values2), std::back_inserter(values1));
322 std::cout <<
"** VALUES1 = " << values1 <<
"\n";
323 ARCCORE_UT_CHECK((values1.size() == 5),
"BI: Bad size");
324 ARCCORE_UT_CHECK((values1[0] == 2),
"BI: Bad value [0]");
325 ARCCORE_UT_CHECK((values1[1] == 5),
"BI: Bad value [1]");
326 ARCCORE_UT_CHECK((values1[2] == 4),
"BI: Bad value [2]");
327 ARCCORE_UT_CHECK((values1[3] == 9),
"BI: Bad value [3]");
328 ARCCORE_UT_CHECK((values1[4] == 7),
"BI: Bad value [4]");
334 std::cout <<
"V=" << i->m_v <<
" " << ci->m_v <<
'\n';
337 ASSERT_EQ(values1.size(),2);
338 ASSERT_EQ(values1[0],-7);
339 ASSERT_EQ(values1[1],3);
342 ASSERT_EQ(values1.size(),0);
348 values1.
copy(values2);
349 std::cout <<
"** VALUES1 = " << values1 <<
"\n";
350 ARCCORE_UT_CHECK((values1.size() == 5),
"BI: Bad size");
351 ARCCORE_UT_CHECK((values1[0] == 4),
"BI2: Bad value [0]");
352 ARCCORE_UT_CHECK((values1[1] == 9),
"BI2: Bad value [1]");
353 ARCCORE_UT_CHECK((values1[2] == 7),
"BI2: Bad value [2]");
354 ARCCORE_UT_CHECK((values1[3] == 6),
"BI2: Bad value [3]");
355 ARCCORE_UT_CHECK((values1[4] == 3),
"BI2: Bad value [4]");
361 std::cout <<
"V=" << i->m_v <<
" " << ci->m_v <<
'\n';
368 std::cout <<
"V=" << i->m_v <<
" " << ci->m_v <<
'\n';
371 std::cout <<
"V=" << cicvx->m_v <<
'\n';
379 std::cout <<
"V=" << i->m_v <<
" " << ci->m_v <<
" " << (iend - i) <<
'\n';
382 std::cout <<
"V=" << cicvx->m_v <<
'\n';
383 std::copy(std::begin(vx), std::end(vx), std::begin(vx));
388 std::cout << *i <<
'\n';
391 std::cout << *i <<
'\n';
393 for (
auto i : values.range()) {
394 std::cout << i <<
'\n';
396 for (
auto i : values.constView().range()) {
397 std::cout << i <<
'\n';
401 auto r1 = std::make_reverse_iterator(values.
end());
402 auto r2 = std::make_reverse_iterator(values.
begin());
403 for (; r1 != r2; ++r1) {
404 std::cout <<
"RVALUE = " << *r1 <<
'\n';
408 auto r1 = values.
rbegin();
421 ARCCORE_UT_CHECK((c2.
size() == 3),
"Bad value [3]");
422 ARCCORE_UT_CHECK((c.
size() == 2),
"Bad value [2]");
423 ARCCORE_UT_CHECK((c[0] == 5),
"Bad value [5]");
424 ARCCORE_UT_CHECK((c[1] == 7),
"Bad value [7]");
425 ARCCORE_UT_CHECK((c2[0] == 5),
"Bad value [5]");
426 ARCCORE_UT_CHECK((c2[1] == 7),
"Bad value [7]");
427 ARCCORE_UT_CHECK((c2[2] == 3),
"Bad value [7]");
444 _testArrayNewInternal();
447 std::cerr <<
"Exception ex=" << ex <<
"\n";
478 std::cout <<
" Value: " << x <<
'\n';
480 v.printInfos(std::cout);
487 v.printInfos(std::cout);
491 v.printInfos(std::cout);
493 v.printInfos(std::cout);
498 v.printInfos(std::cout);
500 std::cout <<
" Value: " << v[i] <<
'\n';
506 for (
int i = 0; i < 10; ++i)
509 std::cout <<
" Value: " << v[i] <<
'\n';
515 for (
int i = 0; i < 27500; ++i) {
519 for (
int i = 0; i < 5000; ++i) {
523 for (
int i = 0; i < 27500; ++i) {
527 std::cout <<
" ValueSize= " << v.
size() <<
" values=" << v <<
'\n';
529 for (
Integer i = 0; i < 100; ++i) {
538 std::cout <<
" Size: " << v.
size() <<
'\n';
539 ASSERT_EQ(v.
size(), 230000);
554 for (
Int32 i = 0, n = v.
size(); i < n; ++i)
557 auto sub_view1 = v.
subView(50, 5);
558 ASSERT_EQ(sub_view1.data(),
nullptr);
559 ASSERT_EQ(sub_view1.size(), 0);
561 auto sub_view2 = v.
subView(2, 8);
562 ASSERT_EQ(sub_view2.size(), 8);
563 for (
Int32 i = 0, n = sub_view2.size(); i < n; ++i)
564 ASSERT_EQ(sub_view2[i], v[2 + i]);
566 auto sub_view3 = v.
subView(20, 8);
567 ASSERT_EQ(sub_view3.size(), 3);
568 for (
Int32 i = 0, n = sub_view3.size(); i < n; ++i)
569 ASSERT_EQ(sub_view3[i], v[20 + i]);
572 ASSERT_EQ(sub_const_view1.data(),
nullptr);
573 ASSERT_EQ(sub_const_view1.size(), 0);
576 ASSERT_EQ(sub_const_view2.size(), 8);
577 for (
Int32 i = 0, n = sub_const_view2.size(); i < n; ++i)
578 ASSERT_EQ(sub_const_view2[i], v[2 + i]);
581 ASSERT_EQ(sub_const_view3.size(), 3);
582 for (
Int32 i = 0, n = sub_const_view3.size(); i < n; ++i)
583 ASSERT_EQ(sub_const_view3[i], v[20 + i]);
596template <
typename DataType>
614 const Int32 ref_value1 = 12;
615 const Int32 ref_value2 = 7;
618 std::cout <<
"C1=" << c <<
"\n";
620 ASSERT_EQ(x, ref_value1);
623 ASSERT_EQ(c.size(), 21);
624 std::cout <<
"C2=" << c <<
"\n";
629 std::cout <<
"C4=" << c <<
"\n";
630 for (
Int32 i = 9, s = c.size(); i < s; ++i)
631 ASSERT_EQ(c[i], ref_value2);
632 for (
Int32 i = 9, s = c.size(); i < s; ++i)
634 for (
Int32 i = 9, s = c.size(); i < s; ++i)
635 ASSERT_EQ(c[i], (i + 2));
646template<
typename ArrayType>
650 static void doTestBase()
659 std::cout <<
"Array a\n";
660 ArrayType a(allocator1);
661 ASSERT_EQ(a.allocator(),allocator1);
667 std::cout <<
"Array b\n";
668 ArrayType b(allocator2);
669 ASSERT_EQ(b.capacity(),0);
670 ASSERT_EQ(b.size(),0);
671 ASSERT_EQ(b.allocator(),allocator2);
674 ASSERT_EQ(b.size(),a.size());
675 ASSERT_EQ(b.allocator(),a.allocator());
677 std::cout <<
"Array c\n";
678 ArrayType c(a.clone());
679 ASSERT_EQ(c.allocator(),a.allocator());
680 ASSERT_EQ(c.size(),a.size());
681 ASSERT_EQ(c.constSpan(),a.constSpan());
683 std::cout <<
"Array d\n";
684 ArrayType d(allocator2,a);
685 ASSERT_EQ(d.allocator(),allocator2);
686 ASSERT_EQ(d.size(),a.size());
687 ASSERT_EQ(d.constSpan(),a.constSpan());
689 std::cout <<
"Array e\n";
690 ArrayType e(allocator2,25);
691 ASSERT_EQ(e.allocator(),allocator2);
692 ASSERT_EQ(e.size(),25);
694 ArrayType f(allocator2);
696 ASSERT_EQ(f.allocator(),e.allocator());
697 ASSERT_EQ(f.size(),e.size());
700 ASSERT_EQ(f.allocator(),e.allocator());
701 ASSERT_EQ(f.size(),e.size());
723 std::cout <<
"Sizeof(ArrayMetaData)=" <<
sizeof(
ArrayMetaData) <<
"\n";
732 std::cout <<
"Array a1\n";
734 ASSERT_EQ(a1.allocator(), allocator2);
735 ASSERT_EQ(a1.size(), 0);
736 ASSERT_EQ(a1.capacity(), 0);
737 ASSERT_EQ(a1.data(),
nullptr);
739 std::cout <<
"Array a2\n";
741 ASSERT_EQ(a1.allocator(), a2.allocator());
742 ASSERT_EQ(a2.capacity(), 0);
743 ASSERT_EQ(a2.data(),
nullptr);
750 ASSERT_EQ(a1.size(), 5);
752 std::cout <<
"Array a3\n";
757 ASSERT_EQ(a3.size(), 3);
759 ASSERT_EQ(a3.allocator(), a1.allocator());
760 ASSERT_EQ(a3.size(), a1.size());
761 ASSERT_EQ(a3.constSpan(), a1.constSpan());
763 std::cout <<
"Array a4\n";
768 ASSERT_EQ(a4.size(), 3);
770 ASSERT_EQ(a4.allocator(), allocator1);
779 ASSERT_EQ(array[0].allocator(), allocator3);
780 ASSERT_EQ(array[1].allocator(), allocator3);
791 std::cout <<
"Sizeof(ArrayMetaData)=" <<
sizeof(
ArrayMetaData) <<
"\n";
800 std::cout <<
"Array a1\n";
802 ASSERT_EQ(a1.allocator(), allocator2);
803 ASSERT_EQ(a1.size(), 0);
804 ASSERT_EQ(a1.capacity(), 0);
805 ASSERT_EQ(a1.data(),
nullptr);
807 std::cout <<
"Array a2\n";
809 ASSERT_EQ(a1.allocator(), a2.allocator());
810 ASSERT_EQ(a2.capacity(), 0);
811 ASSERT_EQ(a2.data(),
nullptr);
818 ASSERT_EQ(a1.size(), 5);
820 std::cout <<
"Array a3\n";
825 ASSERT_EQ(a3.size(), 3);
827 ASSERT_EQ(a3.allocator(), a1.allocator());
828 ASSERT_EQ(a3.size(), a1.size());
829 ASSERT_EQ(a3.constSpan(), a1.constSpan());
831 std::cout <<
"Array a4\n";
836 ASSERT_EQ(a4.size(), 3);
838 ASSERT_EQ(a4.allocator(), allocator1);
847 ASSERT_EQ(array[0].allocator(), allocator3);
848 ASSERT_EQ(array[1].allocator(), allocator3);
872 return m_default_allocator.
allocate(args,new_size);
877 return m_default_allocator.
reallocate(args, current_ptr, new_size);
887 return m_default_allocator.
adjustedCapacity(args, wanted_capacity, element_size);
898 ASSERT_EQ(old_args.memoryLocationHint(), eMemoryLocationHint::None);
899 ASSERT_EQ(new_args.memoryLocationHint(), eMemoryLocationHint::MainlyHost);
900 ASSERT_EQ(ptr.
size(), 8);
912 bool v1 = args.memoryLocationHint() == eMemoryLocationHint::None;
913 bool v2 = args.memoryLocationHint() == eMemoryLocationHint::MainlyHost;
914 bool v3 = args.memoryLocationHint() == eMemoryLocationHint::HostAndDeviceMostlyRead;
915 bool is_valid = v1 || v2 || v3;
920#define ASSERT_SAME_ARRAY_INFOS(a,b) \
921 ASSERT_EQ(a.allocationOptions(), b.allocationOptions());\
922 ASSERT_EQ(a.size(), b.size());\
923 ASSERT_EQ(a.capacity(), b.capacity())
925TEST(
Array, AllocatorV2)
934 opt3.setMemoryLocationHint(eMemoryLocationHint::HostAndDeviceMostlyRead);
935 ASSERT_EQ(opt3, allocate_options1);
938 std::cout <<
"Array a1\n";
940 ASSERT_EQ(a1.allocationOptions(), allocate_options2);
941 ASSERT_EQ(a1.size(), 0);
942 ASSERT_EQ(a1.capacity(), 0);
943 ASSERT_EQ(a1.data(),
nullptr);
945 std::cout <<
"Array a2\n";
947 ASSERT_SAME_ARRAY_INFOS(a2, a1);
948 ASSERT_EQ(a2.data(),
nullptr);
955 ASSERT_EQ(a1.size(), 5);
959 a2.setMemoryLocationHint(eMemoryLocationHint::MainlyHost);
961 std::cout <<
"Array a3\n";
966 ASSERT_EQ(a3.size(), 3);
968 ASSERT_EQ(a3.allocator(), a1.allocator());
969 ASSERT_EQ(a3.size(), a1.size());
970 ASSERT_EQ(a3.constSpan(), a1.constSpan());
972 std::cout <<
"Array a4\n";
977 ASSERT_EQ(a4.size(), 3);
979 ASSERT_EQ(a4.allocationOptions(), allocate_options1);
985 for (
Integer i = 0; i < 2; ++i) {
988 ASSERT_EQ(array[0].allocationOptions(), allocator3);
989 ASSERT_EQ(array[1].allocationOptions(), allocator3);
993TEST(
Array, DebugInfo)
1002 std::cout <<
"Array a1\n";
1004 a1.setDebugName(a1_name);
1005 ASSERT_EQ(a1.allocationOptions(), allocate_options2);
1006 ASSERT_EQ(a1.size(), 0);
1007 ASSERT_EQ(a1.capacity(), 0);
1008 ASSERT_EQ(a1.data(),
nullptr);
1009 ASSERT_EQ(a1.debugName(), a1_name);
1011 std::cout <<
"Array a2\n";
1013 ASSERT_SAME_ARRAY_INFOS(a2, a1);
1014 ASSERT_EQ(a2.data(),
nullptr);
1015 ASSERT_EQ(a2.debugName(), a1_name);
1022 ASSERT_EQ(a1.size(), 5);
1025 ASSERT_EQ(a2.debugName(), a1_name);
1026 ASSERT_EQ(a2.size(), 2);
1031 ASSERT_EQ(a3.
size(), 2);
#define ASSERT_TRUE(condition)
Vérifie que condition est vrai.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
String debugName() const
Nom de debug (nul si aucun nom spécifié)
Classe abstraite de base d'un vecteur.
Integer size() const
Nombre d'éléments du vecteur.
static constexpr Integer simdAlignment()
Alignement pour les structures utilisant la vectorisation.
static AlignedMemoryAllocator3 * Simd()
Allocateur garantissant l'alignement pour utiliser la vectorisation sur la plateforme cible.
static AlignedMemoryAllocator * Simd()
Allocateur garantissant l'alignement pour utiliser la vectorisation sur la plateforme cible.
Informations sur une zone mémoire allouée.
Int64 size() const
Taille en octets de la zone mémoire utilisée. (-1) si inconnue.
Classe de base des vecteurs 1D de données.
Span< const T > span() const
Vue immutable sur ce tableau.
iterator begin()
Itérateur sur le premier élément du tableau.
void copy(Span< const T > rhs)
Copie les valeurs de rhs dans l'instance.
reverse_iterator rbegin()
Itérateur inverse sur le premier élément du tableau.
void resizeNoInit(Int64 s)
Redimensionne sans initialiser les nouvelles valeurs.
void reserve(Int64 new_capacity)
Réserve le mémoire pour new_capacity éléments.
SmallSpan< const T > smallSpan() const
Vue immutable sur ce tableau.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
ArrayView< T > subView(Int64 abegin, Integer asize)
Sous-vue à partir de l'élément abegin et contenant asize éléments.
void remove(Int64 index)
Supprime l'entité ayant l'indice index.
ConstArrayView< T > constView() const
Vue constante sur ce tableau.
ArrayView< T > view() const
Vue mutable sur ce tableau.
SmallSpan< const T > constSmallSpan() const
Vue immutable sur ce tableau.
void add(ConstReferenceType val)
Ajoute l'élément val à la fin du tableau.
Span< const T > constSpan() const
Vue constante sur ce tableau.
reverse_iterator rend()
Itérateur inverse sur le premier élément après la fin du tableau.
ConstArrayView< T > subConstView(Int64 abegin, Int32 asize) const
Sous-vue à partir de l'élément abegin et contenant asize éléments.
iterator end()
Itérateur sur le premier élément après la fin du tableau.
interval d'itérateurs constant
Allocateur mémoire via malloc/realloc/free.
bool hasRealloc(MemoryAllocationArgs) const override
Indique si l'allocateur supporte la sémantique de realloc.
AllocatedMemoryInfo reallocate(MemoryAllocationArgs, AllocatedMemoryInfo current_ptr, Int64 new_size) override
Réalloue de la mémoire pour new_size octets et retourne le pointeur.
Int64 adjustedCapacity(MemoryAllocationArgs, Int64 wanted_capacity, Int64 element_size) const override
Ajuste la capacité suivant la taille d'élément.
void deallocate(MemoryAllocationArgs, AllocatedMemoryInfo ptr) override
Libère la mémoire dont l'adresse de base est ptr.
size_t guarantedAlignment(MemoryAllocationArgs) const override
Valeur de l'alignement garanti par l'allocateur.
AllocatedMemoryInfo allocate(MemoryAllocationArgs, Int64 new_size) override
Alloue de la mémoire pour new_size octets et retourne le pointeur.
Classe de base d'une exception.
Interface de la version 3 de IMemoryAllocator.
Interface d'un allocateur pour la mémoire.
virtual void notifyMemoryArgsChanged(MemoryAllocationArgs old_args, MemoryAllocationArgs new_args, AllocatedMemoryInfo ptr)
Notifie du changement des arguments spécifiques à l'instance.
Classe contenant des informations pour spécialiser les allocations.
Options pour configurer les allocations.
Allocateur mémoire via malloc/realloc/free avec impression listing.
Vecteur 1D de données avec sémantique par référence.
SharedArray< T > clone() const
Clone le tableau.
Vue d'un tableau d'éléments de type T.
Chaîne de caractères unicode.
Vecteur 1D de données avec sémantique par valeur (style STL).
Allocateur pour tester les arguments.
void notifyMemoryArgsChanged(MemoryAllocationArgs old_args, MemoryAllocationArgs new_args, AllocatedMemoryInfo ptr) override
Notifie du changement des arguments spécifiques à l'instance.
AllocatedMemoryInfo reallocate(MemoryAllocationArgs args, AllocatedMemoryInfo current_ptr, Int64 new_size) override
Réalloue de la mémoire pour new_size octets et retourne le pointeur.
size_t guarantedAlignment(MemoryAllocationArgs args) const override
Valeur de l'alignement garanti par l'allocateur.
void deallocate(MemoryAllocationArgs args, AllocatedMemoryInfo ptr) override
Libère la mémoire dont l'adresse de base est ptr.
AllocatedMemoryInfo allocate(MemoryAllocationArgs args, Int64 new_size) override
Alloue de la mémoire pour new_size octets et retourne le pointeur.
Int64 adjustedCapacity(MemoryAllocationArgs args, Int64 wanted_capacity, Int64 element_size) const override
Ajuste la capacité suivant la taille d'élément.
bool hasRealloc(MemoryAllocationArgs args) const override
Indique si l'allocateur supporte la sémantique de realloc.
Concept for allocating, resizing and freeing memory block.
Espace de nom de Arccore.
void swap(UniqueArray< T > &v1, UniqueArray< T > &v2)
Échange les valeurs de v1 et v2.
double Real
Type représentant un réel.
Int32 Integer
Type représentant un entier.
std::int64_t Int64
Type entier signé sur 64 bits.