package ru.kirillius.pf.sdn.flow;

import lombok.RequiredArgsConstructor;
import ru.kirillius.pf.sdn.api.Networking.NetworkScope;
import ru.kirillius.pf.sdn.api.flow.CallContext;

import java.util.List;

@RequiredArgsConstructor
public class Summator extends CommonFunction {

    @Override
    public List<String> getInputNames() {
        return List.of("A", "B");
    }

    @Override
    public List<String> getOutputNames() {
        return List.of("output");
    }

    @Override
    public void apply(CallContext context) {
        var output = new NetworkScope();
        context.getSources().forEach(output::add);
        context.setOutputs(List.of(output));
    }

}
