-
Notifications
You must be signed in to change notification settings - Fork 179
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
[python] python api fixed to work again based on new c++/c core api #1439
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.
clang-tidy made some suggestions
* | ||
* @return Handle of the created publisher or NULL if failed. | ||
**/ | ||
ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_); | ||
ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); |
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.
warning: parameter 'topic_desc_length_' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); | |
ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, int topic_desc_length_); |
* | ||
* @return Handle of the created subscriber or NULL if failed. | ||
**/ | ||
ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_); | ||
ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); |
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.
warning: parameter 'topic_desc_length_' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]
ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); | |
ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, int topic_desc_length_); |
char* topic_type = nullptr; | ||
char* topic_enc = nullptr; | ||
char* topic_desc = nullptr; | ||
Py_ssize_t topic_desc_len = 0; |
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.
warning: variable 'topic_desc_len' is not initialized [cppcoreguidelines-init-variables]
Py_ssize_t topic_desc_len = 0; | |
Py_ssize_t topic_desc_len = 0 = 0; |
char* topic_type = nullptr; | ||
char* topic_enc = nullptr; | ||
char* topic_desc = nullptr; | ||
Py_ssize_t topic_desc_len = 0; |
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.
warning: variable 'topic_desc_len' is not initialized [cppcoreguidelines-init-variables]
Py_ssize_t topic_desc_len = 0; | |
Py_ssize_t topic_desc_len = 0 = 0; |
return nullptr; | ||
|
||
ECAL_HANDLE sub{ nullptr }; | ||
Py_BEGIN_ALLOW_THREADS | ||
sub = sub_create(topic_name, topic_type); | ||
sub = sub_create(topic_name, topic_type, topic_enc, topic_desc, (int)topic_desc_len); |
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.
warning: variable 'sub' is not initialized [cppcoreguidelines-init-variables]
sub = sub_create(topic_name, topic_type, topic_enc, topic_desc, (int)topic_desc_len); | |
sub = 0 = sub_create(topic_name, topic_type, topic_enc, topic_desc, (int)topic_desc_len); |
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.
👍
Description
The new c++ core api is missing a few functions (set/get_qos, set_layer, set_type_name, set_description ..) and has some new functionalies like separated encoding and type naming.
This PR is fixing the python wrapper that way, that all samples are working again almost without any changes (two samples latency_rec/rec_cb needed small adaptions because of different (now correct) behavior of ecal_ok()).
Cherry-pick to