45 template <
typename Source>
46 requires std::derived_from<Source, Node>
53 template <
typename Source>
54 requires std::derived_from<Source, NodeNetwork>
77 [[nodiscard]] std::optional<double>
at(
size_t index)
const;
80 [[nodiscard]]
bool due() const noexcept
92 template <
typename T =
double>
94 [[nodiscard]] std::optional<T>
pending() noexcept
132 template <
typename T>
Owns one described struct of Slot members for a host such as a network, an operator or an input node.
bool has_value() const noexcept
True once a value was given.
static constexpr uint8_t width_of() noexcept
double value() const noexcept
The value as a double.
bool changed() const noexcept
void set_scalar(double value) noexcept
void set_blank() noexcept
Marks the slot set with one zero lane and leaves it clean.
static constexpr bool is_value
size_t width() const noexcept
Components held: 0 when empty, 1 for a number, flag or enum, 2 to 4 for a vector, 6 for a box.
void observe(T actual) noexcept
Shows the value the owner really has.
void assign(const ControlValue &incoming) noexcept
Takes everything incoming holds, so the next due() is true.
std::optional< T > pending() noexcept
The value to apply now as type T, or nullopt when nothing is due.
std::optional< T > pending() noexcept
The value to apply now as type T, or nullopt when nothing is due.
std::shared_ptr< Node > m_node
void observe(T actual) noexcept
Shows the value the owner really has, unless a source is feeding it.
void refresh()
Reads the node source into value().
Control(std::shared_ptr< Source > source)
Control(Control &&) noexcept=default
Control(T value) noexcept
Control(std::shared_ptr< Source > source)
bool sourced() const noexcept
True when a node or a network feeds this control.
std::optional< double > at(size_t index) const
Value for one element: the network's output there, else the scalar.
Control(const Control &)=default
bool per_element() const noexcept
True when a network feeds one value per element.
size_t element_count() const
Node count of the source network, or 0 without one.
bool due() const noexcept
True when a consumer should apply this control now.
std::shared_ptr< NodeNetwork > m_network
void assign(const Control &incoming)
Takes everything incoming holds, so the next due() is true.
Abstract base class for structured collections of nodes with defined relationships.
ControlValueStore< Control > ControlStore
The store of Control members for a NodeNetwork or a NetworkOperator.