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

Merge branch 'dev-common-messaging' into 'master'

Generalize CommonMessaging, and use it to implement the messaging functionality ...

...in GaudiAlg/GaudiCommon

  CommonMessaging needs two methods to be available to implement its functionality:

        const std::string& name() const
        SmartIF<ServiceLocator>& serviceLocator() const

  As CommonMessaging is a mix-in class which uses the 'curiously recurring template'
  pattern, it can either demand that the 'Base' class it is 'mixed' into already
  provided this functionality, or it can add pure virtual methods to insure any
  derived class does so. As this depends on the template argument, one cannot
  a-priori decide which of the two solution is appropriate.

  To solve this problem in a generic way, this patch uses SFINAE to detect
  at compile time whether Base::name() and Base::serviceLocator() -- where
  Base is the template argument provided to CommonMessaging -- are valid
  expressions. If they are, no further action is taken. If not, the missing
  function(s) is (are) added as pure virtual. This is done by specialization
  of two template classes from which CommonMessaging inherits, prior to
  inheriting from Base.  Those specializations are either 'empty' classes,
  or add the missing interface requirement.

See merge request !19
parents a5106765 a3663495
No related branches found
No related tags found
No related merge requests found
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