Skip to content

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.hpp
  • src/graph/GraphView.cpp
  • include/aidge/graph/Node.hpp
  • src/graph/Node.cpp
  • include/aidge/operator/Operator.hpp
  • include/aidge/utils/BitwiseUtils.hpp - Added

PyBind :

  • python_binding/graph/pybind_GraphView.cpp
  • python_binding/operator/pybind_Operator.cpp
  • python_binding/pybind_core.cpp

Detailed major modifications

  1. New optional (by default old behavior) filter parameter for std::set<std::shared_ptr<Aidge::Node>> Aidge::GraphView::inputNodes(InputCategory filter)
  2. enum class InputCategory is now an unsigned int object class allowing bitwise operations
  3. getNbFreeDataInputs() now return only Data and DataOptional inputs
  4. addChild now add the first available free data instead of the first data
Edited by Maxence Naud

Merge request reports

Loading