-
Notifications
You must be signed in to change notification settings - Fork 22
Making IGeoSvc::getDetector and constantAsString const. #88
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
base: main
Are you sure you want to change the base?
Conversation
We want to make the methods of IGeoSvc const, for thread-safety and general cleanliness. Here, we add change GeoSvc::getDetector and constantAsString to be const. However, for now (until the interface class is changed) we also retain the non-const overloads. Also prepare for IGeoSvc::getDetector returning a const pointer.
I would prefer to deprecate the current and adding the const version at the same time, then we should find in the stack if there is code that won't compile without the existing functions. Otherwise the functions that are added in this PR are never going to be used, since |
I'd rather not have other people seeing warnings from what i'm doing. This change is actually step one of three to allow this update That was the best i could come up with to get around the lack of any way |
But we can not simply change it in the interface (your step 3) - it is being used by many packages that we may have to change before removing the non-const functions. In addition we don't know if there is anyone with a repository using the non-const ones, then failing to compile (and possibly wasting our and their time by asking what's going on) is much worse than getting some deprecation warnings with instructions. Then step 1 would be to add them to the interface with warnings for the other ones and step 2 is changing in all possible repositories. Old and new can coexist and CI builds don't care about deprecation warnings. This is how we typically do it, see, for example, key4hep/EDM4hep#315. |
hi - One can of course change the interfaace itself in several steps, first And deprecation warnings don't really help for the derived classes implementing And for the case of just making a method const, adding deprecation warnings
to
then any exiting clients that called The harder case is the other method here, were the return type also changes, eg from
to
Here, if one does
then one does to change the call. But i've only seen one instance of this;
which will compile fine with both the const and non-const version; adding Regardless, that would be for when the interface class gets changed.
But if we change the interface class before changing the derived class
Wouldn't that just result in people ignoring/not noticing the deprecations? |
We want to make the methods of IGeoSvc const, for thread-safety and general cleanliness.
Here, we add change GeoSvc::getDetector and constantAsString to be const. However, for now (until the interface class is changed) we also retain the non-const overloads.
Also prepare for IGeoSvc::getDetector returning a const pointer.
BEGINRELEASENOTES
ENDRELEASENOTES