Open quesnel opened 2 years ago
We known the type of output/input for each ports. So we can provide a constant expression is-compatible port for each model.
enum class value_port_type : i8 { continuous, discrete, both }; class counter { input_port x[1]; constexpr value_port_type x_type(int i) noexcept { return value_port_type::both; } }; class abstract_cross{ input_port x[4]; output_port y[3]; constexpr value_port_type x_type(int i) noexcept { return value_port_type::both; } constexpr value_port_type y_type(int i) noexcept { if (i == 0 || i == 1) return value_port_type::continuous; else return value_port_type::discrete; } };
We known the type of output/input for each ports. So we can provide a constant expression is-compatible port for each model.