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

Use _choice suffix consistently in Protobuf #534

Merged
merged 62 commits into from
Oct 28, 2024

Conversation

TomGneuss
Copy link
Contributor

@TomGneuss TomGneuss commented Oct 28, 2024

In #531 the _choice suffix has been introduced for concrete types with concrete classes as subtypes. Since Protobuf does not support inheritance, this was necessary so that we can distinguish between the concrete class and a choice (union) class with quasi-polymorphism. For the sake of consistency, this suffix shall be used for all types that have concrete descendants, i.e. for all the choice (union) classes, including the abstract classes.

Tom Gneuß and others added 30 commits April 4, 2024 08:20
Remove blank
g1zzm0 and others added 20 commits April 22, 2024 17:11
Remove empty lines and blanks
… gh-protobuf

# Conflicts:
#	aas_core_codegen/protobuf/structure/_generate.py
The enum MessageType is unnecessary when generating ProtoBuf files.
Its intended use for identifying the concrete message in a "oneof"
is carried out by the protoc compiler when generating code.
# Conflicts:
#	aas_core_codegen/protobuf/structure/_generate.py
Add suffix "_choice" to all abstract or concrete types with >0 concrete
subtypes
the comment regarding the _choice suffix in generate_type() has been
updated
@TomGneuss TomGneuss closed this Oct 28, 2024
@TomGneuss TomGneuss reopened this Oct 28, 2024
@TomGneuss
Copy link
Contributor Author

Apparently, commits from an old PR of mine are still included. Sorry for the mess. Only the latest 2 commits are relevant to this PR. Refer to the list of changed files to confirm this.

Tom Gneuß added 2 commits October 28, 2024 13:43
Adjust expected output of ProtoBuf generator to match the current
version of aas-core-meta v3
@mristin mristin changed the title Consistent use of _choice suffix Use _choice suffix consistently in Protobuf Oct 28, 2024
Copy link
Contributor

@mristin mristin left a comment

Choose a reason for hiding this comment

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

LGTM! I made minor cosmetic changes.

aas_core_codegen/protobuf/common.py Outdated Show resolved Hide resolved
@mristin mristin merged commit 39a2259 into aas-core-works:main Oct 28, 2024
5 checks passed
@mristin
Copy link
Contributor

mristin commented Oct 28, 2024

Thanks, @TomGneuss !

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