Conversation
c059463 to
31647b0
Compare
src/parameter.cpp
Outdated
|
|
||
| char parhand_result[BUFSIZ]; | ||
| // Initialize Parameter Service | ||
| bool Parameter::Init(const bool verbose) |
There was a problem hiding this comment.
If Parameter::Init was instead the class constructor, throwing runtime_error on failure, there wouldn't be a need to check ax_parameter == NULL before assignment and it wouldn't have to be checked at destruction. But maybe it's not worth the effort.
src/parameter.cpp
Outdated
| } | ||
| Status Parameter::GetValues(ServerContext *context, const Request *request, Response *response) | ||
| { | ||
| if (ax_parameter == NULL) |
There was a problem hiding this comment.
Maybe it actually is worth the effort, because by initializing ax_parameter in the constructor, it is guaranteed to be always initialized.
There was a problem hiding this comment.
I'm not sure it is - this API has so far followed the same 'pattern' as the two other (i.e. using Init instead of a constructor). I don't see any real benefit in refactoring this API only.
src/parameter.cpp
Outdated
| { | ||
| ERRORLOG << "Error when getting axparameter: " << _error->message << endl; | ||
| parameter_value = g_strdup(""); | ||
| g_clear_error(&_error); |
There was a problem hiding this comment.
Why doesn't this lead to returning an error code?
There was a problem hiding this comment.
This is inline with how the API works now - as long as the format of the key is correct it will return an empty value and gRPC Status::OK
test/parameter_test.cc
Outdated
| struct tm *nTime = localtime(&now); | ||
| int nowTime = nTime->tm_hour; | ||
| if (nowTime != logTime) | ||
| namespace parameter_test |
There was a problem hiding this comment.
Starting with C++17, you can write this as namespace acap_runtime::parameter_test
081c963 to
1fb55df
Compare
6f3bff0 to
176de0c
Compare
1fb55df to
9aed79c
Compare
176de0c to
cf52744
Compare
5ab3e6e to
e69d6cd
Compare
cf52744 to
a61cf72
Compare
e69d6cd to
041fcdd
Compare
a61cf72 to
245c241
Compare
245c241 to
7bcc7f3
Compare
Describe your changes
To align with usage (i.e the Parameter API example, we change the implementation of the Parameter API to synchronous gRPC communication.
Checklist before requesting a review