-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactored port<T> interface #171
Conversation
Pull Request ReviewHey there! 👋 I've summarized the previous results for you. Here's a markdown document for your pull request review: Changes
SuggestionsIn
Bugs
ImprovementsA place in the code that could be refactored for better readability is in RatingThe code has been rated on a scale of 0 to 10 based on the following criteria:
That's it! Feel free to make any necessary changes and let me know if you need any further assistance. Good luck! 🚀 |
... as outlined by GR Architecture WG and #148 tackled items: * refactored port structure (mandatory enum NTTPs vs. optional type-wrapped arguments) * added optional domain argument * added default init value (needed for cyclic graphs) * add isOptional() annotation * fixed repeated_port name -> name0, name1, name2, ... * added 'Async' port annotation and 'isSynchronous()' function * renamed IN,OUT,... short-hand aliases to more explicit/hopefully descriptive PortIn, PortOut names * changed to Capitalised class naming following [C++ Core guidline item](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#example-389) and Bjarne Stroustrup [style naming](https://www.stroustrup.com/Programming/PPP-style.pdf) Signed-off-by: Ralph J. Steinhagen <r.steinhagen@gsi.de>
7e4bc58
to
960fd37
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.
Looks good and makes the port definitions nicer. Thanks also for taking care of updating the documentation 👍
constexpr int | ||
pow10(int n) noexcept { | ||
if (n == 0) return 1; | ||
return 10 * pow10(n - 1); |
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.
Should these math helper functions fall back to a non recursive implementation if they are evaluated at runtime? Or be consteval
or an assertion to prevent accidental runtime use?
more input ports, and zero, one or more output ports. Data is passed between blocks by connecting the output port of | ||
one block to the input port of another. For the specific implementation, see [port.hpp](port.hpp). | ||
* [buffer](#Buffer) is an area of memory where data is temporarily stored in the runtime-connected graph. Each port | ||
* [Port](#Ports) is an interface through which data flows into or out of a block. Each block may have zero, one or |
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.
I assume Port is capitalized because you refer to the actual type and not the general concept? I it is supposed to be code I would expect it to be surrounded by single ticks (Port
). Not super important but if we decide on one style there we can make the effort to keep it consistent everywhere.
-> to be squash-merged Signed-off-by: rstein <r.steinhagen@gsi.de>
SonarCloud Quality Gate failed. 0 Bugs 47.7% Coverage The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
... as outlined by GR Architecture WG and #148
tackled items:
0 -> 1
for the required min port samples in various tests & code examples (now ensured via astatic_assert(..)
)Some of the possible optional port annotation attributes are:
RequiredSamples<size_t, size_t>
to describe the min/max number of samples required from this port before invoking the blocks work function,Optional
informing the graph/scheduler that a given port does not require to be connected,PortDomain<fixed_string>
described whether the port can be handled within the same scheduling domain (e.g.CPU
orGPU
),StreamBufferType
andTagBufferType
to inject specific user-provided buffer implementations to the port, orAsync
for making a port asynchronous in a signal flow-graph block.Thanks for the in-person and on-line pre-comments and feedbacks by @ivan-cukic, @drslebedev, and @wirew0rm.
One of the follow-ups would be to implement the
Async
function in the node/block code.