27 #include <type_traits>
40 template <
class TypeContained>
44 myArray = makeObjectWithExtraStorage<Array<TypeContained>>(
sizeof(TypeContained) * initSize,
48 template <
class TypeContained>
56 myArray = makeObjectWithExtraStorage<Array<TypeContained>>(
57 sizeof(TypeContained) * initSize, initSize, usedSize);
60 template <
class TypeContained>
63 myArray = makeObjectWithExtraStorage<Array<TypeContained>>(
sizeof(TypeContained), 1);
66 template <
class TypeContained>
68 return myArray->numUsedSlots();
71 template <
class TypeContained>
73 return myArray->getObj(which);
76 template <
class TypeContained>
78 return myArray->getObj(which);
81 template <
class TypeContained>
83 myArray->assign(which, val);
86 template <
class TypeContained>
88 if (myArray->isFull()) {
89 myArray = myArray->doubleSize();
94 template <
class TypeContained>
96 if (myArray->isFull()) {
97 myArray = myArray->doubleSize();
99 myArray->push_back(val);
102 template <
class TypeContained>
107 template <
class TypeContained>
109 myArray = makeObjectWithExtraStorage<Array<TypeContained>>(
sizeof(TypeContained), 1);
112 template <
class TypeContained>
114 myArray = myArray->resize(toMe);
117 template <
class TypeContained>
119 return myArray->c_ptr();
124 template <
class TypeContained>
126 for (uint32_t i = 0; i < this->size() - 1; i++) {
127 std::cout << (*this)[i] <<
", ";
129 std::cout << (*this)[this->size() - 1] << std::endl;
134 template <
class TypeContained>
143 size_t size = this->size();
144 TypeContained* myData = this->c_ptr();
145 for (uint32_t i = 0; i < size; i++) {
TypeContained * c_ptr() const
void resize(uint32_t toMe)
void assign(uint32_t which, const TypeContained &val)
TypeContained & operator[](uint32_t which)
void fill(const TypeContained &val)