MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
NetworkOperator.hpp
Go to the documentation of this file.
1#pragma once
2
4
5class NodeNetwork;
6
7/**
8 * @class NetworkOperator
9 * @brief Domain-agnostic interpretive lens for network processing
10 *
11 * Base interface for all operators (graphics, audio, control).
12 * Operators own their data representation and processing logic.
13 * No assumptions about position types, vertex formats, or domains.
14 */
15class MAYAFLUX_API NetworkOperator {
16public:
17 virtual ~NetworkOperator() = default;
18
19 /**
20 * @brief Process for one batch cycle
21 * @param dt Time delta or sample count (operator-specific)
22 */
23 virtual void process(float dt) = 0;
24
25 /**
26 * @brief Set operator parameter
27 */
28 virtual void set_parameter(std::string_view param, double value) = 0;
29
30 /**
31 * @brief Query operator internal state
32 */
33 [[nodiscard]] virtual std::optional<double> query_state(std::string_view query) const = 0;
34
35 /**
36 * @brief Type name for introspection
37 */
38 [[nodiscard]] virtual std::string_view get_type_name() const = 0;
39
40 /**
41 * @brief Apply ONE_TO_ONE parameter mapping (per-point control)
42 * @param param Parameter name (e.g., "force_x", "color", "mass")
43 * @param source Source network providing per-point values
44 *
45 * Default implementation does nothing. Operators that support
46 * per-point control override this method.
47 */
48 virtual void apply_one_to_one(
49 std::string_view param,
50 const std::shared_ptr<NodeNetwork>& source)
51 {
52 // Default: no-op (operator doesn't support per-point control)
53 }
54};
55
56} // namespace MayaFlux::Nodes::Network
virtual void set_parameter(std::string_view param, double value)=0
Set operator parameter.
virtual void process(float dt)=0
Process for one batch cycle.
virtual void apply_one_to_one(std::string_view param, const std::shared_ptr< NodeNetwork > &source)
Apply ONE_TO_ONE parameter mapping (per-point control)
virtual std::optional< double > query_state(std::string_view query) const =0
Query operator internal state.
virtual std::string_view get_type_name() const =0
Type name for introspection.
Domain-agnostic interpretive lens for network processing.