MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Nodes::Network::Source Class Reference

Anything that can supply a number when evaluated. More...

#include <RelationOperators.hpp>

+ Collaboration diagram for MayaFlux::Nodes::Network::Source:

Classes

struct  NetworkIndex
 

Public Types

using Function = std::function< double()>
 

Public Member Functions

double evaluate () const
 Current value.
 
template<typename Callable >
requires (!std::same_as<std::remove_cvref_t<Callable>, Source> && std::is_invocable_r_v<double, Callable&>)
 Source (Callable &&callable)
 
 Source (double constant)
 
template<std::derived_from< NodeNetwork > NetworkType>
 Source (std::shared_ptr< NetworkType > network, size_t index)
 One indexed output of a NodeNetwork.
 
template<std::derived_from< Node > NodeType>
 Source (std::shared_ptr< NodeType > node)
 

Private Attributes

std::variant< double, std::shared_ptr< Node >, NetworkIndex, Function > m_value
 

Detailed Description

Anything that can supply a number when evaluated.

The right-hand side of a mapping wherever an operator parameter should be drivable by whatever is at hand:

  • A constant returns itself.
  • A node returns its get_last_output().
  • A NodeNetwork plus an index returns that network's get_node_output(index), or 0.0 if it has nothing there. Works the same whether the network is this RelationNetwork or any other NodeNetwork.
  • A callable is invoked on whichever thread evaluates the source, so it follows the same rules as a node hook on the audio thread.

Definition at line 27 of file RelationOperators.hpp.


The documentation for this class was generated from the following file: