MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kriya::Sequence Class Reference

A sequence of computational operations with a fluent, declarative API. More...

#include <Chain.hpp>

+ Collaboration diagram for MayaFlux::Kriya::Sequence:

Public Member Functions

Sequenceoperator>> (const ActionToken &token)
 Adds an action to the sequence.
 
void execute ()
 Executes the sequence using the global managers.
 
void execute (const std::shared_ptr< Nodes::NodeGraphManager > &node_manager, const std::shared_ptr< Vruta::TaskScheduler > &scheduler)
 Executes the sequence with explicit managers.
 

Private Attributes

std::vector< ActionTokentokens
 Collection of actions in this sequence.
 

Detailed Description

A sequence of computational operations with a fluent, declarative API.

The Sequence class provides a way to create sequences of computational operations using a fluent, declarative API with the stream operator (>>). It's designed for creating expressive sequences of node connections, time delays, and function calls.

This approach is inspired by dataflow programming and reactive systems, which use similar operators to express both data flow and temporal sequencing. It allows for a more intuitive, declarative way of expressing sequences compared to traditional imperative programming.

Example usage:

// Create a sequence
// Define a sequence of operations
seq >> data_source >> 0.5 >> []() { std::cout << "Half second passed" << std::endl; }
>> transform_node >> 0.5 >> output_node;
// Execute the sequence
seq.execute();
void execute()
Executes the sequence using the global managers.
Definition Chain.cpp:78
A sequence of computational operations with a fluent, declarative API.
Definition Chain.hpp:240

This creates a sequence that:

  1. Connects data_source to the output
  2. Waits 0.5 seconds
  3. Prints a message
  4. Connects transform_node to the output
  5. Waits 0.5 seconds
  6. Connects output_node to the output

The Sequence is part of a broader pattern of using operator overloading to create a domain-specific language for computational flow programming within C++.

Definition at line 240 of file Chain.hpp.


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