|
Lazy
1.0
|
Lazy class used for lazy-loading any type. More...
#include <Lazy.hpp>
Public Types | |
| using | this_type = Lazy< T > |
| using | value_type = T |
| using | pointer = T * |
| using | reference = T & |
Public Member Functions | |
| Lazy () | |
| Default constructor; no initialization takes place. | |
| template<typename CtorFunc , typename DtorFunc = void(value_type&), typename = typename std::enable_if<detail::is_callable<CtorFunc>::value>::type, typename = typename std::enable_if<detail::is_callable<DtorFunc>::value>::type> | |
| Lazy (const CtorFunc &constructor, const DtorFunc &destructor=default_destructor) | |
Constructs a Lazy given the constructor and destructor functions. More... | |
| Lazy (const Lazy< T > &rhs) | |
Constructs a Lazy by copying another Lazy. More... | |
| Lazy (Lazy< T > &&rhs) | |
Constructs a Lazy by moving another Lazy. More... | |
| Lazy (const value_type &rhs) | |
Constructs a Lazy by calling T's copy constructor. More... | |
| Lazy (value_type &&rhs) | |
Constructs a Lazy from a given rvalue T. More... | |
| ~Lazy () | |
Destructs this Lazy and it's T. | |
| this_type & | operator= (const this_type &rhs) |
Assigns a Lazy to this Lazy. More... | |
| this_type & | operator= (this_type &&rhs) |
Assigns a Lazy to this Lazy. More... | |
| value_type & | operator= (const value_type &rhs) |
Assigns a T to this Lazy. More... | |
| value_type & | operator= (value_type &&rhs) |
Assigns an rvalue T to this Lazy. More... | |
| operator reference () const | |
Converts this Lazy into a reference. More... | |
| operator bool () const noexcept | |
Checks whether this Lazy has an instantiated object. More... | |
| void | swap (Lazy< T > &rhs) noexcept |
| Swapperator class for no-exception swapping. More... | |
| bool | is_initialized () const noexcept |
Boolean to check if this Lazy is initialized. More... | |
| pointer | get () const |
| Gets a pointer to the underlying type. More... | |
| reference | operator* () const |
Dereferences this Lazy object into the lazy-loaded object. More... | |
| pointer | operator-> () const |
Dereferences this Lazy object into the lazy-loaded object. More... | |
Friends | |
| template<typename U , typename... Args> | |
| Lazy< U > | make_lazy (Args &&...args) |
Convenience utility to construct a Lazy object by specifying T's constructor signature. More... | |
Lazy class used for lazy-loading any type.
The stored lazy-loaded class, T, will always be instantiated before being accessed, and destructed when put out of scope.
| T | the type contained within this Lazy |
|
explicit |
Constructs a Lazy given the constructor and destructor functions.
constructor function must return a std::tuple containing the arguments to pass to T's constructor for lazy-construction| constructor | function to use for construction |
| destructor | function to use prior to destruction |
| lazy::Lazy< T >::Lazy | ( | const Lazy< T > & | rhs | ) |
| lazy::Lazy< T >::Lazy | ( | Lazy< T > && | rhs | ) |
|
explicit |
|
explicit |
| pointer lazy::Lazy< T >::get | ( | ) | const |
Gets a pointer to the underlying type.
|
noexcept |
Boolean to check if this Lazy is initialized.
true if the underlying type T is initialized.
|
explicitnoexcept |
Checks whether this Lazy has an instantiated object.
true if this lazy has an instantiated object
|
explicit |
Converts this Lazy into a reference.
| reference lazy::Lazy< T >::operator* | ( | ) | const |
Dereferences this Lazy object into the lazy-loaded object.
| pointer lazy::Lazy< T >::operator-> | ( | ) | const |
Dereferences this Lazy object into the lazy-loaded object.
| this_type& lazy::Lazy< T >::operator= | ( | const this_type & | rhs | ) |
| this_type& lazy::Lazy< T >::operator= | ( | this_type && | rhs | ) |
| value_type& lazy::Lazy< T >::operator= | ( | const value_type & | rhs | ) |
| value_type& lazy::Lazy< T >::operator= | ( | value_type && | rhs | ) |
|
noexcept |
Swapperator class for no-exception swapping.
| rhs | the rhs to swap |
|
friend |
1.8.11