Flutter Engine
The Flutter Engine
|
#include <SkTArray.h>
Public Types | |
using | value_type = T |
Public Member Functions | |
TArray () | |
TArray (int reserveCount) | |
TArray (const TArray &that) | |
TArray (TArray &&that) | |
TArray (const T *array, int count) | |
TArray (SkSpan< const T > data) | |
TArray (std::initializer_list< T > data) | |
TArray & | operator= (const TArray &that) |
TArray & | operator= (TArray &&that) |
~TArray () | |
void | reset (int n) |
void | reset (const T *array, int count) |
void | reserve (int n) |
void | reserve_exact (int n) |
void | removeShuffle (int n) |
bool | empty () const |
T & | push_back () |
T & | push_back (const T &t) |
T & | push_back (T &&t) |
template<typename... Args> | |
T & | emplace_back (Args &&... args) |
T * | push_back_n (int n) |
T * | push_back_n (int n, const T &t) |
T * | push_back_n (int n, const T t[]) |
T * | move_back_n (int n, T *t) |
void | pop_back () |
void | pop_back_n (int n) |
void | resize_back (int newCount) |
void | swap (TArray &that) |
void | move_back (TArray &that) |
T * | begin () |
const T * | begin () const |
T * | end () |
const T * | end () const |
T * | data () |
const T * | data () const |
int | size () const |
size_t | size_bytes () const |
void | resize (size_t count) |
void | clear () |
void | shrink_to_fit () |
T & | operator[] (int i) |
const T & | operator[] (int i) const |
T & | at (int i) |
const T & | at (int i) const |
T & | front () |
const T & | front () const |
T & | back () |
const T & | back () const |
T & | fromBack (int i) |
const T & | fromBack (int i) const |
bool | operator== (const TArray< T, MEM_MOVE > &right) const |
bool | operator!= (const TArray< T, MEM_MOVE > &right) const |
int | capacity () const |
Protected Member Functions | |
template<int InitialCapacity> | |
TArray (SkAlignedSTStorage< InitialCapacity, T > *storage, int size=0) | |
template<int InitialCapacity> | |
TArray (const T *array, int size, SkAlignedSTStorage< InitialCapacity, T > *storage) | |
template<int InitialCapacity> | |
TArray (SkSpan< const T > data, SkAlignedSTStorage< InitialCapacity, T > *storage) | |
TArray<T> implements a typical, mostly std::vector-like array. Each T will be default-initialized on allocation, and ~T will be called on destruction.
MEM_MOVE controls the behavior when a T needs to be moved (e.g. when the array is resized)
Definition at line 40 of file SkTArray.h.
using skia_private::TArray< T, MEM_MOVE >::value_type = T |
Definition at line 42 of file SkTArray.h.
|
inline |
Creates an empty array with no initial storage
Definition at line 47 of file SkTArray.h.
|
inlineexplicit |
Creates an empty array that will preallocate space for reserveCount elements.
Definition at line 52 of file SkTArray.h.
|
inline |
Copies one array to another. The new array will be heap allocated.
Definition at line 57 of file SkTArray.h.
|
inline |
Definition at line 59 of file SkTArray.h.
|
inline |
Creates a TArray by copying contents of a standard C array. The new array will be heap allocated. Be careful not to use this constructor when you really want the (void*, int) version.
Definition at line 76 of file SkTArray.h.
|
inline |
Creates a TArray by copying contents from an SkSpan. The new array will be heap allocated.
Definition at line 84 of file SkTArray.h.
|
inline |
|
inline |
Definition at line 133 of file SkTArray.h.
|
inlineprotected |
Definition at line 526 of file SkTArray.h.
|
inlineprotected |
Definition at line 545 of file SkTArray.h.
|
inlineprotected |
Definition at line 550 of file SkTArray.h.
|
inline |
Definition at line 461 of file SkTArray.h.
|
inline |
Definition at line 462 of file SkTArray.h.
|
inline |
equivalent to operator[](size() - 1)
Definition at line 480 of file SkTArray.h.
|
inline |
Definition at line 485 of file SkTArray.h.
|
inline |
Definition at line 398 of file SkTArray.h.
|
inline |
Definition at line 401 of file SkTArray.h.
|
inline |
Definition at line 518 of file SkTArray.h.
|
inline |
Definition at line 425 of file SkTArray.h.
|
inline |
Definition at line 419 of file SkTArray.h.
|
inline |
Definition at line 420 of file SkTArray.h.
|
inline |
Constructs a new T at the back of this array, returning it by reference.
Definition at line 248 of file SkTArray.h.
|
inline |
Definition at line 199 of file SkTArray.h.
|
inline |
Definition at line 407 of file SkTArray.h.
|
inline |
Definition at line 413 of file SkTArray.h.
|
inline |
equivalent to operator[](size()-1-i)
Definition at line 493 of file SkTArray.h.
|
inline |
Definition at line 497 of file SkTArray.h.
|
inline |
equivalent to operator[](0)
Definition at line 467 of file SkTArray.h.
|
inline |
Definition at line 472 of file SkTArray.h.
|
inline |
Moves all elements of that
to the end of this array, leaving that
empty. This is a no-op if that
is empty or equal to this array.
Definition at line 383 of file SkTArray.h.
|
inline |
Version of above that uses the move constructor to set n items.
Definition at line 307 of file SkTArray.h.
|
inline |
Definition at line 514 of file SkTArray.h.
|
inline |
Definition at line 91 of file SkTArray.h.
|
inline |
Definition at line 102 of file SkTArray.h.
|
inline |
Definition at line 501 of file SkTArray.h.
|
inline |
Get the i^th element.
Definition at line 453 of file SkTArray.h.
|
inline |
Definition at line 457 of file SkTArray.h.
|
inline |
Removes the last element. Not safe to call when size() == 0.
Definition at line 321 of file SkTArray.h.
|
inline |
|
inline |
Adds one new default-initialized T value and returns it by reference. Note that the reference only remains valid until the next call that adds or removes elements.
Definition at line 205 of file SkTArray.h.
|
inline |
Adds one new T value which is copy-constructed, returning it by reference. As always, the reference only remains valid until the next call that adds or removes elements.
Definition at line 214 of file SkTArray.h.
|
inline |
Adds one new T value which is copy-constructed, returning it by reference.
Definition at line 231 of file SkTArray.h.
|
inline |
Allocates n more default-initialized T values, and returns the address of the start of that new range. Note: this address is only valid until the next API call made on the array that might add or remove elements.
Definition at line 267 of file SkTArray.h.
|
inline |
Version of above that uses a copy constructor to initialize all n items to the same T.
Definition at line 280 of file SkTArray.h.
|
inline |
Version of above that uses a copy constructor to initialize the n items to separate T values.
Definition at line 293 of file SkTArray.h.
|
inline |
Definition at line 188 of file SkTArray.h.
|
inline |
Ensures there is enough reserved space for at least n elements. This is guaranteed at least until the array size grows above n and subsequently shrinks below n, any version of reset() is called, or reserve() is called again.
Definition at line 170 of file SkTArray.h.
|
inline |
Ensures there is enough reserved space for exactly n elements. The same capacity guarantees as above apply.
Definition at line 181 of file SkTArray.h.
|
inline |
|
inline |
Resets to size() = n newly constructed T objects and resets any reserve count.
Definition at line 144 of file SkTArray.h.
|
inline |
Definition at line 423 of file SkTArray.h.
|
inline |
Pushes or pops from the back to resize. Pushes will be default initialized.
Definition at line 343 of file SkTArray.h.
|
inline |
Definition at line 430 of file SkTArray.h.
|
inline |
Definition at line 421 of file SkTArray.h.
|
inline |
Definition at line 422 of file SkTArray.h.
|
inline |
Swaps the contents of this array with that array. Does a pointer swap if possible, otherwise copies the T values.
Definition at line 358 of file SkTArray.h.