SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::utils::dependencies::detail Namespace Reference

Classes

struct  AppendBinding
 
struct  AppendBinding< Bindings< BindingsTs... >, BindingT >
 
struct  AppendKeys
 
struct  AppendKeys< ResultT, FirstT, Rest... >
 
struct  AppendUnique
 
struct  AppendUnique< KeyList< Keys... >, T >
 
struct  BindingLookup
 
struct  BindingLookup< Bindings< BindingTs... > >
 Share one compile-time lookup structure across all keys in a binding collection. More...
 
struct  BorrowedValue
 
struct  BoundType
 
struct  CachedResult
 
struct  ComputationCacheStorage
 
struct  ComputationCacheStorage< GraphT, BindingsT, types::TypeList< Resources... >, std::index_sequence< Indices... > >
 
struct  ComputationCacheTraits
 
struct  ComputationCacheTraits< GraphT, ContextT, ErrorT, true >
 
struct  ComputationGraphSchema
 
struct  ComputationGraphSchema< GraphT, ContextT, true >
 
struct  Graph
 Immutable topology of computed nodes; context sources are resolved separately. More...
 
struct  HasBinding
 
struct  HasBinding< Bindings< BindingTs... >, KeyT >
 
struct  Invocation
 Ill-formed calls fail the graph concept instead of producing a hard instantiation error. More...
 
struct  Invocation< ComputationT, types::TypeList< Arguments... >, std::void_t< InvocationResult< ComputationT, Arguments... > > >
 
struct  KeyListSize
 
struct  KeyListSize< KeyList< Keys... > >
 
struct  MergeKeyLists
 
struct  MergeKeyLists< ResultT, KeyList< Keys... >, Rest... >
 
class  NodeObservation
 Each started hook owns one invocation state and finishes once, including on exceptional exit. More...
 
struct  OwnedValue
 
struct  ResolveComputation
 Missing inputs stop resolution before instantiating the callable or its result type. More...
 
struct  ResolveComputation< ComputationT, BindingsT, true >
 
struct  ResolveGraph
 Walk execution positions, appending each result type to the available input bindings. More...
 
struct  ResolveGraph< GraphT, BindingsT, Position, false >
 
struct  ResolveGraph< GraphT, BindingsT, Position, true >
 
struct  ResolveStep
 An invalid callable must not instantiate the remaining graph or access a missing Value type. More...
 
struct  ResolveStep< GraphT, BindingsT, Position, ComputationT, true >
 
struct  ResourceKeys
 
struct  ResourceKeys< types::TypeList< Resources... > >
 
struct  Result
 Computations publish owned, movable values, either directly or through std::expected. More...
 
struct  Result< std::expected< ValueT, ErrorT > >
 
struct  SourceSnapshot
 
struct  UsedResource
 
struct  ValidObservers
 
struct  ValidObservers< Observers< Registrations... >, GraphT, ContextT, true >
 

Typedefs

template<typename GraphT, typename ContextT>
using UsedResources = misc::concepts::FilterT<typename ContextT::Resources, UsedResource<GraphT>::template Predicate>
 
template<typename ComputationT, typename TargetT>
using ComputationArgument = std::conditional_t<ComputationT::owns_inputs, std::shared_ptr<const TargetT>, TargetT>
 Owning computations receive the cache handle; ordinary computations receive the value.
 
template<typename ComputationT, typename... Arguments>
using InvocationResult
 Match the const argument access used by the runtime cache without constructing any values.
 

Functions

template<typename... Resources>
consteval bool combinable_resources (types::TypeList< Resources... >)
 Combining contexts must preserve every resource, with exactly one owner of each key.
 
template<typename GraphT, typename BindingsT, typename ErrorT, std::size_t... Indices>
consteval bool compatible_errors (std::index_sequence< Indices... >)
 Value-returning calculations can share a graph with expected results carrying its declared error or an exact union alternative.
 
template<typename BindingsT, typename... Keys>
consteval bool independent_results (KeyList< Keys... >)
 A key has exactly one producer: either the context or a computation.
 
template<typename KeyT, typename... Types>
consteval std::size_t type_index (types::TypeList< Types... >)
 Locate a type without requiring the types themselves to be constructible.
 
template<typename KeyT, typename BeforeT, typename AfterT>
decltype(auto) begin_node (NodeObserver< KeyT, BeforeT, AfterT > &observer)
 Preserve the existing nullary callback contract for individually selected nodes.
 
template<typename KeyT, typename BeforeT, typename AfterT>
decltype(auto) begin_node (AllNodesObserver< BeforeT, AfterT > &observer)
 Bind the identity once so generic registrations use the same exception-safe invocation scope.
 
template<typename InputT, typename ConsumerT, typename ObserverT, typename ValueT>
void observe_input (ObserverT &, const ValueT &)
 Unrelated registrations do not observe this edge.
 
template<typename InputT, typename ConsumerT, typename FunctionT, typename ValueT>
void observe_input (EdgeObserver< InputT, ConsumerT, FunctionT > &observer, const ValueT &value)
 Edge observers read the numerical value even when its consumer receives an owning handle.
 
template<typename GraphT, typename BindingsT, typename KeyT, typename BeforeT, typename AfterT>
consteval bool valid_observer (NodeObserver< KeyT, BeforeT, AfterT > *)
 Nodes are identified by result keys, including constant computations without inputs.
 
template<typename BeforeT, typename AfterT, typename... Keys>
consteval bool valid_all_nodes (KeyList< Keys... >)
 Use a bounded array scan rather than a graph-sized fold expression at the compiler's nesting limit.
 
template<typename GraphT, typename BindingsT, typename BeforeT, typename AfterT>
consteval bool valid_observer (AllNodesObserver< BeforeT, AfterT > *)
 A generic callback must accept every node, including constant computations without inputs.
 
template<typename GraphT, typename BindingsT, typename InputT, typename ConsumerT, typename FunctionT>
consteval bool valid_observer (EdgeObserver< InputT, ConsumerT, FunctionT > *)
 Use declared inputs to include source edges as well as computed prerequisites.
 

Variables

template<typename... Types>
constexpr bool valid_binding_types_v
 Validate each binding without an implicit constraint fold proportional to the collection size.
 
template<typename ComputationT, typename ResultKeysT>
constexpr bool valid_input_ownership_v
 Owning nodes can retain computed inputs; context resources remain borrowed.
 
template<typename Source, typename Target>
constexpr bool compatible_error_v = std::same_as<Source, Target>
 Ordinary graph failures retain an exact type; numerical conversions must not erase diagnostics.
 
template<typename Source, typename... Alternatives>
constexpr bool compatible_error_v< Source, std::variant< Alternatives... > >
 Independent modules may explicitly aggregate their unchanged failures in an unambiguous tagged union.
 
template<typename KeyT, typename KeysT>
constexpr bool contains_key_v = false
 
template<typename KeyT, typename... Keys>
constexpr bool contains_key_v< KeyT, KeyList< Keys... > > = type_index<KeyT>(types::TypeList<Keys...>{}) < sizeof...(Keys)
 
template<typename RequiredT, typename AvailableT>
constexpr bool key_list_subset_v = false
 
template<typename... Keys, typename AvailableT>
constexpr bool key_list_subset_v< KeyList< Keys... >, AvailableT >
 
template<typename T>
constexpr bool is_observer_v = false
 
template<typename KeyT, typename BeforeT, typename AfterT>
constexpr bool is_observer_v< NodeObserver< KeyT, BeforeT, AfterT > > = true
 
template<typename BeforeT, typename AfterT>
constexpr bool is_observer_v< AllNodesObserver< BeforeT, AfterT > > = true
 
template<typename InputT, typename ConsumerT, typename FunctionT>
constexpr bool is_observer_v< EdgeObserver< InputT, ConsumerT, FunctionT > > = true
 
template<typename ObserverT, typename KeyT>
constexpr bool observes_node_v = false
 
template<typename KeyT, typename BeforeT, typename AfterT>
constexpr bool observes_node_v< NodeObserver< KeyT, BeforeT, AfterT >, KeyT > = true
 
template<typename BeforeT, typename AfterT, typename KeyT>
constexpr bool observes_node_v< AllNodesObserver< BeforeT, AfterT >, KeyT > = true
 
template<typename TimePoint>
constexpr bool node_time_point_v = false
 
template<typename Clock, typename Duration>
constexpr bool node_time_point_v< std::chrono::time_point< Clock, Duration > > = std::is_arithmetic_v<typename Duration::rep>
 

Typedef Documentation

◆ ComputationArgument

template<typename ComputationT, typename TargetT>
using serif::utils::dependencies::detail::ComputationArgument = std::conditional_t<ComputationT::owns_inputs, std::shared_ptr<const TargetT>, TargetT>

Owning computations receive the cache handle; ordinary computations receive the value.

◆ InvocationResult

template<typename ComputationT, typename... Arguments>
using serif::utils::dependencies::detail::InvocationResult
Initial value:
decltype(std::declval<const ComputationT&>().evaluate(
))
std::conditional_t< ComputationT::owns_inputs, std::shared_ptr< const TargetT >, TargetT > ComputationArgument
Owning computations receive the cache handle; ordinary computations receive the value.
Definition result.hpp:30

Match the const argument access used by the runtime cache without constructing any values.

◆ UsedResources

template<typename GraphT, typename ContextT>
using serif::utils::dependencies::detail::UsedResources = misc::concepts::FilterT<typename ContextT::Resources, UsedResource<GraphT>::template Predicate>

Function Documentation

◆ begin_node() [1/2]

template<typename KeyT, typename BeforeT, typename AfterT>
decltype(auto) serif::utils::dependencies::detail::begin_node ( AllNodesObserver< BeforeT, AfterT > & observer)
nodiscard

Bind the identity once so generic registrations use the same exception-safe invocation scope.

◆ begin_node() [2/2]

template<typename KeyT, typename BeforeT, typename AfterT>
decltype(auto) serif::utils::dependencies::detail::begin_node ( NodeObserver< KeyT, BeforeT, AfterT > & observer)
nodiscard

Preserve the existing nullary callback contract for individually selected nodes.

◆ combinable_resources()

template<typename... Resources>
bool serif::utils::dependencies::detail::combinable_resources ( types::TypeList< Resources... > )
nodiscardconsteval

Combining contexts must preserve every resource, with exactly one owner of each key.

◆ compatible_errors()

template<typename GraphT, typename BindingsT, typename ErrorT, std::size_t... Indices>
bool serif::utils::dependencies::detail::compatible_errors ( std::index_sequence< Indices... > )
nodiscardconsteval

Value-returning calculations can share a graph with expected results carrying its declared error or an exact union alternative.

◆ independent_results()

template<typename BindingsT, typename... Keys>
bool serif::utils::dependencies::detail::independent_results ( KeyList< Keys... > )
nodiscardconsteval

A key has exactly one producer: either the context or a computation.

◆ observe_input() [1/2]

template<typename InputT, typename ConsumerT, typename FunctionT, typename ValueT>
void serif::utils::dependencies::detail::observe_input ( EdgeObserver< InputT, ConsumerT, FunctionT > & observer,
const ValueT & value )

Edge observers read the numerical value even when its consumer receives an owning handle.

◆ observe_input() [2/2]

template<typename InputT, typename ConsumerT, typename ObserverT, typename ValueT>
void serif::utils::dependencies::detail::observe_input ( ObserverT & ,
const ValueT &  )

Unrelated registrations do not observe this edge.

◆ type_index()

template<typename KeyT, typename... Types>
std::size_t serif::utils::dependencies::detail::type_index ( types::TypeList< Types... > )
nodiscardconsteval

Locate a type without requiring the types themselves to be constructible.

◆ valid_all_nodes()

template<typename BeforeT, typename AfterT, typename... Keys>
bool serif::utils::dependencies::detail::valid_all_nodes ( KeyList< Keys... > )
nodiscardconsteval

Use a bounded array scan rather than a graph-sized fold expression at the compiler's nesting limit.

◆ valid_observer() [1/3]

template<typename GraphT, typename BindingsT, typename BeforeT, typename AfterT>
bool serif::utils::dependencies::detail::valid_observer ( AllNodesObserver< BeforeT, AfterT > * )
nodiscardconsteval

A generic callback must accept every node, including constant computations without inputs.

◆ valid_observer() [2/3]

template<typename GraphT, typename BindingsT, typename InputT, typename ConsumerT, typename FunctionT>
bool serif::utils::dependencies::detail::valid_observer ( EdgeObserver< InputT, ConsumerT, FunctionT > * )
nodiscardconsteval

Use declared inputs to include source edges as well as computed prerequisites.

◆ valid_observer() [3/3]

template<typename GraphT, typename BindingsT, typename KeyT, typename BeforeT, typename AfterT>
bool serif::utils::dependencies::detail::valid_observer ( NodeObserver< KeyT, BeforeT, AfterT > * )
nodiscardconsteval

Nodes are identified by result keys, including constant computations without inputs.

Variable Documentation

◆ compatible_error_v

template<typename Source, typename Target>
bool serif::utils::dependencies::detail::compatible_error_v = std::same_as<Source, Target>
inlineconstexpr

Ordinary graph failures retain an exact type; numerical conversions must not erase diagnostics.

◆ compatible_error_v< Source, std::variant< Alternatives... > >

template<typename Source, typename... Alternatives>
bool serif::utils::dependencies::detail::compatible_error_v< Source, std::variant< Alternatives... > >
inlineconstexpr
Initial value:
=
std::same_as<Source, std::variant<Alternatives...>> || ((std::same_as<Source, Alternatives> || ...) && std::constructible_from<std::variant<Alternatives...>, Source>)

Independent modules may explicitly aggregate their unchanged failures in an unambiguous tagged union.

◆ contains_key_v

template<typename KeyT, typename KeysT>
bool serif::utils::dependencies::detail::contains_key_v = false
inlineconstexpr

◆ contains_key_v< KeyT, KeyList< Keys... > >

template<typename KeyT, typename... Keys>
bool serif::utils::dependencies::detail::contains_key_v< KeyT, KeyList< Keys... > > = type_index<KeyT>(types::TypeList<Keys...>{}) < sizeof...(Keys)
inlineconstexpr

◆ is_observer_v

template<typename T>
bool serif::utils::dependencies::detail::is_observer_v = false
inlineconstexpr

◆ is_observer_v< AllNodesObserver< BeforeT, AfterT > >

template<typename BeforeT, typename AfterT>
bool serif::utils::dependencies::detail::is_observer_v< AllNodesObserver< BeforeT, AfterT > > = true
inlineconstexpr

◆ is_observer_v< EdgeObserver< InputT, ConsumerT, FunctionT > >

template<typename InputT, typename ConsumerT, typename FunctionT>
bool serif::utils::dependencies::detail::is_observer_v< EdgeObserver< InputT, ConsumerT, FunctionT > > = true
inlineconstexpr

◆ is_observer_v< NodeObserver< KeyT, BeforeT, AfterT > >

template<typename KeyT, typename BeforeT, typename AfterT>
bool serif::utils::dependencies::detail::is_observer_v< NodeObserver< KeyT, BeforeT, AfterT > > = true
inlineconstexpr

◆ key_list_subset_v

template<typename RequiredT, typename AvailableT>
bool serif::utils::dependencies::detail::key_list_subset_v = false
inlineconstexpr

◆ key_list_subset_v< KeyList< Keys... >, AvailableT >

template<typename... Keys, typename AvailableT>
bool serif::utils::dependencies::detail::key_list_subset_v< KeyList< Keys... >, AvailableT >
inlineconstexpr
Initial value:
= [] {
constexpr std::array<bool, sizeof...(Keys)> available{contains_key_v<Keys, AvailableT>...};
for (const bool present : available) {
if (!present) { return false; }
}
return true;
}()
constexpr bool contains_key_v
Definition type_lists.hpp:20

◆ node_time_point_v

template<typename TimePoint>
bool serif::utils::dependencies::detail::node_time_point_v = false
inlineconstexpr

◆ node_time_point_v< std::chrono::time_point< Clock, Duration > >

template<typename Clock, typename Duration>
bool serif::utils::dependencies::detail::node_time_point_v< std::chrono::time_point< Clock, Duration > > = std::is_arithmetic_v<typename Duration::rep>
inlineconstexpr

◆ observes_node_v

template<typename ObserverT, typename KeyT>
bool serif::utils::dependencies::detail::observes_node_v = false
inlineconstexpr

◆ observes_node_v< AllNodesObserver< BeforeT, AfterT >, KeyT >

template<typename BeforeT, typename AfterT, typename KeyT>
bool serif::utils::dependencies::detail::observes_node_v< AllNodesObserver< BeforeT, AfterT >, KeyT > = true
inlineconstexpr

◆ observes_node_v< NodeObserver< KeyT, BeforeT, AfterT >, KeyT >

template<typename KeyT, typename BeforeT, typename AfterT>
bool serif::utils::dependencies::detail::observes_node_v< NodeObserver< KeyT, BeforeT, AfterT >, KeyT > = true
inlineconstexpr

◆ valid_binding_types_v

template<typename... Types>
bool serif::utils::dependencies::detail::valid_binding_types_v
inlineconstexpr
Initial value:
= [] {
constexpr std::array<bool, sizeof...(Types)> valid{IsBinding<Types>...};
for (const bool binding : valid) {
if (!binding) { return false; }
}
return true;
}()
Definition binding.hpp:15

Validate each binding without an implicit constraint fold proportional to the collection size.

◆ valid_input_ownership_v

template<typename ComputationT, typename ResultKeysT>
bool serif::utils::dependencies::detail::valid_input_ownership_v
inlineconstexpr
Initial value:
= !std::remove_cvref_t<ComputationT>::owns_inputs ||
constexpr bool key_list_subset_v
Definition type_lists.hpp:26

Owning nodes can retain computed inputs; context resources remain borrowed.