|
Krita Source Code Documentation
|
#include <KisLazyStorage.h>
Classes | |
| struct | init_value_tag |
Public Member Functions | |
| KisLazyStorage (Args... args) | |
| KisLazyStorage (const KisLazyStorage &rhs)=delete | |
| KisLazyStorage (init_value_tag, T &&value) | |
| KisLazyStorage (KisLazyStorage &&rhs) | |
| T & | operator* () |
| T * | operator-> () |
| KisLazyStorage & | operator= (const KisLazyStorage &rhs)=delete |
| KisLazyStorage & | operator= (KisLazyStorage &&rhs) |
| ~KisLazyStorage () | |
Private Member Functions | |
| T * | getPointer () |
Static Private Member Functions | |
| static T * | constructObject (Args... args) |
Private Attributes | |
| std::tuple< Args... > | m_constructionArgs |
| std::atomic< T * > | m_data |
| std::mutex | m_mutex |
KisLazyStorage is a special class implementing some kind of lazy evaluation. It mimics the behavior of a normal pointer type, but creates T only on the first trt to dereference this pointer.
Definition at line 24 of file KisLazyStorage.h.
|
inlineexplicit |
Create a storage with a deferred creation of the object T. The arguments args are passed to the constructor of T on the first dereference operation on the storage.
Definition at line 34 of file KisLazyStorage.h.
|
inlineexplicit |
Create a storage and initialize it with value right away without any deferring. Please take it into account that the storage will still store a default- initialized values of types Args... in an internal tuple. If you want to avoid this default-construction, then just wrap the arguments into std::optional.
Definition at line 48 of file KisLazyStorage.h.
|
delete |
|
inline |
Definition at line 56 of file KisLazyStorage.h.
|
inline |
Definition at line 71 of file KisLazyStorage.h.
References KisLazyStorage< T, Args >::m_data.
|
inlinestaticprivate |
Definition at line 94 of file KisLazyStorage.h.
|
inlineprivate |
Definition at line 84 of file KisLazyStorage.h.
References KisLazyStorage< T, Args >::constructObject(), KisLazyStorage< T, Args >::m_constructionArgs, KisLazyStorage< T, Args >::m_data, and KisLazyStorage< T, Args >::m_mutex.
|
inline |
Definition at line 79 of file KisLazyStorage.h.
References KisLazyStorage< T, Args >::getPointer().
|
inline |
Definition at line 75 of file KisLazyStorage.h.
References KisLazyStorage< T, Args >::getPointer().
|
delete |
|
inline |
Definition at line 60 of file KisLazyStorage.h.
References KisLazyStorage< T, Args >::m_constructionArgs, KisLazyStorage< T, Args >::m_data, and KisLazyStorage< T, Args >::m_mutex.
|
private |
Definition at line 99 of file KisLazyStorage.h.
|
private |
Definition at line 100 of file KisLazyStorage.h.
|
private |
Definition at line 101 of file KisLazyStorage.h.