Skip to content
Snippets Groups Projects
Commit bad2bf34 authored by Charles Leggett's avatar Charles Leggett
Browse files

Add accessor to ServiceHandle to allow non const access to service, even from a const handle

See the discussion in !225

I am not completely sure what I think of this. I am not completely sold on the idea, but can see Services are different beasts to tools. 

I submit this for discussion and testing by Atlas( @leggett I've tested it in as far as Gaudi compiles but as in LHCb we have no use case that requires it, cannot go much future. It would be good if this MR could be tested against Atlas *before* merging this time ;))

See merge request !233
parents 5e45b18c 3b813d04
No related branches found
No related tags found
1 merge request!233Add accessor to ServiceHandle to allow non const access to service, even from a const handle
Pipeline #
......@@ -72,6 +72,12 @@ public:
// return GaudiHandle<T>::release();
// }
/// Allow non const access to the service, even from a const handle...
T * get() const { return this->nonConst( GaudiHandle<T>::get() ); }
/// Allow non const access to the service, even from a const handle...
T * operator->() const { return this->nonConst( GaudiHandle<T>::operator->() ); }
protected:
/** Do the real retrieval of the Service. */
StatusCode retrieve( T*& service ) const override {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment