MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ evaluate()

double MayaFlux::Nodes::Network::Source::evaluate ( ) const
inline

Current value.

Returns
The constant, the node's last output, the network index's output, or the callable's result. Zero for an empty node, a network index the network has no value for, or an empty callable.

Definition at line 70 of file RelationOperators.hpp.

71 {
72 if (const auto* constant = std::get_if<double>(&m_value)) {
73 return *constant;
74 }
75 if (const auto* node = std::get_if<std::shared_ptr<Node>>(&m_value)) {
76 return *node ? (*node)->get_last_output() : 0.0;
77 }
78 if (const auto* index = std::get_if<NetworkIndex>(&m_value)) {
79 return index->network ? index->network->get_node_output(index->index).value_or(0.0) : 0.0;
80 }
81 const auto& function = std::get<Function>(m_value);
82 return function ? function() : 0.0;
83 }
uint32_t index
Definition VKDevice.cpp:122
std::variant< double, std::shared_ptr< Node >, NetworkIndex, Function > m_value
Tendency< D, R > constant(R value)
Tendency returning a fixed value regardless of input.

References index, and m_value.