I am currently developing a block with multiple dynamic input and output pins (i.e. the user can click on the block at design time and set the number of I/O pins to 10 or 11 for example). I also want the input and output pins to be generic so that any data type can be connected during design time and the block will automatically change its configuration due to the type of data input.
I have all ready managed to get dynamic generic input pins to work by setting the input signature to:
pin::id( Id )
.name( "Int or Double Input" )
.description( "Input can either be an Int or Double" )
.catalog_id( EYW_KERNEL_CATALOG_ID )
.class_id( EYW_KERNEL_CATALOG_GENERIC_DATATYPE_ID )
and then using the std::nothrow option in the get_input_datatype< whateverDataType >( INPUT_ID, std::nothrow) which returns NULL if that data type is not connected to check what type of data type the user connects to the pin.
I have a problem however with getting the output pins to be generic. I can successfully get a dynamic number of output pins to work, however (whether the pins are created dynamically or not), I cannot connect the generic output pin to any other type of block. I therefore cannot use any function such as get_output_datatype… as the pin is not connected to anything.
Could someone please describe how to correctly create a generic output pin, like can be found in the Arithmetic block in EyesWeb version 18.104.22.168.