GetParticipantName and GetRegistryUri#165
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
34c3665 to
a44c894
Compare
a44c894 to
bd6ae6a
Compare
Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
bd6ae6a to
0dc19b1
Compare
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>
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>
|
i think we should consider this in a bigger context of providing somthing like service discovery. Not sure if we could add this to a SystemMonitor or some other new Service Entry point, e.g. something stably wrapping ServiceDiscovery. |
The underlying problem is more general: The user currently cannot retreive it's actual (final) participant configuration merged from API calls and a passed Yaml config. Aside from the name and uri, this problem exists for all arguments of The |
First, I like easy APIs for easy stuff, like this.
yes. but my point was, should we create a dedicated API to get the current values from a participant, like participant name, registry uri, simulation name? Moving away from the old design of not allowing introspection: |
Add dedicated participant string getters
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 = 0virtual auto GetRegistryUri() const -> std::string = 0In 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 namesof theworkflow 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_GetParameterAPI 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 handlingParameterProvider.hpp | QueryString(SilKit_Participant*, StringQueryFunction): Reusable helper to atomically obtain the string that might change between buffer allocation and query.