Go to the documentation of this file. 1 #ifndef OGLPLUS_TEXGEN_FALLBACK_INPUT_HPP
9 #define OGLPLUS_TEXGEN_FALLBACK_INPUT_HPP
14 namespace eagine::oglp::texgen {
16 template <
typename FallbackOutput>
17 class fallback_input :
public base_input {
19 FallbackOutput _fallback;
23 : base_input(parent, name)
24 , _fallback(parent) {}
26 template <
typename... P>
27 fallback_input(node_intf& parent,
string_view name, P&&... p)
28 : base_input(parent, name)
29 , _fallback(parent, std::forward<P>(p)...) {}
31 FallbackOutput& fallback() noexcept {
35 bool accepts_value_type(slot_data_type)
override {
39 output_intf& output() {
41 return connected_output();
48 set_default_value(valid_if_between<span_size_t, 0, 3> c,
float v)
override {
49 return fallback().set_default_value(c.value(), v);
53 return output().value_type();
57 definitions(std::ostream& out, compile_context& ctxt)
override {
58 return output().definitions(out, ctxt);
61 std::ostream& expression(std::ostream& out, compile_context& ctxt)
override {
62 return output().expression(out, ctxt);
67 using input_with_const_default = fallback_input<constant_output<T>>;
71 #endif // OGLPLUS_TEXGEN_FALLBACK_INPUT_HPP
value_type
Value tree value element data type enumeration.
Definition: interface.hpp:27
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116