MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ memoize_nonempty()

template<typename T, typename Compute>
T MayaFlux::Platform::detail::memoize_nonempty ( Memory::SnapshotCell< T > & cell,
Compute && compute )

Definition at line 130 of file Toolchain.hpp.

131 {
132 if (auto view = cell.read(); view && !view->empty()) {
133 return *view;
134 }
135 T value = std::forward<Compute>(compute)();
136 if (!value.empty()) {
137 cell.publish(value);
138 }
139 return value;
140 }
Guard read() const noexcept
Pins the current snapshot.
void publish(T value)
Replaces the snapshot with value, whatever it was.

References MayaFlux::Memory::SnapshotCell< T >::publish(), and MayaFlux::Memory::SnapshotCell< T >::read().

Referenced by MayaFlux::Platform::SystemConfig::get_clang_resource_dir(), MayaFlux::Platform::SystemConfig::get_system_includes(), and MayaFlux::Platform::SystemConfig::get_system_libraries().

Here is the call graph for this function:
Here is the caller graph for this function: