-IOProcessor::IOProcessor (Session& s, const string& name, Placement p,
- int input_min, int input_max,
- int output_min, int output_max,
- DataType dtype,
- bool public_ports)
- : Processor(s, name, p)
- , _io (new IO(s, name, input_min, input_max, output_min, output_max, dtype, public_ports))
+/* create an IOProcessor that proxies to a new IO object */
+
+IOProcessor::IOProcessor (Session& s, bool with_input, bool with_output,
+ const string& proc_name, const string io_name, DataType dtype)
+ : Processor(s, proc_name)
+{
+ /* these are true in this constructor whether we actually create the associated
+ IO objects or not.
+ */
+
+ _own_input = true;
+ _own_output = true;
+
+ if (with_input) {
+ _input.reset (new IO(s, io_name.empty() ? proc_name : io_name, IO::Input, dtype));
+ }
+
+ if (with_output) {
+ _output.reset (new IO(s, io_name.empty() ? proc_name : io_name, IO::Output, dtype));
+ }
+}
+
+/* create an IOProcessor that proxies to an existing IO object */
+
+IOProcessor::IOProcessor (Session& s, boost::shared_ptr<IO> in, boost::shared_ptr<IO> out,
+ const string& proc_name, DataType /*dtype*/)
+ : Processor(s, proc_name)
+ , _input (in)
+ , _output (out)