14 template <
typename T, IModuleGetterSetterImpl<T> IMPL>
18 if (not l->has_value ()) {
19 DoInitOutOfLine_ (&l);
22 template <
typename T, IModuleGetterSetterImpl<T> IMPL>
28 if (l->has_value ()) {
29 return l.cref ()->Get ();
33 return fIndirect_.load ()->Get ();
35 template <
typename T, IModuleGetterSetterImpl<T> IMPL>
39 if (not l->has_value ()) {
40 DoInitOutOfLine_ (&l);
44 template <
typename T, IModuleGetterSetterImpl<T> IMPL>
47 return Memory::MakeSharedPtr<const T> (Get ());
49 template <
typename T, IModuleGetterSetterImpl<T> IMPL>
58 if (not l->has_value ()) {
59 DoInitOutOfLine_ (&l);
61 if (
auto o = updaterFunction (l.cref ()->Get ())) {
67 template <
typename T, IModuleGetterSetterImpl<T> IMPL>
71 Require (not ref->cref ().has_value ());
73 Ensure (ref->cref ().has_value ());
#define RequireNotNull(p)
Wrap any object with Synchronized<> and it can be used similarly to the base type,...
nonvirtual WritableReference rwget()
get a read-write smart pointer to the underlying Synchronized<> object, holding the full lock the who...
nonvirtual ReadableReference cget() const
get a read-only smart pointer to the underlying Synchronized<> object, holding the readlock the whole...
Helper to define synchronized, lazy constructed, module initialization (intended to work with DataExc...
nonvirtual void AssureLoaded() const
nonvirtual shared_ptr< const T > operator->() const
nonvirtual optional< T > Update(const function< optional< T >(const T &)> &updaterFunction)
Call this with a lambda that will update the associated value (INSIDE a lock (synchronized))
nonvirtual void Set(const T &v)