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 (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) | |
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 of an initializer list.
Definition at line 84 of file SkTArray.h.
|
inline |
Definition at line 128 of file SkTArray.h.
|
inlineprotected |
Definition at line 521 of file SkTArray.h.
|
inlineprotected |
Definition at line 540 of file SkTArray.h.
|
inline |
Definition at line 456 of file SkTArray.h.
|
inline |
Definition at line 457 of file SkTArray.h.
|
inline |
equivalent to operator[](size() - 1)
Definition at line 475 of file SkTArray.h.
|
inline |
Definition at line 480 of file SkTArray.h.
|
inline |
Definition at line 393 of file SkTArray.h.
|
inline |
Definition at line 396 of file SkTArray.h.
|
inline |
Definition at line 513 of file SkTArray.h.
|
inline |
Definition at line 420 of file SkTArray.h.
|
inline |
Definition at line 414 of file SkTArray.h.
|
inline |
Definition at line 415 of file SkTArray.h.
|
inline |
Constructs a new T at the back of this array, returning it by reference.
Definition at line 243 of file SkTArray.h.
|
inline |
Definition at line 194 of file SkTArray.h.
|
inline |
Definition at line 402 of file SkTArray.h.
|
inline |
Definition at line 408 of file SkTArray.h.
|
inline |
equivalent to operator[](size()-1-i)
Definition at line 488 of file SkTArray.h.
|
inline |
Definition at line 492 of file SkTArray.h.
|
inline |
equivalent to operator[](0)
Definition at line 462 of file SkTArray.h.
|
inline |
Definition at line 467 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 378 of file SkTArray.h.
|
inline |
Version of above that uses the move constructor to set n items.
Definition at line 302 of file SkTArray.h.
|
inline |
Definition at line 509 of file SkTArray.h.
|
inline |
Definition at line 86 of file SkTArray.h.
|
inline |
Definition at line 97 of file SkTArray.h.
|
inline |
Definition at line 496 of file SkTArray.h.
|
inline |
|
inline |
Definition at line 452 of file SkTArray.h.
|
inline |
Removes the last element. Not safe to call when size() == 0.
Definition at line 316 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 200 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 209 of file SkTArray.h.
|
inline |
Adds one new T value which is copy-constructed, returning it by reference.
Definition at line 226 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 262 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 275 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 288 of file SkTArray.h.
|
inline |
Definition at line 183 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 165 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 176 of file SkTArray.h.
|
inline |
|
inline |
Resets to size() = n newly constructed T objects and resets any reserve count.
Definition at line 139 of file SkTArray.h.
|
inline |
Definition at line 418 of file SkTArray.h.
|
inline |
Pushes or pops from the back to resize. Pushes will be default initialized.
Definition at line 338 of file SkTArray.h.
|
inline |
Definition at line 425 of file SkTArray.h.
|
inline |
Definition at line 416 of file SkTArray.h.
|
inline |
Definition at line 417 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 353 of file SkTArray.h.