InputCategory as bitwise flag and Better handle inputs
Context
Often optional input are treated as required inputs and this contribution make the InputCategory as a bitwise filter to ease filtering of needed inputs without altering the api.
Modified files
include/aidge/graph/GraphView.hppsrc/graph/GraphView.cppinclude/aidge/graph/Node.hppsrc/graph/Node.cppinclude/aidge/operator/Operator.hpp-
include/aidge/utils/BitwiseUtils.hpp- Added
PyBind :
python_binding/graph/pybind_GraphView.cpppython_binding/operator/pybind_Operator.cpppython_binding/pybind_core.cpp
Detailed major modifications
- New optional (by default old behavior) filter parameter for
std::set<std::shared_ptr<Aidge::Node>> Aidge::GraphView::inputNodes(InputCategory filter) -
enum class InputCategoryis now an unsigned int object class allowing bitwise operations -
getNbFreeDataInputs()now return only Data and DataOptional inputs -
addChildnow add the first available free data instead of the first data
Edited by Maxence Naud