Skip to content
Snippets Groups Projects
Commit 35dd00c0 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Merge branch 'dev-smartif-use' into 'master'

Provide (and use) C++11 smart pointer 'look and feel' for SmartIF

The aim of this branch is to confine, for everything that inherits from IInterface,
the calls to addRef(), release() and queryInterface() to the SmartIF implementation.
Exceptions are a few places where interfaces (currently) return bare pointers (instead of
SmartIF...) and where one thus has to addRef() explicitly to avoid returning a dangling
pointer. This can be avoided by changing the relevant interface to return a SmartIF
instead of a bare pointer.

In addition, make SmartIF 'look and feel' like a smart pointer.

- use explict bool conversion instead of .isValid()
- add SmartIF::as<IFace>(), to return a SmartIF<IFace> to an alternate
    interface -- which (together with move) encourages the use of auto
- add ISvcLocator::as<IFace>(), to return a SmartIF<IFace> to the current ISvcLocator.
- add ServiceManager::service<IFace>() which return SmartIF<IFace> which encourages
    the use of auto

And add a few other C++11 modernizations (eg. prefer STL over raw loop)

Fixes GAUDI-1094

See merge request !24
parents 73ba6dc1 f5c9345f
No related branches found
No related tags found
Loading
Showing
with 146 additions and 245 deletions
Loading
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