Skip to content

GetParticipantName and GetRegistryUri#165

Open
KonradBreitsprecherBkd wants to merge 9 commits into
mainfrom
dev_participant_parameters
Open

GetParticipantName and GetRegistryUri#165
KonradBreitsprecherBkd wants to merge 9 commits into
mainfrom
dev_participant_parameters

Conversation

@KonradBreitsprecherBkd

@KonradBreitsprecherBkd KonradBreitsprecherBkd commented Jan 7, 2025

Copy link
Copy Markdown
Contributor

Add dedicated participant string getters

See https://github.com/vectorgrp/sil-kit-planning/issues/62

Summary

This change introduces two dedicated C-API functions:

  • SilKit_Participant_GetParticipantName(void* outParameterValue, size_t* inOutParameterValueSize, SilKit_Participant* participant)
  • SilKit_Participant_GetRegistryUri(void* outParameterValue, size_t* inOutParameterValueSize, SilKit_Participant* participant)

and their C++ equivalents in IParticipant

  • virtual auto GetParticipantName() const -> std::string = 0
  • virtual auto GetRegistryUri() const -> std::string = 0

In addition, string copy/size handling was centralized in the C-API layer and tests were updated/extended accordingly.
Further, the new API is used in the sil-kit-system-controller implementation to dynamically retrieve the participant name (set via command line and/or participant configuration). The name has to be added to the required participant names of the workflow configuration. Without the GetParticipantName functionality, passing a new name by config actually failed because there was no way to retrieve the name from the config programatically.

Motivation

The generic SilKit_Participant_GetParameter API in the first draft depended on an enum that looked like it could be expanded to non-string types but actually did not support this. The new design is more simple and exposes the only two relevant participant string parameters directly and clearly. Future parameter queries could be covered by more explicit getters or by retrieving the current participant configuration.

Further Notes

  • CapiParticipant.cpp | CopyStringToOutBuffer: string size query and nulltermination handling
  • ParameterProvider.hpp | QueryString(SilKit_Participant*, StringQueryFunction): Reusable helper to atomically obtain the string that might change between buffer allocation and query.
  • Unit and Integration tests are in place
  • Docs are still missing until API is stable

Comment thread SilKit/include/silkit/participant/IParticipant.hpp Outdated
Comment thread SilKit/include/silkit/capi/Participant.h Outdated
@KonradBreitsprecherBkd

This comment was marked as outdated.

Comment thread SilKit/include/silkit/detail/impl/participant/ParameterProvider.hpp
Comment thread SilKit/include/silkit/capi/Participant.h Outdated
@KonradBreitsprecherBkd KonradBreitsprecherBkd force-pushed the dev_participant_parameters branch 2 times, most recently from 34c3665 to a44c894 Compare September 15, 2025 13:06
Comment thread SilKit/include/silkit/participant/parameters.hpp Outdated
@KonradBreitsprecherBkd KonradBreitsprecherBkd force-pushed the dev_participant_parameters branch from a44c894 to bd6ae6a Compare June 19, 2026 09:57
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@KonradBreitsprecherBkd KonradBreitsprecherBkd force-pushed the dev_participant_parameters branch from bd6ae6a to 0dc19b1 Compare June 19, 2026 10:44
@KonradBreitsprecherBkd KonradBreitsprecherBkd changed the title Participant parameters GetParticipantName and GetRegistryUri Jun 19, 2026
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
@KonradBreitsprecherBkd KonradBreitsprecherBkd requested review from VDanielEdwards and snps-fiodorov and removed request for VDanielEdwards June 19, 2026 13:42
@KonradBreitsprecherBkd KonradBreitsprecherBkd marked this pull request as ready for review June 19, 2026 13:44
@KonradBreitsprecherBkd KonradBreitsprecherBkd added the needs reviewer This issue is looking for a reviewer. label Jun 19, 2026
Comment thread SilKit/include/silkit/capi/Participant.h Outdated
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Comment thread SilKit/include/silkit/detail/impl/participant/ParameterProvider.hpp Outdated
Comment thread SilKit/include/silkit/capi/Participant.h Outdated
Comment thread SilKit/source/capi/CapiParticipant.cpp Outdated
Comment thread SilKit/source/core/mock/participant/MockParticipant.hpp
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Design Proposal needs reviewer This issue is looking for a reviewer. New API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants