Note for now much of the docs is LLM written. This was done to save time and focus on code development. The docs have been LOOSLEY reviewed. However, the code itself has been either fully written by hand or fully reviewed. Therefore, the docs should at the moment be seen as a loose resource rather than authoratiative (and this is on top of the general ability for docs to drift)
823 lines
85 KiB
TeX
823 lines
85 KiB
TeX
\doxysection{serif\+::utils\+::dependencies Namespace Reference}
|
|
\hypertarget{namespaceserif_1_1utils_1_1dependencies}{}\label{namespaceserif_1_1utils_1_1dependencies}\index{serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection*{Namespaces}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
namespace \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_1_1detail}{detail}}
|
|
\item
|
|
namespace \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_1_1keys}{keys}}
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsubsection*{Classes}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_all_nodes_observer}{All\+Nodes\+Observer}}
|
|
\begin{DoxyCompactList}\small\item\em One registration can inspect every result without building a graph-\/sized observer tuple. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_binding}{Binding}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_bindings}{Bindings}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_bound_type}{Bound\+Type}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation}{Computation}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation_cache}{Computation\+Cache}}
|
|
\begin{DoxyCompactList}\small\item\em Execute a computational graph on demand, publishing immutable results only after the entire request succeeds. \end{DoxyCompactList}\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation_graph}{Computation\+Graph}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_dependency_context}{Dependency\+Context}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_dependency_context_view}{Dependency\+Context\+View}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_dependency_context_view_3_01_parent_t_00_01_key_list_3_01_key_ts_8_8_8_01_4_01_4}{Dependency\+Context\+View$<$ Parent\+T, Key\+List$<$ Key\+Ts... $>$ $>$}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_edge_observer}{Edge\+Observer}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_graph_timing}{Graph\+Timing}}
|
|
\begin{DoxyCompactList}\small\item\em Collect independent graph bindings without mixing timers into numerical restart history. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_graph_timing_factory}{Graph\+Timing\+Factory}}
|
|
\begin{DoxyCompactList}\small\item\em Bind one generic timing observer after the model\textquotesingle{}s complete graph type is known. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_graph_timing_run}{Graph\+Timing\+Run}}
|
|
\begin{DoxyCompactList}\small\item\em One graph binding\textquotesingle{}s declaration-\/ordered catalog, including nodes which never execute. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_has_binding}{Has\+Binding}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}
|
|
\begin{DoxyCompactList}\small\item\em An ordered collection of role keys, independent of their associated value types. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list_bindings}{Key\+List\+Bindings}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list_bindings_3_01_bindings_t_00_01_key_list_3_01_key_ts_8_8_8_01_4_01_4}{Key\+List\+Bindings$<$ Bindings\+T, Key\+List$<$ Key\+Ts... $>$ $>$}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_node_observer}{Node\+Observer}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_node_timing}{Node\+Timing}}
|
|
\begin{DoxyCompactList}\small\item\em Wall time for attempted node work, independently of later cache or Newton acceptance. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_no_graph_observers}{No\+Graph\+Observers}}
|
|
\begin{DoxyCompactList}\small\item\em Default high-\/level binding adds no observation storage, timers, or callback work. \end{DoxyCompactList}\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_observers}{Observers}}
|
|
\begin{DoxyCompactList}\small\item\em Own registrations; execution state lasts for one invocation and is never part of the numerical cache. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_preparation_failure}{Preparation\+Failure}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_preparation_report}{Preparation\+Report}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_projected_snapshot}{Projected\+Snapshot}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_resolve_keys}{Resolve\+Keys}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_resolve_keys_3_01_bindings_t_00_01_key_list_3_01_key_ts_8_8_8_01_4_01_4}{Resolve\+Keys$<$ Bindings\+T, Key\+List$<$ Key\+Ts... $>$ $>$}}
|
|
\item
|
|
class \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_resource}{Resource}}
|
|
\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_steady_node_clock}{Steady\+Node\+Clock}}
|
|
\begin{DoxyCompactList}\small\item\em Read monotonic elapsed wall time without changing physical computations. \end{DoxyCompactList}\item
|
|
struct \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_value_snapshot}{Value\+Snapshot}}
|
|
\begin{DoxyCompactList}\small\item\em Default tracking owns an exact value copy; noncopyable resources supply another policy. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
\doxysubsubsection*{Concepts}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_binding}{Is\+Binding}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_bindings}{Is\+Bindings}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_bindings_with_binding}{Bindings\+With\+Binding}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_computation}{Is\+Computation}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_compatible_computations}{Compatible\+Computations}}
|
|
\begin{DoxyCompactList}\small\item\em A computational graph needs unique producers, valid input ownership, and no cycles. \end{DoxyCompactList}\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_computation_graph}{Is\+Computation\+Graph}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_dependency_context}{Is\+Dependency\+Context}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_can_prepare}{Can\+Prepare}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_computation_graph_for}{Computation\+Graph\+For}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_key_list}{Is\+Key\+List}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_satisfies_key_list}{Satisfies\+Key\+List}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_contains_key}{Contains\+Key}}
|
|
\begin{DoxyCompactList}\small\item\em Test exact key membership, rejecting malformed and duplicate-\/key lists. \end{DoxyCompactList}\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_node_observer_callbacks}{Node\+Observer\+Callbacks}}
|
|
\begin{DoxyCompactList}\small\item\em Completion must be safe during stack unwinding and receives the state created by the before hook. \end{DoxyCompactList}\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_keyed_node_observer_callbacks}{Keyed\+Node\+Observer\+Callbacks}}
|
|
\begin{DoxyCompactList}\small\item\em An all-\/node callback receives the compiled result identity before creating its invocation state. \end{DoxyCompactList}\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_observers_for}{Observers\+For}}
|
|
\begin{DoxyCompactList}\small\item\em Reject unknown nodes, nonexistent edges, and callbacks that cannot observe the graph\textquotesingle{}s immutable values. \end{DoxyCompactList}\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_is_resource}{Is\+Resource}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_snapshot_policy_for}{Snapshot\+Policy\+For}}
|
|
\item
|
|
concept \mbox{\hyperlink{conceptserif_1_1utils_1_1dependencies_1_1_node_timing_clock}{Node\+Timing\+Clock}}
|
|
\begin{DoxyCompactList}\small\item\em Restrict injected clocks to ordinary arithmetic chrono values safe in a closing callback. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
\doxysubsubsection*{Typedefs}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
{\footnotesize template$<$typename BindingsT, typename KeyT$>$ }\\using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_adc0d56ab32ca6ea92c3732dde92fa6a1}{bound\+\_\+type\+\_\+t}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_bound_type}{Bound\+Type}}$<$BindingsT, KeyT$>$\+::target\+\_\+type
|
|
\item
|
|
{\footnotesize template$<$typename... Key\+Ts$>$ }\\using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a22eef682b02dad9de4774e4b68b003ba}{Input\+List}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$Key\+Ts...$>$
|
|
\begin{DoxyCompactList}\small\item\em \doxylink{classserif_1_1utils_1_1dependencies_1_1_computation}{Computation} arguments are supplied in this key order. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename... Key\+Ts$>$ }\\using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a0674f826a11ecdab76236fa550cd88d5}{Requested\+Results}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$Key\+Ts...$>$
|
|
\begin{DoxyCompactList}\small\item\em Preparing these results also prepares their required intermediate computations. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename BindingsT, typename KeysT$>$ }\\using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ad50a04df4c202c11f49d6a2cf594b5da}{Resolved\+Targets}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_resolve_keys}{Resolve\+Keys}}$<$BindingsT, std\+::remove\+\_\+cvref\+\_\+t$<$KeysT$>$$>$\+::type
|
|
\item
|
|
{\footnotesize template$<$Is\+Key\+List... Lists$>$ }\\using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a4b225a37465f007a877f89860d3627c1}{Combined\+Key\+List}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1detail_1_1_merge_key_lists}{detail\+::\+Merge\+Key\+Lists}}$<$\mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$$>$, std\+::remove\+\_\+cvref\+\_\+t$<$Lists$>$...$>$\+::type
|
|
\begin{DoxyCompactList}\small\item\em Combine requirements in first-\/appearance order, retaining distinct keys with shared targets. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
\doxysubsubsection*{Enumerations}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
enum class \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7}{Node\+Outcome}} \{ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7aaa8fb77e57d1ca18d593e909729871fe}{completed}}
|
|
, \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7ac7537d6d48ecf261749c09a9f284bd45}{rejected}}
|
|
, \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7a42552b1f133f9f8eb406d4f306ea9fd1}{exception}}
|
|
\}
|
|
\begin{DoxyCompactList}\small\item\em Describe a node invocation, independently of whether the whole graph request is later accepted. \end{DoxyCompactList}\item
|
|
enum class \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}{Preparation\+Mode}} \{ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782aa49991912bafff4aa74bb3b4dbd42038}{reuse\+\_\+unchanged}}
|
|
, \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782a9e67f9a60581ce784117ff2047627d2f}{rebuild}}
|
|
\}
|
|
\item
|
|
enum class \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}{Preparation\+Status}} \{ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a20ab085a3c46af7db87fc1806865b329}{not\+\_\+required}}
|
|
, \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a657be30363225dfa595d3c8e59577181}{reused}}
|
|
, \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a5a317d3dd3f7a2f675975a6d0c11c629}{computed}}
|
|
\}
|
|
\end{DoxyCompactItemize}
|
|
\doxysubsubsection*{Functions}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
{\footnotesize template$<$typename KeyT, Is\+Key\+List InputsT, typename FunctionT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$FunctionT$>$, FunctionT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a70e11340fa044443fefa79ba7e0c11d5}{make\+\_\+computation}} (FunctionT \&\&function)
|
|
\begin{DoxyCompactList}\small\item\em Attach an output key and ordered input keys to a lambda, function, or other callable. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename KeyT, Is\+Key\+List InputsT, typename FunctionT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$FunctionT$>$, FunctionT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ad18195932b89cba96fd203584bfac47a}{make\+\_\+owning\+\_\+computation}} (FunctionT \&\&function)
|
|
\begin{DoxyCompactList}\small\item\em Supply immutable shared handles to computed prerequisites so results can retain them without copying. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename ErrorT = std\+::string, Is\+Computation\+Graph GraphT, Is\+Dependency\+Context ContextT, typename ObserversT = Observers$<$$>$$>$ \newline
|
|
requires Can\+Prepare$<$GraphT, ContextT, ErrorT$>$ \&\& Observers\+For$<$ObserversT, GraphT, ContextT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$GraphT$>$, GraphT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$ObserversT$>$, ObserversT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ad583eaa88367daf4af4d420047f24d38}{make\+\_\+computation\+\_\+cache}} (GraphT \&\&graph, const ContextT \&, ObserversT \&\&observers=ObserversT\{\})
|
|
\begin{DoxyCompactList}\small\item\em Fix the graph\textquotesingle{}s source types without retaining the supplied context or evaluating any computations. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename ErrorT = std\+::string, Is\+Dependency\+Context ContextT, typename... Computations$>$ \newline
|
|
requires Compatible\+Computations$<$Computations...$>$ \&\& (std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$Computations$>$, Computations$>$ \&\& ...) \&\& Can\+Prepare$<$\mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation_graph}{Computation\+Graph}}$<$std\+::remove\+\_\+cvref\+\_\+t$<$Computations$>$...$>$, ContextT, ErrorT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a37ad94611656a36bf3584940465302ec}{make\+\_\+computation\+\_\+cache}} (const ContextT \&context, Computations \&\&... computations)
|
|
\begin{DoxyCompactList}\small\item\em Build a checked graph and an empty cache directly from named computations. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename... Computations$>$ \newline
|
|
requires Compatible\+Computations$<$Computations...$>$ \&\& (std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$Computations$>$, Computations$>$ \&\& ...)}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aaa065b5bd3823bd3835f159462af09d0}{make\+\_\+computation\+\_\+graph}} (Computations \&\&... computations)
|
|
\begin{DoxyCompactList}\small\item\em Reject duplicate producers and cyclic computational graphs at the declaration site. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename... Resources$>$ \newline
|
|
requires (Is\+Resource$<$Resources$>$ \&\& ...) \&\& \mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1traits_a8cb5b9ce5869ecf88101859ace70f92a}{misc\+::traits\+::all\+\_\+unique\+\_\+types\+\_\+v}}$<$typename std\+::remove\+\_\+cvref\+\_\+t$<$Resources$>$\+::\+Key...$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab0cfd959e8c00f5e1641f26798333972}{make\+\_\+dependency\+\_\+context}} (Resources \&\&... resources)
|
|
\begin{DoxyCompactList}\small\item\em Build a context whose schema follows directly from its resource keys and types. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$Is\+Dependency\+Context... Contexts$>$ \newline
|
|
requires (\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_1_1detail_acf2dea9a3fc1ce9b322c7635ef79a193}{detail\+::combinable\+\_\+resources}}(\mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1concepts_a0f84929456e6ed14cc6cbfb81215465a}{misc\+::concepts\+::\+ConcatT}}$<$typename Contexts\+::\+Resources...$>$\{\}))}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ae031216d69a09aa3921c363e36856e44}{combine\+\_\+dependency\+\_\+contexts}} (const Contexts \&... contexts)
|
|
\begin{DoxyCompactList}\small\item\em Copy disjoint resources and their tracking policies into one context; borrowed objects retain their original lifetime. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename KeyT, typename KeysT$>$ \newline
|
|
requires Contains\+Key$<$KeyT, KeysT$>$}\\consteval std\+::size\+\_\+t \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a2b6e1389a71419222053720f4bd9cd43}{key\+\_\+index}} ()
|
|
\begin{DoxyCompactList}\small\item\em Locate a declared key in its ordered list; absent keys are rejected at compile time. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename KeyT, typename BeforeT, typename AfterT$>$ \newline
|
|
requires Node\+Observer\+Callbacks$<$std\+::decay\+\_\+t$<$BeforeT$>$, std\+::decay\+\_\+t$<$AfterT$>$$>$ \&\& std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$BeforeT$>$, BeforeT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$AfterT$>$, AfterT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a427c6ce690c7551cbdbbb5261bd8c125}{observe\+\_\+node}} (BeforeT \&\&before, AfterT \&\&after)
|
|
\begin{DoxyCompactList}\small\item\em Bind before/after callbacks to a result key; callback captures determine any external storage lifetime. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename BeforeT, typename AfterT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$BeforeT$>$, BeforeT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$AfterT$>$, AfterT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a1011c9c6c8b4e2ca4e87b9826743dde5}{observe\+\_\+nodes}} (BeforeT \&\&before, AfterT \&\&after)
|
|
\begin{DoxyCompactList}\small\item\em Observe all executed nodes; cache construction checks the callback contract for every result key. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename InputT, typename ConsumerT, typename FunctionT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$FunctionT$>$, FunctionT$>$}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a1156ef3083e1e54eaabb23309b17fb57}{observe\+\_\+edge}} (FunctionT \&\&function)
|
|
\begin{DoxyCompactList}\small\item\em Bind a read-\/only callback to one input of one consumer; graph construction validates the edge and value type. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename... Registrations$>$ \newline
|
|
requires (\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_1_1detail_a54c9a0f2354c9edeef7db65bee38b1fe}{detail\+::is\+\_\+observer\+\_\+v}}$<$std\+::remove\+\_\+cvref\+\_\+t$<$Registrations$>$$>$ \&\& ...) \&\& (std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$Registrations$>$, Registrations$>$ \&\& ...)}\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_af617b846949f46d528f63c89b218887b}{make\+\_\+observers}} (Registrations \&\&... observers)
|
|
\begin{DoxyCompactList}\small\item\em Collect any number of registrations, including several observers of the same node or edge. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename KeyT, typename ValueT, typename PolicyT = Value\+Snapshot$>$ }\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a80612ee1a5c84ccd1b36e5aab14c17d5}{own}} (ValueT \&\&value, PolicyT policy=\{\})
|
|
\begin{DoxyCompactList}\small\item\em Store a value in the context; rvalues transfer ownership and lvalues are copied. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename KeyT, typename ValueT, typename PolicyT = Value\+Snapshot$>$ }\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_abdacec2dea2bb64ecda1946529961565}{borrow}} (ValueT \&value, PolicyT policy=\{\})
|
|
\begin{DoxyCompactList}\small\item\em Bind an existing object whose lifetime must cover every use of the context. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename KeyT, typename ValueT, typename PolicyT = Value\+Snapshot$>$ }\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a2b9af58b739c7c1217fad649158a1063}{borrow}} (const ValueT \&\&, PolicyT=\{\})=delete
|
|
\begin{DoxyCompactList}\small\item\em Borrowed storage must never refer to a temporary, including a const temporary. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename FunctionT$>$ }\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_abd3aa4196f4454ea6052835065181c5f}{track\+\_\+by}} (FunctionT \&\&function)
|
|
\begin{DoxyCompactList}\small\item\em Select the state that determines whether a source needs recomputation. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$typename PolicyT, typename ValueT$>$ \newline
|
|
requires Snapshot\+Policy\+For$<$PolicyT, ValueT$>$}\\const void \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ae72aa784367f082484e9e998653de2d0}{source\+\_\+identity}} (const PolicyT \&policy, const ValueT \&value)
|
|
\begin{DoxyCompactList}\small\item\em Views may identify their underlying resource; ordinary sources retain object identity. \end{DoxyCompactList}\item
|
|
{\footnotesize template$<$Node\+Timing\+Clock Clock = Steady\+Node\+Clock$>$ }\\auto \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a48e42d1b80ff447550fed30ad60f0687}{time\+\_\+graph\+\_\+nodes}} (\mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_graph_timing}{Graph\+Timing}} \&timing, Clock clock=\{\})
|
|
\begin{DoxyCompactList}\small\item\em Opt into node timings; a custom clock supports deterministic accounting tests without sleeps. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
|
\doxysubsubsection*{Variables}
|
|
\begin{DoxyCompactItemize}
|
|
\item
|
|
{\footnotesize template$<$typename T$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab54a589695456ce4f7b3fb4e3bd97947}{is\+\_\+bindings\+\_\+v}} = false
|
|
\item
|
|
{\footnotesize template$<$typename... Binding\+Ts$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a3a8a1a7fd56af08612f141f2bb50e0a1}{is\+\_\+bindings\+\_\+v$<$ Bindings$<$ Binding\+Ts... $>$ $>$}} = \mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1traits_a8cb5b9ce5869ecf88101859ace70f92a}{misc\+::traits\+::all\+\_\+unique\+\_\+types\+\_\+v}}$<$typename Binding\+Ts\+::\+Key...$>$
|
|
\item
|
|
{\footnotesize template$<$Is\+Bindings BindingsT, typename KeyT$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a1563a020c811fac185bcc81b95b1035a}{has\+\_\+binding\+\_\+v}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_has_binding}{Has\+Binding}}$<$BindingsT, KeyT$>$\+::value
|
|
\item
|
|
{\footnotesize template$<$typename T$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a6da3a3b9a8f33ce1fbf5bcc8ed74f133}{is\+\_\+computation\+\_\+v}} = false
|
|
\item
|
|
{\footnotesize template$<$typename KeyT, typename InputsT, typename FunctionT, bool Owns\+Inputs$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ac2f7973ec74922857a6f764d1faaae2f}{is\+\_\+computation\+\_\+v$<$ Computation$<$ Key\+T, Inputs\+T, Function\+T, Owns\+Inputs $>$ $>$}} = true
|
|
\item
|
|
{\footnotesize template$<$typename T$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a785d1764613ef1db8cfbb8d3d8d401e5}{is\+\_\+computation\+\_\+graph\+\_\+v}} = false
|
|
\item
|
|
{\footnotesize template$<$typename... Computations$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a5bede32254345d0f43a09fc929dd07a9}{is\+\_\+computation\+\_\+graph\+\_\+v$<$ Computation\+Graph$<$ Computations... $>$ $>$}} = true
|
|
\item
|
|
{\footnotesize template$<$typename T$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aa187a1c3b0db631f8752bebcf8a16af7}{is\+\_\+dependency\+\_\+context\+\_\+v}} = false
|
|
\item
|
|
{\footnotesize template$<$typename... Resources$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab42cde4e64e4612056fbeaa5c383bc2d}{is\+\_\+dependency\+\_\+context\+\_\+v$<$ Dependency\+Context$<$ Resources... $>$ $>$}} = true
|
|
\item
|
|
{\footnotesize template$<$typename ParentT, typename KeysT$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ae3cc546046ae8957136c778b9c8c0682}{is\+\_\+dependency\+\_\+context\+\_\+v$<$ Dependency\+Context\+View$<$ Parent\+T, Keys\+T $>$ $>$}} = true
|
|
\item
|
|
{\footnotesize template$<$typename T$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a25fa55523bb000e3162a850a7912b249}{is\+\_\+key\+\_\+list\+\_\+v}} = false
|
|
\item
|
|
{\footnotesize template$<$typename... Key\+Ts$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ac02e21a813bf00c2f5debac9b251b757}{is\+\_\+key\+\_\+list\+\_\+v$<$ Key\+List$<$ Key\+Ts... $>$ $>$}} = \mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1traits_a8cb5b9ce5869ecf88101859ace70f92a}{misc\+::traits\+::all\+\_\+unique\+\_\+types\+\_\+v}}$<$Key\+Ts...$>$
|
|
\item
|
|
{\footnotesize template$<$Is\+Key\+List KeysT$>$ }\\constexpr std\+::size\+\_\+t \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a317a69acc139be6b2d45f95cf1c1412c}{key\+\_\+count\+\_\+v}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1detail_1_1_key_list_size}{detail\+::\+Key\+List\+Size}}$<$std\+::remove\+\_\+cvref\+\_\+t$<$KeysT$>$$>$\+::value
|
|
\begin{DoxyCompactList}\small\item\em Count distinct declared keys without constructing their associated values. \end{DoxyCompactList}\item
|
|
std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}{Preparation\+Status}}, std\+::string\+\_\+view $>$ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}{preparation\+\_\+status\+\_\+name\+\_\+map}} = \mbox{\hyperlink{namespaceserif_1_1meta_a228074fe1d60918db17444e31b601c2f}{meta\+::enum\+\_\+to\+\_\+enum\+\_\+string\+\_\+map}}$<$\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}{Preparation\+Status}}$>$()
|
|
\item
|
|
std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}{Preparation\+Mode}}, std\+::string\+\_\+view $>$ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a08ffdf8776f919989660acf4c0cde988}{preparation\+\_\+mode\+\_\+name\+\_\+map}} = \mbox{\hyperlink{namespaceserif_1_1meta_a228074fe1d60918db17444e31b601c2f}{meta\+::enum\+\_\+to\+\_\+enum\+\_\+string\+\_\+map}}$<$\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}{Preparation\+Mode}}$>$()
|
|
\item
|
|
{\footnotesize template$<$typename T$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a97396efb03530235b2aa83115cf2f921}{is\+\_\+resource\+\_\+v}} = false
|
|
\item
|
|
{\footnotesize template$<$typename KeyT, typename StorageT, typename PolicyT$>$ }\\constexpr bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a6059315fec7209b8443d75ac7a680880}{is\+\_\+resource\+\_\+v$<$ Resource$<$ Key\+T, Storage\+T, Policy\+T $>$ $>$}} = true
|
|
\end{DoxyCompactItemize}
|
|
|
|
|
|
\doxysubsection{Detailed Description}
|
|
{\itshape Computational Graphs}
|
|
|
|
Demonstration code for how to use the SERiF computational graph system The broad idea here is that there are many calculations which depend on each other but which may not necessarily always need to be recomputed just because another part of the model has changed. We model this as a combination of an acyclic computational graph, defined at compile time, and a runtime cache of values. The general workflow is that a developer defines the "{}context"{} of the computational graph, think of this as all of the inputs to the graph, or maybe more specifically, anything that could change due to some external event (e.\+g. a time step, a newton step, etc...) This context is probably the most CS intensive part of this code as the developer needs to think about lifetimes and ownership.
|
|
|
|
{\bfseries{Context}} Contexts are made with the make\+\_\+dependency\+\_\+context function, this accepts a variadic pack of bindings between a type and a runtime value. You can generate these yourself using the binding functions and types; however, we provide two convenience wrappers which generally developers should consider using.
|
|
\begin{DoxyItemize}
|
|
\item borrow\+: Used to bind a type to a reference to a value. This is useful for values which are owned by the caller and which the caller will manage the lifetime of (takes an lvalue).
|
|
\item own\+: Used to bind a type to a value which is owned by the context (copies an lvalue or moves an rvalue) Each of these functions accepts a type as a template parameter and a runtime value as an argument. The type is used as an ID, this is key to understand, if we write
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\textcolor{keyword}{using\ namespace\ }\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies}{serif::utils::dependencies}};}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ x\{1.0\};}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ context\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab0cfd959e8c00f5e1641f26798333972}{make\_dependency\_context}}(\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_abdacec2dea2bb64ecda1946529961565}{borrow<keys::Input>}}(x));}
|
|
|
|
\end{DoxyCode}
|
|
|
|
\end{DoxyItemize}
|
|
|
|
we are not saying that x is of type \doxylink{structserif_1_1utils_1_1dependencies_1_1keys_1_1_input}{keys\+::\+Input}, this is clearly not the case. Rather, we are registering in the computational graph a binding between the type \doxylink{structserif_1_1utils_1_1dependencies_1_1keys_1_1_input}{keys\+::\+Input} and the runtime value x. Think of this as naming the various inputs to the graph.
|
|
|
|
{\bfseries{Computations}} After defining a context we can define a computation, each computation defines a node, while its ordered input keys define the incoming edges. Consider the following example (assuming the context from above)\+:
|
|
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a70e11340fa044443fefa79ba7e0c11d5}{make\_computation<keys::Output,\ InputList<keys::Input>}}>(}
|
|
\DoxyCodeLine{\ [](\textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \_x)\ -\/>\ \textcolor{keywordtype}{double}\ \{}
|
|
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return}\ \_x\ *\ \_x;}
|
|
\DoxyCodeLine{\ \}}
|
|
\DoxyCodeLine{);}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
what we have defined here is a node which takes a single input tagged \doxylink{structserif_1_1utils_1_1dependencies_1_1keys_1_1_input}{keys\+::\+Input} and produces an output tagged as \doxylink{structserif_1_1utils_1_1dependencies_1_1keys_1_1_output}{keys\+::\+Output}. The input key declares an edge from that source to this node. Other nodes can use \doxylink{structserif_1_1utils_1_1dependencies_1_1keys_1_1_output}{keys\+::\+Output} as an input, and a successfully prepared result can be read with get or retained with share. These connections allow us to form a larger graph. Consider now the following code
|
|
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\textcolor{keyword}{using\ namespace\ }\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies}{serif::utils::dependencies}};}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keyword}{struct\ }tags\ \{}
|
|
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{struct\ }X\{\};}
|
|
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{struct\ }Y\{\};}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{struct\ }Output1\{\};}
|
|
\DoxyCodeLine{\ \ \ \ \textcolor{keyword}{struct\ }Output2\{\};}
|
|
\DoxyCodeLine{\};}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ x\{1.0\};}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ y\{2.0\};}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ context\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab0cfd959e8c00f5e1641f26798333972}{make\_dependency\_context}}(\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_abdacec2dea2bb64ecda1946529961565}{borrow<tags::X>}}(x),\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_abdacec2dea2bb64ecda1946529961565}{borrow<tags::Y>}}(y));}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func1\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a70e11340fa044443fefa79ba7e0c11d5}{make\_computation<tags::Output1,\ InputList<tags::X>}}>(}
|
|
\DoxyCodeLine{\ \ \ \ [](\textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \_x)\ -\/>\ \textcolor{keywordtype}{double}\ \{}
|
|
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \_x\ *\ \_x;}
|
|
\DoxyCodeLine{\ \ \ \ \}}
|
|
\DoxyCodeLine{);}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func2\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a70e11340fa044443fefa79ba7e0c11d5}{make\_computation<tags::Output2,\ InputList<tags::Output1,\ tags::Y>}}>(}
|
|
\DoxyCodeLine{\ \ \ [](\textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \_x,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \_y)\ -\/>\ \textcolor{keywordtype}{double}\ \{}
|
|
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \_x\ +\ \_y;}
|
|
\DoxyCodeLine{\ \ \ \ \}}
|
|
\DoxyCodeLine{);}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
we have now defined two computations, the first takes a single input, whichever input is tagged as tags\+::X and produces an output tagged as tags\+::\+Output1. The second computation takes two inputs, the first is the output of the first computation (lookup by the tag) and the second is whichever input is tagged as tags\+::Y, and produces an output tagged as tags\+::\+Output2. Note that the order of arguments to the lambda must be the same as the order of the tags in the \doxylink{namespaceserif_1_1utils_1_1dependencies_a22eef682b02dad9de4774e4b68b003ba}{Input\+List}, the dependencies module will automatically order arguments based on the \doxylink{namespaceserif_1_1utils_1_1dependencies_a22eef682b02dad9de4774e4b68b003ba}{Input\+List}. There is type checking to ensure that the types match, but if you have two inputs of the same type that are flipped there is no way for the system to inspect that and warn you. Further, depending on your compiler and flags there may be implicit casting between convertable types (e.\+g. int \texorpdfstring{$<$}{<}-\/\texorpdfstring{$>$}{>} double).
|
|
|
|
\begin{DoxyRefDesc}{Todo}
|
|
\item[\mbox{\hyperlink{todo__todo000045}{Todo}}]We may want to remove the ability to have implicit casting between types, this is a bit of a footgun and may lead to subtle bugs.\end{DoxyRefDesc}
|
|
|
|
|
|
\begin{DoxyNote}{Note}
|
|
This is primary goal of this system, split computations into small pieces with the ability to cache intermediate results and reuse as many of those intermediate results as we can can prove is safe to do. The whole reason this system is so complex is that very purpose. There is a fundamental problem with high dimensional stellar models, they are always going to be slow, therefore we need to accept some degree of complexity in order to make them tractable.
|
|
\end{DoxyNote}
|
|
{\bfseries{\doxylink{classserif_1_1utils_1_1dependencies_1_1_computation}{Computation} Cache}} Once we have the computations we need to connect them together, generally use the helper function make\+\_\+computation\+\_\+cache which takes a context and a variadic pack of computations. There are {\itshape a lot} of compile time checks which run to ensure that the graph is valid, the context describes what is needed to compute the graph, and that each computation is valid. Generally if a static analysis error or compile error pops up here it probably means there is a mistake in the definition of the context or the computations. I\textquotesingle{}ve tried to make these errors as clear as possible; however, there is only so much that you can do with the C++ compiler. I recommend first checking, probably with a drawn-\/out diagram, that all the tags are correct and what you expect.
|
|
|
|
A developer can also choose to use the make\+\_\+computation\+\_\+graph function to explicitly name a graph. This is useful when naming or reusing a collection of computations (make\+\_\+computation\+\_\+cache calls make\+\_\+computation\+\_\+graph and then fixes the source types from the supplied context without retaining the context). Now consider the following code assuming the context and computations from above\+:
|
|
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ graph\_cache\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ad583eaa88367daf4af4d420047f24d38}{make\_computation\_cache}}(context,\ func1,\ func2);}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
At this point we have a cache which we can access various parts of; however, no computations have been run yet. To run a computation we must call try\+\_\+prepare.
|
|
|
|
try\+\_\+prepare returns std\+::expected\+: ordinary rejection is a value, and no candidate results or snapshots are published on failure. Exceptions from a callable or snapshot policy propagate with the same cache protection. Previously retained results remain valid, but get and share require a successful current preparation. Always check the report before reading results.
|
|
|
|
try\+\_\+prepare takes the context and evaluates the requested nodes and their prerequisites, reusing unchanged results. By default every result is requested, so the first call evaluates the entire graph. \doxylink{namespaceserif_1_1utils_1_1dependencies_a0674f826a11ecdab76236fa550cd88d5}{Requested\+Results} can restrict evaluation to a branch.
|
|
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ report\ =\ graph\_cache.try\_prepare(context);}
|
|
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (!report)\ \{}
|
|
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return};\ \textcolor{comment}{//\ Handle\ report.error()\ before\ reading\ the\ cache.}}
|
|
\DoxyCodeLine{\}}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ func1\_result\ =\ graph\_cache.template\ get<tags::Output1>();}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ func2\_result\ =\ graph\_cache.template\ get<tags::Output2>();}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func1\_status\ =\ report-\/>template\ status<tags::Output1>();}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func2\_status\ =\ report-\/>template\ status<tags::Output2>();}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{std::string\_view\ func1\_status\_string\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}{preparation\_status\_name\_map}}[func1\_status];\ \textcolor{comment}{//\ note\ this\ is\ an\ inline\ map\ defined\ in\ serif::utils::dependencies}}
|
|
\DoxyCodeLine{std::string\_view\ func2\_status\_string\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}{preparation\_status\_name\_map}}[func2\_status];}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{std::println(\textcolor{stringliteral}{"{}Func1\ Result:\ \{\},\ Func2\ Result:\ \{\},\ Func1\ Status:\ \{\},\ Func2\ Status:\ \{\}"{}},\ func1\_result,\ func2\_result,\ func1\_status\_string,\ func2\_status\_string);}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
Now what we could do is change only one part of the input context and call try\+\_\+prepare again. Lets say we change only y, such that only func2 is stale.
|
|
|
|
|
|
\begin{DoxyCode}{0}
|
|
\DoxyCodeLine{y\ =\ 3.0;}
|
|
\DoxyCodeLine{report\ =\ graph\_cache.try\_prepare(context);}
|
|
\DoxyCodeLine{\textcolor{keywordflow}{if}\ (!report)\ \{}
|
|
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{return};\ \textcolor{comment}{//\ Handle\ report.error()\ before\ reading\ the\ cache.}}
|
|
\DoxyCodeLine{\}}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ func1\_result\ =\ graph\_cache.template\ get<tags::Output1>();}
|
|
\DoxyCodeLine{\textcolor{keywordtype}{double}\ func2\_result\ =\ graph\_cache.template\ get<tags::Output2>();}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func1\_status\ =\ report-\/>template\ status<tags::Output1>();}
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ func2\_status\ =\ report-\/>template\ status<tags::Output2>();}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{std::string\_view\ func1\_status\_string\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}{preparation\_status\_name\_map}}[func1\_status];\ \textcolor{comment}{//\ note\ this\ is\ an\ inline\ map\ defined\ in\ serif::utils::dependencies}}
|
|
\DoxyCodeLine{std::string\_view\ func2\_status\_string\ =\ \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}{preparation\_status\_name\_map}}[func2\_status];}
|
|
\DoxyCodeLine{}
|
|
\DoxyCodeLine{std::println(\textcolor{stringliteral}{"{}Func1\ Result:\ \{\},\ Func2\ Result:\ \{\},\ Func1\ Status:\ \{\},\ Func2\ Status:\ \{\}"{}},\ func1\_result,\ func2\_result,\ func1\_status\_string,\ func2\_status\_string);}
|
|
|
|
\end{DoxyCode}
|
|
|
|
|
|
\doxysubsection{Typedef Documentation}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_adc0d56ab32ca6ea92c3732dde92fa6a1}\index{serif::utils::dependencies@{serif::utils::dependencies}!bound\_type\_t@{bound\_type\_t}}
|
|
\index{bound\_type\_t@{bound\_type\_t}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{bound\_type\_t}{bound\_type\_t}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_adc0d56ab32ca6ea92c3732dde92fa6a1}
|
|
template$<$typename BindingsT, typename KeyT$>$ \\
|
|
using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_adc0d56ab32ca6ea92c3732dde92fa6a1}{serif\+::utils\+::dependencies\+::bound\+\_\+type\+\_\+t}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_bound_type}{Bound\+Type}}$<$BindingsT, KeyT$>$\+::target\+\_\+type}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a4b225a37465f007a877f89860d3627c1}\index{serif::utils::dependencies@{serif::utils::dependencies}!CombinedKeyList@{CombinedKeyList}}
|
|
\index{CombinedKeyList@{CombinedKeyList}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{CombinedKeyList}{CombinedKeyList}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a4b225a37465f007a877f89860d3627c1}
|
|
template$<$Is\+Key\+List... Lists$>$ \\
|
|
using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a4b225a37465f007a877f89860d3627c1}{serif\+::utils\+::dependencies\+::\+Combined\+Key\+List}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1detail_1_1_merge_key_lists}{detail\+::\+Merge\+Key\+Lists}}$<$\mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$$>$, std\+::remove\+\_\+cvref\+\_\+t$<$Lists$>$...$>$\+::type}
|
|
|
|
|
|
|
|
Combine requirements in first-\/appearance order, retaining distinct keys with shared targets.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a22eef682b02dad9de4774e4b68b003ba}\index{serif::utils::dependencies@{serif::utils::dependencies}!InputList@{InputList}}
|
|
\index{InputList@{InputList}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{InputList}{InputList}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a22eef682b02dad9de4774e4b68b003ba}
|
|
template$<$typename... Key\+Ts$>$ \\
|
|
using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a22eef682b02dad9de4774e4b68b003ba}{serif\+::utils\+::dependencies\+::\+Input\+List}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$Key\+Ts...$>$}
|
|
|
|
|
|
|
|
\doxylink{classserif_1_1utils_1_1dependencies_1_1_computation}{Computation} arguments are supplied in this key order.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a0674f826a11ecdab76236fa550cd88d5}\index{serif::utils::dependencies@{serif::utils::dependencies}!RequestedResults@{RequestedResults}}
|
|
\index{RequestedResults@{RequestedResults}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{RequestedResults}{RequestedResults}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a0674f826a11ecdab76236fa550cd88d5}
|
|
template$<$typename... Key\+Ts$>$ \\
|
|
using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a0674f826a11ecdab76236fa550cd88d5}{serif\+::utils\+::dependencies\+::\+Requested\+Results}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$Key\+Ts...$>$}
|
|
|
|
|
|
|
|
Preparing these results also prepares their required intermediate computations.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ad50a04df4c202c11f49d6a2cf594b5da}\index{serif::utils::dependencies@{serif::utils::dependencies}!ResolvedTargets@{ResolvedTargets}}
|
|
\index{ResolvedTargets@{ResolvedTargets}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{ResolvedTargets}{ResolvedTargets}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ad50a04df4c202c11f49d6a2cf594b5da}
|
|
template$<$typename BindingsT, typename KeysT$>$ \\
|
|
using \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ad50a04df4c202c11f49d6a2cf594b5da}{serif\+::utils\+::dependencies\+::\+Resolved\+Targets}} = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_resolve_keys}{Resolve\+Keys}}$<$BindingsT, std\+::remove\+\_\+cvref\+\_\+t$<$KeysT$>$$>$\+::type}
|
|
|
|
|
|
|
|
\doxysubsection{Enumeration Type Documentation}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7}\index{serif::utils::dependencies@{serif::utils::dependencies}!NodeOutcome@{NodeOutcome}}
|
|
\index{NodeOutcome@{NodeOutcome}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{NodeOutcome}{NodeOutcome}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7}
|
|
enum class \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7}{serif\+::utils\+::dependencies\+::\+Node\+Outcome}}\hspace{0.3cm}{\ttfamily [strong]}}
|
|
|
|
|
|
|
|
Describe a node invocation, independently of whether the whole graph request is later accepted.
|
|
|
|
\begin{DoxyEnumFields}[2]{Enumerator}
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{completed@{completed}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!completed@{completed}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7aaa8fb77e57d1ca18d593e909729871fe}\label{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7aaa8fb77e57d1ca18d593e909729871fe}
|
|
completed&\\
|
|
\hline
|
|
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{rejected@{rejected}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!rejected@{rejected}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7ac7537d6d48ecf261749c09a9f284bd45}\label{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7ac7537d6d48ecf261749c09a9f284bd45}
|
|
rejected&\\
|
|
\hline
|
|
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{exception@{exception}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!exception@{exception}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7a42552b1f133f9f8eb406d4f306ea9fd1}\label{namespaceserif_1_1utils_1_1dependencies_af2f6dab3a0204175602c7fc2348344f7a42552b1f133f9f8eb406d4f306ea9fd1}
|
|
exception&\\
|
|
\hline
|
|
|
|
\end{DoxyEnumFields}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}\index{serif::utils::dependencies@{serif::utils::dependencies}!PreparationMode@{PreparationMode}}
|
|
\index{PreparationMode@{PreparationMode}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{PreparationMode}{PreparationMode}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}
|
|
enum class \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}{serif\+::utils\+::dependencies\+::\+Preparation\+Mode}}\hspace{0.3cm}{\ttfamily [strong]}}
|
|
|
|
\begin{DoxyEnumFields}[2]{Enumerator}
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{reuse\_unchanged@{reuse\_unchanged}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!reuse\_unchanged@{reuse\_unchanged}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782aa49991912bafff4aa74bb3b4dbd42038}\label{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782aa49991912bafff4aa74bb3b4dbd42038}
|
|
reuse\+\_\+unchanged&\\
|
|
\hline
|
|
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{rebuild@{rebuild}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!rebuild@{rebuild}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782a9e67f9a60581ce784117ff2047627d2f}\label{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782a9e67f9a60581ce784117ff2047627d2f}
|
|
rebuild&\\
|
|
\hline
|
|
|
|
\end{DoxyEnumFields}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}\index{serif::utils::dependencies@{serif::utils::dependencies}!PreparationStatus@{PreparationStatus}}
|
|
\index{PreparationStatus@{PreparationStatus}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{PreparationStatus}{PreparationStatus}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}
|
|
enum class \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}{serif\+::utils\+::dependencies\+::\+Preparation\+Status}}\hspace{0.3cm}{\ttfamily [strong]}}
|
|
|
|
\begin{DoxyEnumFields}[2]{Enumerator}
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{not\_required@{not\_required}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!not\_required@{not\_required}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a20ab085a3c46af7db87fc1806865b329}\label{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a20ab085a3c46af7db87fc1806865b329}
|
|
not\+\_\+required&\\
|
|
\hline
|
|
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{reused@{reused}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!reused@{reused}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a657be30363225dfa595d3c8e59577181}\label{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a657be30363225dfa595d3c8e59577181}
|
|
reused&\\
|
|
\hline
|
|
|
|
\raisebox{\heightof{T}}[0pt][0pt]{\index{computed@{computed}!serif::utils::dependencies@{serif::utils::dependencies}}\index{serif::utils::dependencies@{serif::utils::dependencies}!computed@{computed}}}\Hypertarget{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a5a317d3dd3f7a2f675975a6d0c11c629}\label{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463a5a317d3dd3f7a2f675975a6d0c11c629}
|
|
computed&\\
|
|
\hline
|
|
|
|
\end{DoxyEnumFields}
|
|
|
|
|
|
\doxysubsection{Function Documentation}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a2b9af58b739c7c1217fad649158a1063}\index{serif::utils::dependencies@{serif::utils::dependencies}!borrow@{borrow}}
|
|
\index{borrow@{borrow}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{borrow()}{borrow()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a2b9af58b739c7c1217fad649158a1063}
|
|
template$<$typename KeyT, typename ValueT, typename PolicyT = Value\+Snapshot$>$ \\
|
|
auto serif\+::utils\+::dependencies\+::borrow (\begin{DoxyParamCaption}\item[{const ValueT \&\&}]{}{, }\item[{PolicyT}]{}{ = {\ttfamily \{\}}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [delete]}}
|
|
|
|
|
|
|
|
Borrowed storage must never refer to a temporary, including a const temporary.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_abdacec2dea2bb64ecda1946529961565}\index{serif::utils::dependencies@{serif::utils::dependencies}!borrow@{borrow}}
|
|
\index{borrow@{borrow}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{borrow()}{borrow()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_abdacec2dea2bb64ecda1946529961565}
|
|
template$<$typename KeyT, typename ValueT, typename PolicyT = Value\+Snapshot$>$ \\
|
|
auto serif\+::utils\+::dependencies\+::borrow (\begin{DoxyParamCaption}\item[{ValueT \&}]{value}{, }\item[{PolicyT}]{policy}{ = {\ttfamily \{\}}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Bind an existing object whose lifetime must cover every use of the context.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ae031216d69a09aa3921c363e36856e44}\index{serif::utils::dependencies@{serif::utils::dependencies}!combine\_dependency\_contexts@{combine\_dependency\_contexts}}
|
|
\index{combine\_dependency\_contexts@{combine\_dependency\_contexts}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{combine\_dependency\_contexts()}{combine\_dependency\_contexts()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ae031216d69a09aa3921c363e36856e44}
|
|
template$<$Is\+Dependency\+Context... Contexts$>$ \newline
|
|
requires (\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_1_1detail_acf2dea9a3fc1ce9b322c7635ef79a193}{detail\+::combinable\+\_\+resources}}(\mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1concepts_a0f84929456e6ed14cc6cbfb81215465a}{misc\+::concepts\+::\+ConcatT}}$<$typename Contexts\+::\+Resources...$>$\{\}))\\
|
|
auto serif\+::utils\+::dependencies\+::combine\+\_\+dependency\+\_\+contexts (\begin{DoxyParamCaption}\item[{const Contexts \&...}]{contexts}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Copy disjoint resources and their tracking policies into one context; borrowed objects retain their original lifetime.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a2b6e1389a71419222053720f4bd9cd43}\index{serif::utils::dependencies@{serif::utils::dependencies}!key\_index@{key\_index}}
|
|
\index{key\_index@{key\_index}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{key\_index()}{key\_index()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a2b6e1389a71419222053720f4bd9cd43}
|
|
template$<$typename KeyT, typename KeysT$>$ \newline
|
|
requires Contains\+Key$<$KeyT, KeysT$>$\\
|
|
std\+::size\+\_\+t serif\+::utils\+::dependencies\+::key\+\_\+index (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [consteval]}}
|
|
|
|
|
|
|
|
Locate a declared key in its ordered list; absent keys are rejected at compile time.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a70e11340fa044443fefa79ba7e0c11d5}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_computation@{make\_computation}}
|
|
\index{make\_computation@{make\_computation}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_computation()}{make\_computation()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a70e11340fa044443fefa79ba7e0c11d5}
|
|
template$<$typename KeyT, Is\+Key\+List InputsT, typename FunctionT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$FunctionT$>$, FunctionT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+computation (\begin{DoxyParamCaption}\item[{FunctionT \&\&}]{function}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Attach an output key and ordered input keys to a lambda, function, or other callable.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a37ad94611656a36bf3584940465302ec}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_computation\_cache@{make\_computation\_cache}}
|
|
\index{make\_computation\_cache@{make\_computation\_cache}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_computation\_cache()}{make\_computation\_cache()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a37ad94611656a36bf3584940465302ec}
|
|
template$<$typename ErrorT = std\+::string, Is\+Dependency\+Context ContextT, typename... Computations$>$ \newline
|
|
requires Compatible\+Computations$<$Computations...$>$ \&\& (std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$Computations$>$, Computations$>$ \&\& ...) \&\& Can\+Prepare$<$\mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation_graph}{Computation\+Graph}}$<$std\+::remove\+\_\+cvref\+\_\+t$<$Computations$>$...$>$, ContextT, ErrorT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+computation\+\_\+cache (\begin{DoxyParamCaption}\item[{const ContextT \&}]{context}{, }\item[{Computations \&\&...}]{computations}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Build a checked graph and an empty cache directly from named computations.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ad583eaa88367daf4af4d420047f24d38}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_computation\_cache@{make\_computation\_cache}}
|
|
\index{make\_computation\_cache@{make\_computation\_cache}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_computation\_cache()}{make\_computation\_cache()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ad583eaa88367daf4af4d420047f24d38}
|
|
template$<$typename ErrorT = std\+::string, Is\+Computation\+Graph GraphT, Is\+Dependency\+Context ContextT, typename ObserversT = Observers$<$$>$$>$ \newline
|
|
requires Can\+Prepare$<$GraphT, ContextT, ErrorT$>$ \&\& Observers\+For$<$ObserversT, GraphT, ContextT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$GraphT$>$, GraphT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$ObserversT$>$, ObserversT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+computation\+\_\+cache (\begin{DoxyParamCaption}\item[{GraphT \&\&}]{graph}{, }\item[{const ContextT \&}]{}{, }\item[{ObserversT \&\&}]{observers}{ = {\ttfamily ObserversT\{\}}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Fix the graph\textquotesingle{}s source types without retaining the supplied context or evaluating any computations.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_aaa065b5bd3823bd3835f159462af09d0}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_computation\_graph@{make\_computation\_graph}}
|
|
\index{make\_computation\_graph@{make\_computation\_graph}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_computation\_graph()}{make\_computation\_graph()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_aaa065b5bd3823bd3835f159462af09d0}
|
|
template$<$typename... Computations$>$ \newline
|
|
requires Compatible\+Computations$<$Computations...$>$ \&\& (std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$Computations$>$, Computations$>$ \&\& ...)\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+computation\+\_\+graph (\begin{DoxyParamCaption}\item[{Computations \&\&...}]{computations}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Reject duplicate producers and cyclic computational graphs at the declaration site.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ab0cfd959e8c00f5e1641f26798333972}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_dependency\_context@{make\_dependency\_context}}
|
|
\index{make\_dependency\_context@{make\_dependency\_context}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_dependency\_context()}{make\_dependency\_context()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ab0cfd959e8c00f5e1641f26798333972}
|
|
template$<$typename... Resources$>$ \newline
|
|
requires (Is\+Resource$<$Resources$>$ \&\& ...) \&\& \mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1traits_a8cb5b9ce5869ecf88101859ace70f92a}{misc\+::traits\+::all\+\_\+unique\+\_\+types\+\_\+v}}$<$typename std\+::remove\+\_\+cvref\+\_\+t$<$Resources$>$\+::\+Key...$>$\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+dependency\+\_\+context (\begin{DoxyParamCaption}\item[{Resources \&\&...}]{resources}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Build a context whose schema follows directly from its resource keys and types.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_af617b846949f46d528f63c89b218887b}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_observers@{make\_observers}}
|
|
\index{make\_observers@{make\_observers}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_observers()}{make\_observers()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_af617b846949f46d528f63c89b218887b}
|
|
template$<$typename... Registrations$>$ \newline
|
|
requires (\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_1_1detail_a54c9a0f2354c9edeef7db65bee38b1fe}{detail\+::is\+\_\+observer\+\_\+v}}$<$std\+::remove\+\_\+cvref\+\_\+t$<$Registrations$>$$>$ \&\& ...) \&\& (std\+::constructible\+\_\+from$<$std\+::remove\+\_\+cvref\+\_\+t$<$Registrations$>$, Registrations$>$ \&\& ...)\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+observers (\begin{DoxyParamCaption}\item[{Registrations \&\&...}]{observers}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Collect any number of registrations, including several observers of the same node or edge.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ad18195932b89cba96fd203584bfac47a}\index{serif::utils::dependencies@{serif::utils::dependencies}!make\_owning\_computation@{make\_owning\_computation}}
|
|
\index{make\_owning\_computation@{make\_owning\_computation}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{make\_owning\_computation()}{make\_owning\_computation()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ad18195932b89cba96fd203584bfac47a}
|
|
template$<$typename KeyT, Is\+Key\+List InputsT, typename FunctionT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$FunctionT$>$, FunctionT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::make\+\_\+owning\+\_\+computation (\begin{DoxyParamCaption}\item[{FunctionT \&\&}]{function}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Supply immutable shared handles to computed prerequisites so results can retain them without copying.
|
|
|
|
\begin{DoxyNote}{Note}
|
|
Every input must be produced by this graph. Context sources remain borrowed and cannot be retained this way. Resources borrowed inside a prerequisite must still outlive their use; the handle owns only the computed result.
|
|
\end{DoxyNote}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a1156ef3083e1e54eaabb23309b17fb57}\index{serif::utils::dependencies@{serif::utils::dependencies}!observe\_edge@{observe\_edge}}
|
|
\index{observe\_edge@{observe\_edge}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{observe\_edge()}{observe\_edge()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a1156ef3083e1e54eaabb23309b17fb57}
|
|
template$<$typename InputT, typename ConsumerT, typename FunctionT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$FunctionT$>$, FunctionT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::observe\+\_\+edge (\begin{DoxyParamCaption}\item[{FunctionT \&\&}]{function}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Bind a read-\/only callback to one input of one consumer; graph construction validates the edge and value type.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a427c6ce690c7551cbdbbb5261bd8c125}\index{serif::utils::dependencies@{serif::utils::dependencies}!observe\_node@{observe\_node}}
|
|
\index{observe\_node@{observe\_node}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{observe\_node()}{observe\_node()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a427c6ce690c7551cbdbbb5261bd8c125}
|
|
template$<$typename KeyT, typename BeforeT, typename AfterT$>$ \newline
|
|
requires Node\+Observer\+Callbacks$<$std\+::decay\+\_\+t$<$BeforeT$>$, std\+::decay\+\_\+t$<$AfterT$>$$>$ \&\& std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$BeforeT$>$, BeforeT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$AfterT$>$, AfterT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::observe\+\_\+node (\begin{DoxyParamCaption}\item[{BeforeT \&\&}]{before}{, }\item[{AfterT \&\&}]{after}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Bind before/after callbacks to a result key; callback captures determine any external storage lifetime.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a1011c9c6c8b4e2ca4e87b9826743dde5}\index{serif::utils::dependencies@{serif::utils::dependencies}!observe\_nodes@{observe\_nodes}}
|
|
\index{observe\_nodes@{observe\_nodes}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{observe\_nodes()}{observe\_nodes()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a1011c9c6c8b4e2ca4e87b9826743dde5}
|
|
template$<$typename BeforeT, typename AfterT$>$ \newline
|
|
requires std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$BeforeT$>$, BeforeT$>$ \&\& std\+::constructible\+\_\+from$<$std\+::decay\+\_\+t$<$AfterT$>$, AfterT$>$\\
|
|
auto serif\+::utils\+::dependencies\+::observe\+\_\+nodes (\begin{DoxyParamCaption}\item[{BeforeT \&\&}]{before}{, }\item[{AfterT \&\&}]{after}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Observe all executed nodes; cache construction checks the callback contract for every result key.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a80612ee1a5c84ccd1b36e5aab14c17d5}\index{serif::utils::dependencies@{serif::utils::dependencies}!own@{own}}
|
|
\index{own@{own}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{own()}{own()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a80612ee1a5c84ccd1b36e5aab14c17d5}
|
|
template$<$typename KeyT, typename ValueT, typename PolicyT = Value\+Snapshot$>$ \\
|
|
auto serif\+::utils\+::dependencies\+::own (\begin{DoxyParamCaption}\item[{ValueT \&\&}]{value}{, }\item[{PolicyT}]{policy}{ = {\ttfamily \{\}}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Store a value in the context; rvalues transfer ownership and lvalues are copied.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ae72aa784367f082484e9e998653de2d0}\index{serif::utils::dependencies@{serif::utils::dependencies}!source\_identity@{source\_identity}}
|
|
\index{source\_identity@{source\_identity}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{source\_identity()}{source\_identity()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ae72aa784367f082484e9e998653de2d0}
|
|
template$<$typename PolicyT, typename ValueT$>$ \newline
|
|
requires Snapshot\+Policy\+For$<$PolicyT, ValueT$>$\\
|
|
const void \texorpdfstring{$\ast$}{*} serif\+::utils\+::dependencies\+::source\+\_\+identity (\begin{DoxyParamCaption}\item[{const PolicyT \&}]{policy}{, }\item[{const ValueT \&}]{value}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Views may identify their underlying resource; ordinary sources retain object identity.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a48e42d1b80ff447550fed30ad60f0687}\index{serif::utils::dependencies@{serif::utils::dependencies}!time\_graph\_nodes@{time\_graph\_nodes}}
|
|
\index{time\_graph\_nodes@{time\_graph\_nodes}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{time\_graph\_nodes()}{time\_graph\_nodes()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a48e42d1b80ff447550fed30ad60f0687}
|
|
template$<$Node\+Timing\+Clock Clock = Steady\+Node\+Clock$>$ \\
|
|
auto serif\+::utils\+::dependencies\+::time\+\_\+graph\+\_\+nodes (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_graph_timing}{Graph\+Timing}} \&}]{timing}{, }\item[{Clock}]{clock}{ = {\ttfamily \{\}}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Opt into node timings; a custom clock supports deterministic accounting tests without sleeps.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_abd3aa4196f4454ea6052835065181c5f}\index{serif::utils::dependencies@{serif::utils::dependencies}!track\_by@{track\_by}}
|
|
\index{track\_by@{track\_by}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{track\_by()}{track\_by()}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_abd3aa4196f4454ea6052835065181c5f}
|
|
template$<$typename FunctionT$>$ \\
|
|
auto serif\+::utils\+::dependencies\+::track\+\_\+by (\begin{DoxyParamCaption}\item[{FunctionT \&\&}]{function}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [nodiscard]}}
|
|
|
|
|
|
|
|
Select the state that determines whether a source needs recomputation.
|
|
|
|
|
|
|
|
\doxysubsection{Variable Documentation}
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a1563a020c811fac185bcc81b95b1035a}\index{serif::utils::dependencies@{serif::utils::dependencies}!has\_binding\_v@{has\_binding\_v}}
|
|
\index{has\_binding\_v@{has\_binding\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{has\_binding\_v}{has\_binding\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a1563a020c811fac185bcc81b95b1035a}
|
|
template$<$Is\+Bindings BindingsT, typename KeyT$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::has\+\_\+binding\+\_\+v = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_has_binding}{Has\+Binding}}$<$BindingsT, KeyT$>$\+::value\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ab54a589695456ce4f7b3fb4e3bd97947}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_bindings\_v@{is\_bindings\_v}}
|
|
\index{is\_bindings\_v@{is\_bindings\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_bindings\_v}{is\_bindings\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ab54a589695456ce4f7b3fb4e3bd97947}
|
|
template$<$typename T$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::is\+\_\+bindings\+\_\+v = false\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a3a8a1a7fd56af08612f141f2bb50e0a1}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_bindings\_v$<$ Bindings$<$ BindingTs... $>$ $>$@{is\_bindings\_v$<$ Bindings$<$ BindingTs... $>$ $>$}}
|
|
\index{is\_bindings\_v$<$ Bindings$<$ BindingTs... $>$ $>$@{is\_bindings\_v$<$ Bindings$<$ BindingTs... $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_bindings\_v$<$ Bindings$<$ BindingTs... $>$ $>$}{is\_bindings\_v< Bindings< BindingTs... > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a3a8a1a7fd56af08612f141f2bb50e0a1}
|
|
template$<$typename... Binding\+Ts$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_ab54a589695456ce4f7b3fb4e3bd97947}{serif\+::utils\+::dependencies\+::is\+\_\+bindings\+\_\+v}}$<$ \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_bindings}{Bindings}}$<$ Binding\+Ts... $>$ $>$ = \mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1traits_a8cb5b9ce5869ecf88101859ace70f92a}{misc\+::traits\+::all\+\_\+unique\+\_\+types\+\_\+v}}$<$typename Binding\+Ts\+::\+Key...$>$\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a785d1764613ef1db8cfbb8d3d8d401e5}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_computation\_graph\_v@{is\_computation\_graph\_v}}
|
|
\index{is\_computation\_graph\_v@{is\_computation\_graph\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_computation\_graph\_v}{is\_computation\_graph\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a785d1764613ef1db8cfbb8d3d8d401e5}
|
|
template$<$typename T$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::is\+\_\+computation\+\_\+graph\+\_\+v = false\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a5bede32254345d0f43a09fc929dd07a9}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_computation\_graph\_v$<$ ComputationGraph$<$ Computations... $>$ $>$@{is\_computation\_graph\_v$<$ ComputationGraph$<$ Computations... $>$ $>$}}
|
|
\index{is\_computation\_graph\_v$<$ ComputationGraph$<$ Computations... $>$ $>$@{is\_computation\_graph\_v$<$ ComputationGraph$<$ Computations... $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_computation\_graph\_v$<$ ComputationGraph$<$ Computations... $>$ $>$}{is\_computation\_graph\_v< ComputationGraph< Computations... > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a5bede32254345d0f43a09fc929dd07a9}
|
|
template$<$typename... Computations$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a785d1764613ef1db8cfbb8d3d8d401e5}{serif\+::utils\+::dependencies\+::is\+\_\+computation\+\_\+graph\+\_\+v}}$<$ \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation_graph}{Computation\+Graph}}$<$ Computations... $>$ $>$ = true\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a6da3a3b9a8f33ce1fbf5bcc8ed74f133}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_computation\_v@{is\_computation\_v}}
|
|
\index{is\_computation\_v@{is\_computation\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_computation\_v}{is\_computation\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a6da3a3b9a8f33ce1fbf5bcc8ed74f133}
|
|
template$<$typename T$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::is\+\_\+computation\+\_\+v = false\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ac2f7973ec74922857a6f764d1faaae2f}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_computation\_v$<$ Computation$<$ KeyT, InputsT, FunctionT, OwnsInputs $>$ $>$@{is\_computation\_v$<$ Computation$<$ KeyT, InputsT, FunctionT, OwnsInputs $>$ $>$}}
|
|
\index{is\_computation\_v$<$ Computation$<$ KeyT, InputsT, FunctionT, OwnsInputs $>$ $>$@{is\_computation\_v$<$ Computation$<$ KeyT, InputsT, FunctionT, OwnsInputs $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_computation\_v$<$ Computation$<$ KeyT, InputsT, FunctionT, OwnsInputs $>$ $>$}{is\_computation\_v< Computation< KeyT, InputsT, FunctionT, OwnsInputs > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ac2f7973ec74922857a6f764d1faaae2f}
|
|
template$<$typename KeyT, typename InputsT, typename FunctionT, bool Owns\+Inputs$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a6da3a3b9a8f33ce1fbf5bcc8ed74f133}{serif\+::utils\+::dependencies\+::is\+\_\+computation\+\_\+v}}$<$ \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_computation}{Computation}}$<$ KeyT, InputsT, FunctionT, Owns\+Inputs $>$ $>$ = true\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_aa187a1c3b0db631f8752bebcf8a16af7}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_dependency\_context\_v@{is\_dependency\_context\_v}}
|
|
\index{is\_dependency\_context\_v@{is\_dependency\_context\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_dependency\_context\_v}{is\_dependency\_context\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_aa187a1c3b0db631f8752bebcf8a16af7}
|
|
template$<$typename T$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::is\+\_\+dependency\+\_\+context\+\_\+v = false\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ab42cde4e64e4612056fbeaa5c383bc2d}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_dependency\_context\_v$<$ DependencyContext$<$ Resources... $>$ $>$@{is\_dependency\_context\_v$<$ DependencyContext$<$ Resources... $>$ $>$}}
|
|
\index{is\_dependency\_context\_v$<$ DependencyContext$<$ Resources... $>$ $>$@{is\_dependency\_context\_v$<$ DependencyContext$<$ Resources... $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_dependency\_context\_v$<$ DependencyContext$<$ Resources... $>$ $>$}{is\_dependency\_context\_v< DependencyContext< Resources... > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ab42cde4e64e4612056fbeaa5c383bc2d}
|
|
template$<$typename... Resources$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aa187a1c3b0db631f8752bebcf8a16af7}{serif\+::utils\+::dependencies\+::is\+\_\+dependency\+\_\+context\+\_\+v}}$<$ \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_dependency_context}{Dependency\+Context}}$<$ Resources... $>$ $>$ = true\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ae3cc546046ae8957136c778b9c8c0682}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_dependency\_context\_v$<$ DependencyContextView$<$ ParentT, KeysT $>$ $>$@{is\_dependency\_context\_v$<$ DependencyContextView$<$ ParentT, KeysT $>$ $>$}}
|
|
\index{is\_dependency\_context\_v$<$ DependencyContextView$<$ ParentT, KeysT $>$ $>$@{is\_dependency\_context\_v$<$ DependencyContextView$<$ ParentT, KeysT $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_dependency\_context\_v$<$ DependencyContextView$<$ ParentT, KeysT $>$ $>$}{is\_dependency\_context\_v< DependencyContextView< ParentT, KeysT > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ae3cc546046ae8957136c778b9c8c0682}
|
|
template$<$typename ParentT, typename KeysT$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aa187a1c3b0db631f8752bebcf8a16af7}{serif\+::utils\+::dependencies\+::is\+\_\+dependency\+\_\+context\+\_\+v}}$<$ \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_dependency_context_view}{Dependency\+Context\+View}}$<$ ParentT, KeysT $>$ $>$ = true\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a25fa55523bb000e3162a850a7912b249}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_key\_list\_v@{is\_key\_list\_v}}
|
|
\index{is\_key\_list\_v@{is\_key\_list\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_key\_list\_v}{is\_key\_list\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a25fa55523bb000e3162a850a7912b249}
|
|
template$<$typename T$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::is\+\_\+key\+\_\+list\+\_\+v = false\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ac02e21a813bf00c2f5debac9b251b757}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_key\_list\_v$<$ KeyList$<$ KeyTs... $>$ $>$@{is\_key\_list\_v$<$ KeyList$<$ KeyTs... $>$ $>$}}
|
|
\index{is\_key\_list\_v$<$ KeyList$<$ KeyTs... $>$ $>$@{is\_key\_list\_v$<$ KeyList$<$ KeyTs... $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_key\_list\_v$<$ KeyList$<$ KeyTs... $>$ $>$}{is\_key\_list\_v< KeyList< KeyTs... > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ac02e21a813bf00c2f5debac9b251b757}
|
|
template$<$typename... Key\+Ts$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a25fa55523bb000e3162a850a7912b249}{serif\+::utils\+::dependencies\+::is\+\_\+key\+\_\+list\+\_\+v}}$<$ \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1_key_list}{Key\+List}}$<$ Key\+Ts... $>$ $>$ = \mbox{\hyperlink{namespaceserif_1_1utils_1_1misc_1_1traits_a8cb5b9ce5869ecf88101859ace70f92a}{misc\+::traits\+::all\+\_\+unique\+\_\+types\+\_\+v}}$<$Key\+Ts...$>$\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a97396efb03530235b2aa83115cf2f921}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_resource\_v@{is\_resource\_v}}
|
|
\index{is\_resource\_v@{is\_resource\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_resource\_v}{is\_resource\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a97396efb03530235b2aa83115cf2f921}
|
|
template$<$typename T$>$ \\
|
|
bool serif\+::utils\+::dependencies\+::is\+\_\+resource\+\_\+v = false\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a6059315fec7209b8443d75ac7a680880}\index{serif::utils::dependencies@{serif::utils::dependencies}!is\_resource\_v$<$ Resource$<$ KeyT, StorageT, PolicyT $>$ $>$@{is\_resource\_v$<$ Resource$<$ KeyT, StorageT, PolicyT $>$ $>$}}
|
|
\index{is\_resource\_v$<$ Resource$<$ KeyT, StorageT, PolicyT $>$ $>$@{is\_resource\_v$<$ Resource$<$ KeyT, StorageT, PolicyT $>$ $>$}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{is\_resource\_v$<$ Resource$<$ KeyT, StorageT, PolicyT $>$ $>$}{is\_resource\_v< Resource< KeyT, StorageT, PolicyT > >}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a6059315fec7209b8443d75ac7a680880}
|
|
template$<$typename KeyT, typename StorageT, typename PolicyT$>$ \\
|
|
bool \mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a97396efb03530235b2aa83115cf2f921}{serif\+::utils\+::dependencies\+::is\+\_\+resource\+\_\+v}}$<$ \mbox{\hyperlink{classserif_1_1utils_1_1dependencies_1_1_resource}{Resource}}$<$ KeyT, StorageT, PolicyT $>$ $>$ = true\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a317a69acc139be6b2d45f95cf1c1412c}\index{serif::utils::dependencies@{serif::utils::dependencies}!key\_count\_v@{key\_count\_v}}
|
|
\index{key\_count\_v@{key\_count\_v}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{key\_count\_v}{key\_count\_v}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a317a69acc139be6b2d45f95cf1c1412c}
|
|
template$<$Is\+Key\+List KeysT$>$ \\
|
|
std\+::size\+\_\+t serif\+::utils\+::dependencies\+::key\+\_\+count\+\_\+v = \mbox{\hyperlink{structserif_1_1utils_1_1dependencies_1_1detail_1_1_key_list_size}{detail\+::\+Key\+List\+Size}}$<$std\+::remove\+\_\+cvref\+\_\+t$<$KeysT$>$$>$\+::value\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [constexpr]}}
|
|
|
|
|
|
|
|
Count distinct declared keys without constructing their associated values.
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_a08ffdf8776f919989660acf4c0cde988}\index{serif::utils::dependencies@{serif::utils::dependencies}!preparation\_mode\_name\_map@{preparation\_mode\_name\_map}}
|
|
\index{preparation\_mode\_name\_map@{preparation\_mode\_name\_map}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{preparation\_mode\_name\_map}{preparation\_mode\_name\_map}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_a08ffdf8776f919989660acf4c0cde988}
|
|
std\+::unordered\+\_\+map$<$\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}{Preparation\+Mode}}, std\+::string\+\_\+view$>$ serif\+::utils\+::dependencies\+::preparation\+\_\+mode\+\_\+name\+\_\+map = \mbox{\hyperlink{namespaceserif_1_1meta_a228074fe1d60918db17444e31b601c2f}{meta\+::enum\+\_\+to\+\_\+enum\+\_\+string\+\_\+map}}$<$\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_a84cfff3388a09373636c15a3817a0782}{Preparation\+Mode}}$>$()\hspace{0.3cm}{\ttfamily [inline]}}
|
|
|
|
\Hypertarget{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}\index{serif::utils::dependencies@{serif::utils::dependencies}!preparation\_status\_name\_map@{preparation\_status\_name\_map}}
|
|
\index{preparation\_status\_name\_map@{preparation\_status\_name\_map}!serif::utils::dependencies@{serif::utils::dependencies}}
|
|
\doxysubsubsection{\texorpdfstring{preparation\_status\_name\_map}{preparation\_status\_name\_map}}
|
|
{\footnotesize\ttfamily \label{namespaceserif_1_1utils_1_1dependencies_ab3b86a8b49e4a73b04c3fa547b45f8b2}
|
|
std\+::unordered\+\_\+map$<$\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}{Preparation\+Status}}, std\+::string\+\_\+view$>$ serif\+::utils\+::dependencies\+::preparation\+\_\+status\+\_\+name\+\_\+map = \mbox{\hyperlink{namespaceserif_1_1meta_a228074fe1d60918db17444e31b601c2f}{meta\+::enum\+\_\+to\+\_\+enum\+\_\+string\+\_\+map}}$<$\mbox{\hyperlink{namespaceserif_1_1utils_1_1dependencies_aabcbd6673ef3efcfc167ceb73cc7d463}{Preparation\+Status}}$>$()\hspace{0.3cm}{\ttfamily [inline]}}
|
|
|