can't passthrough non pywrapped objects
Closed this issue · 4 comments
straszheim commented
Not sure what to do with this one. It seems that you can't write a cell that passes non pywrapped objects through... or maybe I just don't know the idiom and this needs docs...
I'm back to thinking of
inputs.declare("in", ...)
outputs.declare("out", ...)
int process(...)
{
*in = *out;
}
or maybe something other than void... struct opaque {}; or struct unknown {}; ?
ethanrublee commented
Here is how we pass through on any type. I disabled type checking on none type.
struct PassthroughAny
{
static void declare_io(const tendrils& parms, tendrils& in, tendrils& out)
{
in.declare<ecto::tendril::none>("in", "Any type");
out.declare<ecto::tendril::none>("out", "Any type");
}
void configure(const tendrils& parms, tendrils& in, tendrils& out)
{
in_ = in.at("in");
out_ = out.at("out");
}
int process(tendrils& in, tendrils& out)
{
out_->copy_value(*in_);
return ecto::OK;
}
tendril::ptr in_, out_;
};
ethanrublee commented
This should be considered an advanced use of ecto. Its the lazy type way of doing things.
straszheim commented
This is all wrapped up, no?
ethanrublee commented
Fixed. passthrough