plasmodic / ecto

ecto is a dynamically configurable Directed Acyclic processing Graph (DAG) framework.
http://ecto.willowgarage.com/
BSD 3-Clause "New" or "Revised" License
97 stars 37 forks source link

optional processing of connected inputs only #254

Closed stonier closed 10 years ago

stonier commented 10 years ago

I went looking for this and found a discussion already on the mailing list.

This pull request implements it...though not sure if it's the best approach. It exposes to the process function only those input tendrils which are connected - this was exactly my intuition when I first started using ecto.

Nonetheless, the default behaviour is as it was...the new behaviour is triggered when instantiating a cell, e.g.:

foo = dslam_tutorial.Foo("foo")
bar = dslam_tutorial.Bar("bar", connected_inputs_only=True)

and can be easily introspected from inside the process function by inspecting the tendrils map object, e.g.:

  int process(const ecto::tendrils& in, const ecto::tendrils& /*out*/)
  {
    std::cout << "Bar::process"<< std::endl;
    for(const auto& tendril : in) {
      std::cout << "  Name: " << tendril.first << std::endl;
    }
    ....