/// @file dpf/eval_target.hpp /// @brief Eval channel tags for the unified DPF / iDPF / DCF surface. /// @copyright Copyright (c) 2019-2026 Ryan Henry and [others](@ref authors) /// @license Released under a GNU General Public v2.0 (GPLv2) license. #ifndef LIBDPF_INCLUDE_DPF_EVAL_TARGET_HPP__ #define LIBDPF_INCLUDE_DPF_EVAL_TARGET_HPP__ #include #include #include namespace dpf { /// Sentinel: deduce point-slot prefix from the key (`meta[I].prefix`). inline constexpr std::size_t prefix_deduce = std::numeric_limits::max(); /// Point-output channel: slot `I`, optional prefix check `N`. template struct out_t { static constexpr std::size_t index = I; static constexpr std::size_t prefix = N; static constexpr bool prefix_fixed = (N != prefix_deduce); }; template inline constexpr out_t out{}; /// Comparison (DCF) channel. struct cmp_t { }; inline constexpr cmp_t cmp{}; /// Prefix of an `idcf` comparison. `L` is the number of leading bits. template struct cmp_prefix_t { static constexpr std::size_t length = L; }; template inline constexpr cmp_prefix_t cmp_prefix{}; template struct is_out : std::false_type { }; template struct is_out> : std::true_type { }; template inline constexpr bool is_out_v = is_out>::value; template struct is_cmp_target : std::bool_constant, cmp_t>> { }; template inline constexpr bool is_cmp_target_v = is_cmp_target::value; template struct is_cmp_prefix_target : std::false_type { }; template struct is_cmp_prefix_target> : std::true_type { }; template inline constexpr bool is_cmp_prefix_target_v = is_cmp_prefix_target>::value; /// True for channel tags that must not bind as the key in classic eval_*. template inline constexpr bool is_eval_channel_tag_v = is_out_v || is_cmp_target_v || is_cmp_prefix_target_v; template struct looks_like_dpf_key : std::false_type { }; template struct looks_like_dpf_key> : std::true_type { }; template inline constexpr bool looks_like_dpf_key_v = looks_like_dpf_key>::value; template struct is_incremental_dpf_key : std::false_type { }; template struct is_incremental_dpf_key> : std::true_type { }; template inline constexpr bool is_incremental_dpf_key_v = is_incremental_dpf_key>::value; /// True only for keys that must use the slot-aware (multi-level / comparison) /// eval path. Every key now carries a `slot_meta` table (so /// `is_incremental_dpf_key_v` is true for all keys), but classic single-level /// equal-width keys keep using the classic `eval_*` fast paths; they set /// `is_multilevel == false`. Multi-level (`at`) and comparison keys set it /// to true. template struct is_multilevel_key : std::false_type { }; template struct is_multilevel_key> : std::bool_constant { }; template inline constexpr bool is_multilevel_key_v = is_multilevel_key>::value; } // namespace dpf #endif // LIBDPF_INCLUDE_DPF_EVAL_TARGET_HPP__