8#ifndef SkTDArray_DEFINED
9#define SkTDArray_DEFINED
18#include <initializer_list>
23 SkTDStorage(
const void* src,
int size,
int sizeOfT);
39 bool empty()
const {
return fSize == 0; }
41 int size()
const {
return fSize; }
42 void resize(
int newSize);
47 void reserve(
int newCapacity);
50 void*
data() {
return fStorage; }
51 const void*
data()
const {
return fStorage; }
56 void removeShuffle(
int index);
65 void* insert(
int index);
66 void* insert(
int index,
int count,
const void* src);
79 size_t bytes(
int n)
const {
return SkToSizeT(n * fSizeOfT); }
80 void* address(
int n) {
return fStorage + this->bytes(n); }
83 int calculateSizeOrDie(
int delta);
87 void moveTail(
int dstIndex,
int tailStart,
int tailEnd);
90 void copySrc(
int dstIndex,
const void* src,
int count);
93 std::byte* fStorage{
nullptr};
114 fStorage = src.fStorage;
121 fStorage = std::move(src.fStorage);
126 return a.fStorage ==
b.fStorage;
132 swap(fStorage, that.fStorage);
149 const T*
data()
const {
return static_cast<const T*
>(fStorage.
data()); }
164 return this->
data()[this->
size() - 1];
168 return this->
data()[this->
size() - 1];
193 return this->
end() - 1;
204 return static_cast<T*
>(fStorage.
insert(index));
207 return static_cast<T*
>(fStorage.
insert(index,
count, src));
static void erase(SkSurface *surface)
SK_API void sk_collection_not_empty(bool empty)
SK_API T sk_collection_check_bounds(T i, T size)
void swap(sk_sp< T > &a, sk_sp< T > &b)
static void swap(SkTDStorage &a, SkTDStorage &b)
constexpr size_t SkToSizeT(S x)
SkTDArray< T > & operator=(SkTDArray< T > &&src)
SkTDArray(const SkTDArray< T > &src)
SkTDArray(const T src[], int count)
friend bool operator==(const SkTDArray< T > &a, const SkTDArray< T > &b)
T * insert(int index, int count, const T *src=nullptr)
void push_back(const T &v)
SkTDArray< T > & operator=(const SkTDArray< T > &src)
T * append(int count, const T *src)
SkTDArray(SkTDArray< T > &&src)
const T & operator[](int index) const
friend bool operator!=(const SkTDArray< T > &a, const SkTDArray< T > &b)
void remove(int index, int count=1)
T & operator[](int index)
size_t size_bytes() const
SkTDArray(const std::initializer_list< T > &list)
void removeShuffle(int index)
void swap(SkTDArray< T > &that)
void erase(int index, int count)
const void * data() const
void removeShuffle(int index)
void reserve(int newCapacity)
friend bool operator!=(const SkTDStorage &a, const SkTDStorage &b)
size_t size_bytes() const
static void append(char **dst, size_t *count, const char *src, size_t n)
bool operator==(const FlutterPoint &a, const FlutterPoint &b)