main.cpp 1.55 KB
Newer Older
1
// Headers are available because we added the pls target
2 3
#include <string>
#include <cstdio>
4
#include <tuple>
5
#include <array>
6

7 8 9 10 11
#include <pls/dataflow/inputs.h>
#include <pls/dataflow/outputs.h>
#include <pls/dataflow/internal/graph.h>
#include <pls/dataflow/internal/out_port.h>
#include <pls/dataflow/internal/buffer.h>
12

13
int main() {
14
  using namespace pls::dataflow;
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
  using namespace pls::dataflow::internal;

  out_port<int> port1;
  out_port<int> port2;
  graph<static_buffer<4>::type, inputs<int, int>, outputs<int>> tmp{};

  port1 >> tmp.in_port<0>();
  port2 >> tmp.in_port<1>();

  port1.push_token({1, {}});
  port2.push_token({2, {}});

//  using namespace pls::dataflow;
//
//  graph<inputs<int, int>, outputs<int, int>, 2> graph2;
//  graph2.input<0>() >> graph2.output<1>();
//  graph2.input<1>() >> graph2.output<0>();
//
//  graph<inputs<int, int>, outputs<int, int>, 2> graph1;
//  graph1.input<0>() >> graph2.external_input<0>();
//  graph1.input<1>() >> graph2.external_input<1>();
//  graph2.external_output<0>() >> graph1.output<0>();
//  graph2.external_output<1>() >> graph1.output<1>();
//
//  graph1.push_input(1, 2);
//  graph1.push_input(3, 4);
//
//  auto result1 = graph1.get_output();
//  std::cout << std::get<0>(result1) << ", " << std::get<1>(result1) << std::endl;
//
//  graph1.push_input(5, 6);
//
//  auto result2 = graph1.get_output();
//  std::cout << std::get<0>(result2) << ", " << std::get<1>(result2) << std::endl;
//
//  auto result3 = graph1.get_output();
//  std::cout << std::get<0>(result3) << ", " << std::get<1>(result3) << std::endl;
52

53
}