Add EntityFactoryWithNs#595
Draft
C88-YQ wants to merge 4 commits into
Draft
Conversation
Signed-off-by: C88-YQ <1409947012@qq.com>
Signed-off-by: C88-YQ <1409947012@qq.com>
azeey
requested changes
Jun 11, 2026
| string name = 8; | ||
|
|
||
| /// \brief Optional new namespace for the entity, overrides the namespace on the SDF. | ||
| StringMsg ns = 9; |
Contributor
There was a problem hiding this comment.
Any reason for this to be StringMsg instead of string? Would setting it to an empty string not be sufficient? Or are you thinking of a usecase where the namespace in the model is replaced with "" (empty namespace)?
Author
There was a problem hiding this comment.
Yes, the main reason is to distinguish between not set and set to an empty string.
If the user does not provide a namespace, I want to keep the existing namespace and avoid applying any override. But if the user explicitly sets it to "", that should be treated as an override that clears the namespace. A plain string would not let us distinguish those two cases, since its default value is also "".
azeey
reviewed
Jun 11, 2026
Signed-off-by: C88-YQ <1409947012@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎉 New feature
Closes #
Summary
This PR adds two new message types for spawning entities with namespace support:
EntityFactoryWithNs: extends the existing entity factory pattern with an optionalnsfield usingStringMsg, allowing callers to specify or override the namespace when creating an entity.EntityFactoryWithNs_V: adds a repeated container message for sending multipleEntityFactoryWithNsrequests together.Backport Policy
Checklist
codecheckpassed (See contributing)