core: use distinct names for JobControlRecordPrivate#1307
Merged
pstorz merged 2 commits intobareos:masterfrom Nov 9, 2022
Merged
core: use distinct names for JobControlRecordPrivate#1307pstorz merged 2 commits intobareos:masterfrom
pstorz merged 2 commits intobareos:masterfrom
Conversation
c3e3db0 to
e8c77bc
Compare
When we moved the daemon-specific functionality of the JobControlRecord into JobControlRecordPrivate, we essentially introduced three different types that were all named JobControlRecordPrivate - one for the Director, one for the Storage Daemon and one for the File Daemon. This could lead to ODR violations when you tried to link parts of the daemons together. In fact, that implementation already behaved like a union of the three different types (i.e. requiring per-implementation initialisation and teardown, undefined behaviour when accessing via the wrong type, etc.). This patch renames the daemon's individual JobControlRecordPrivate to DirectorJcrImpl, StoredJcrImpl and FiledJcrImpl. The impl-pointer was changed to a union of dir_impl, sd_impl and fd_impl. With this change applied you can now build programs that use two or more of the JCR types.
d3bb536 to
9fd878e
Compare
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.
When we moved the daemon-specific functionality of the
JobControlRecordintoJobControlRecordPrivate, we essentially introduced three different types that were all namedJobControlRecordPrivate- one for the Director, one for the Storage Daemon and one for the File Daemon. This could lead to ODR violations when you tried to link parts of the daemons together.In fact, that implementation already behaved like a union of the three different types (i.e. requiring per-implementation initialisation and teardown, undefined behaviour when accessing via the wrong type, etc.).
This patch renames the daemon's individual
JobControlRecordPrivatetoDirectorJcrImpl,StoredJcrImplandFiledJcrImpl. The implementation-pointer was changed to a union ofdir_impl,sd_implandfd_impl. With this change applied you can now build programs that use two or more of the JCR types.Thank you for contributing to the Bareos Project!
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
General
Source code quality
bareos-check-sources --since-mergedoes not report any problems