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

One addressable participant of a RelationNetwork. More...

#include <RelationSlot.hpp>

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

Public Member Functions

std::span< double > prepare_block (uint32_t frames)
 Size this slot's block for writing.
 
void reserve_block (uint32_t block_frames)
 Preallocate this slot's block storage without changing its size.
 
void set_active (bool is_active)
 Set this slot's activity, firing on_enter/on_leave on a real transition.
 
void set_node (std::shared_ptr< Node > new_node)
 Set this slot's node.
 

Public Attributes

bool active { true }
 
std::vector< double > block
 
uint32_t index {}
 
double level { 0.0 }
 
std::string name
 
std::shared_ptr< Node > node
 
std::vector< std::function< void()> > on_enter
 
std::vector< std::function< void()> > on_leave
 

Detailed Description

One addressable participant of a RelationNetwork.

A plain record: an optional node, a level, an activity flag, and the last rendered block. Fields are public and operators read them directly; the few methods below exist only where a field needs more than a plain assignment (firing callbacks, enabling a node's hooks).

Warning
A slot's address is not stable: RelationNetwork::add_slot() may reallocate the whole slot vector. Never hold a pointer or reference to a RelationSlot past a process_batch() call; read a slot fresh through RelationNetwork::get_slot(index) or get_node_output(index) instead.

Structural edits (assigning a node, registering callbacks) must happen outside process_batch().

A plain aggregate: RelationNetwork::add_slot() takes one by value, so it can be built with a designated initializer instead of a set_node() call afterward.

n->add_slot({ .name = "carrier", .node = vega.Sine(220.0, 1.0) });
n->add_slot({ .name = "product" }); // no node
Creator vega
Global Creator instance.
Definition Creator.cpp:28
Note
.node set this way still gets its hooks enabled: add_slot() applies that regardless of whether the node arrived through set_node() or through the .node field directly.

Definition at line 38 of file RelationSlot.hpp.


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