Skip to content
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

Replace parhand with axparameter #78

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Replace parhand with axparameter #78

merged 1 commit into from
Aug 27, 2024

Conversation

madelen-at-work
Copy link
Contributor

Describe your changes

Since axparameter is now included in the SDK let's use it instead of parhand.

Issue ticket number and link

  • Fixes issue where the parameter API could not be used when running the containerized version of acap-runtime

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have verified that my code follows the style already available in the repository
  • I have made corresponding changes to the documentation

@madelen-at-work madelen-at-work requested review from a team as code owners August 7, 2024 09:05
}
ax_parameter_free(ax_parameter);
g_clear_error(&error);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are errors more than once from ax_parameter_get, this will only deallocate the last one.

ax_parameter_get() will only set an error when it returns false, so put g_clear_error() inside the if-block instead. No need for it here.

@madelen-at-work madelen-at-work changed the base branch from main to dockerfile-cleanup August 15, 2024 11:40
@Corallo
Copy link
Contributor

Corallo commented Aug 15, 2024

tested, +1

Status Parameter::GetValues(ServerContext* context,
ServerReaderWriter<Response, Request>* stream) {
// Initialize Parameter Service
bool Parameter::Init(const bool verbose)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comments in https://github.com/AxisCommunications/acap-runtime/pull/80/files about constructor instead of two-phase initialization.

@madelen-at-work madelen-at-work force-pushed the parameter-api branch 2 times, most recently from 081c963 to 1fb55df Compare August 19, 2024 09:23
@madelen-at-work madelen-at-work changed the base branch from dockerfile-cleanup to clang-format August 19, 2024 09:23
@madelen-at-work madelen-at-work force-pushed the clang-format branch 2 times, most recently from 67c905d to 39de532 Compare August 19, 2024 14:45
Base automatically changed from clang-format to main August 20, 2024 10:33
@@ -35,6 +36,8 @@ class Parameter final : public KeyValueStore::Service {
private:
Status GetValues(ServerContext* context, ServerReaderWriter<Response, Request>* stream);

AXParameter* ax_parameter;
GError* _error;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for this to be a class member. It can be a local variable in each function it is used.

@madelen-at-work madelen-at-work merged commit 3bc0ae4 into main Aug 27, 2024
14 checks passed
@madelen-at-work madelen-at-work deleted the parameter-api branch August 27, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants