Flutter Engine
The Flutter Engine
|
#include <SkTLazy.h>
Public Member Functions | |
SkTLazy ()=default | |
SkTLazy (const T *src) | |
SkTLazy (const SkTLazy &that) | |
SkTLazy (SkTLazy &&that) | |
~SkTLazy ()=default | |
SkTLazy & | operator= (const SkTLazy &that) |
SkTLazy & | operator= (SkTLazy &&that) |
template<typename... Args> | |
T * | init (Args &&... args) |
T * | set (const T &src) |
T * | set (T &&src) |
void | reset () |
bool | isValid () const |
T * | get () |
const T * | get () const |
T * | operator-> () |
const T * | operator-> () const |
T & | operator* () |
const T & | operator* () const |
const T * | getMaybeNull () const |
T * | getMaybeNull () |
Efficient way to defer allocating/initializing a class until it is needed (if ever).
Return a pointer to an instance of the class initialized with 'args'. If a previous instance had been initialized (either from init() or set()) it will first be destroyed, so that a freshly initialized instance is always returned.
Copy src into this, and return a pointer to a copy of it. Note this will always return the same pointer, so if it is called on a lazy that has already been initialized, then this will copy over the previous contents.