12 template <
typename T,
typename IMPL>
18 if (l->has_value ()) {
19 return l.cref ()->Get ();
23 if (not l->has_value ()) {
24 DoInitOutOfLine_ (&l);
26 return l.cref ()->Get ();
28 template <
typename T,
typename IMPL>
32 if (not l->has_value ()) {
33 DoInitOutOfLine_ (&l);
37 template <
typename T,
typename IMPL>
46 if (not l->has_value ()) {
47 DoInitOutOfLine_ (&l);
49 if (
auto o = updaterFunction (l.cref ()->Get ())) {
55 template <
typename T,
typename IMPL>
59 Require (not ref->load ().has_value ());
61 Ensure (ref->load ().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 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)