-
Notifications
You must be signed in to change notification settings - Fork 9
fix #514, call_data_callbacks after shared the data #548
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
base: main
Are you sure you want to change the base?
Conversation
benoitmartin88
left a comment
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.
Great feature to add. Thanks !
Not much is needed to merge this PR.
I think this feature would require a unit test. Could you add this?
656e28b to
3e1d45f
Compare
benoitmartin88
left a comment
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.
Almost ready to merge.
I do have a few questions that need answering concerning error handling, potentially superfluous functions and writing tests in C++.
f542e39 to
6806742
Compare
benoitmartin88
left a comment
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 think this is almost ready to merge.
Could you make sure the indent and spacing of the modified files is correct ?
Thanks !
Is it normal that the action indent doesn't catch that? |
Yushan-Wang
left a comment
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.
Ready to merge
|
@jbigot Could you review this PR please? |
jbigot
left a comment
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 is a great submission! My main comment is about moving Var_to_reclaim of the provider side instead of expecting each user to implement it. Overall this is really nice though!
|
What's the status for this one? |
It is ready to review. |
|
@Yushan-Wang , @benoitmartin88 , @JAuriac : I'd like a cross review first and then I'll do one. Who has time for one? |
|
Je regarde. |
|
|
||
| #include <pdi/pdi_fwd.h> | ||
| #include <pdi/callbacks.h> | ||
| //#include <pdi/delayed_data_callbacks.h> |
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.
remove commented-out lines
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 will be done in the next commit
benoitmartin88
left a comment
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.
Thank you for this contribution. There are a few changes that are required.
|
|
||
| #include <pdi/pdi_fwd.h> | ||
| #include <pdi/callbacks.h> | ||
| //#include <pdi/delayed_data_callbacks.h> |
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 is this commented ?
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 will be remove in the next commit
| class PDI_EXPORT Delayed_data_callbacks | ||
| { | ||
| /// friend class Global_context; | ||
| std::list<std::string> m_datanames; |
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.
You are iterating over all the elements of this data structure. It probably is better if this is a std::forward_list.
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 the logger message, I need the size of the list. In std::forward_list, we don't have access to the number of elements.
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.
If the size is only used for logger, we can do it differently e.g. nb_elemt = std::distance(m_datanames.begin(), m_datanames.end())
|
|
||
| struct PDI_NO_EXPORT Ref_holder; | ||
|
|
||
| public: |
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 public ?
| #include "pdi/callbacks.h" | ||
| #include "pdi/context.h" | ||
| #include "pdi/context_proxy.h" | ||
| //#include "pdi/delayed_data_callbacks.h" |
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.
remove
| /** A structure to reclaim the datas properly in case of error | ||
| */ | ||
| struct Var_to_reclaim { | ||
| std::list<string> m_varnames; |
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 think that a vector here makes more sense.
| std::list<string> m_varnames; | ||
| Var_to_reclaim() = default; | ||
|
|
||
| ~Var_to_reclaim() |
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.
| ~Var_to_reclaim() | |
| ~Var_to_reclaim() noexcept |
| PC_tree_t array_config{PC_parse_string("{ size: 10, type: array, subtype: int }")}; | ||
| shared_ptr<Array_datatype> array_datatype{Array_datatype::make(Scalar_datatype::make(Scalar_kind::SIGNED, sizeof(int)), 10)}; | ||
| PDI::Paraconf_wrapper fw; | ||
| //Global_context global_ctx{PC_parse_string("logging: trace")}; |
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.
remove
| class PDI_EXPORT Delayed_data_callbacks | ||
| { | ||
| /// friend class Global_context; | ||
| std::list<std::string> m_datanames; |
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.
If the size is only used for logger, we can do it differently e.g. nb_elemt = std::distance(m_datanames.begin(), m_datanames.end())
| Ref_w ref_write{ref}; | ||
| int* x = static_cast<int*>(ref_write.get()); | ||
| *x += 42; | ||
| std::cout << "name=" << name.c_str() << " == data_x" << std::endl; |
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.
remove stdcout and iostream
!!!INSERT YOUR DESCRIPTION HERE!!!
List of things to check before making a PR
Before merging your code, please check the following:
.clang-format;Fix #issuekeyword to autoclose the issue when merged.