-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to the plugin system with examples #88
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good!
Some more structural comments on the dynamic ports and hire functions. The main things that should IMO be addressed in this PR:
- finding a good global naming and renaming the various uses of
tag_t::map_type
,fair::graph::node_construction_param
, ... definitions to that. - The choice of having ports that are statically and/or dynamically defined should be dependent on the base class but IMO, always use the
node<T>
CTRP-base class (N.B. to be renamed ->block<T>
to be consistent with existing GR3 naming conventions) - the hier_node (I guess soon named
hier_block
or perhapssub-graph
) concept is good and one of the two possible/needed implementations ... we need to look for a nice API where users can declare the sub-graph in the sense of 'grouping' and or sub-domain with its own scheduler.
@ivan-cukic what do you think?
test/qa_dynamic_node.cpp
Outdated
fg::OUT<T> _output_port; | ||
|
||
public: | ||
multi_adder(std::size_t input_ports_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be handled with node parameters and the initialisation been done in
uint32_t n_input_ports = 3;
public:
void init(const tag_t::map_type &old_setting, const tag_t::map_type &new_setting) noexcept { /*...*/ }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For later, added a comment - it needs dynamic ports to be supported by fg::node
|
||
~multi_adder() override = default; | ||
|
||
std::string_view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use node::set_name(..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For later, added a comment - it needs dynamic ports to be supported by fg::node
} | ||
|
||
virtual fg::work_return_t | ||
work() override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... notably because this does not include tag handling and we should expose only the 'work()' function to the users on rare and very special cases.
} | ||
|
||
virtual void * | ||
raw() override { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed? the node_model has this definition as well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raw
exists in order for graph to be able to find nodes (a node doesn't know it is wrapped in something, when it wants to communicate with graph, the graph needs to be able to 'see through' the wrappers.
namespace fg = fair::graph; | ||
|
||
template<typename T> | ||
class multi_adder : public fg::node_model { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
derive it from node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node-model can still wrap the strict type.
49059fa
to
e8cba5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 !
The things that need to be tackled in later PR are documented.
e8cba5f
to
a93b391
Compare
pmtv doesn't like std::size_t on web assembly
a93b391
to
c82cc5a
Compare
No description provided.