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

change return type of Property::declare{Read,Update}Handler from void to Property&,

The reason is that this way one can write code like this:
```C++
  declareProperty("trackMaxChi2", m_trackMaxChi2 = 25.)
    ->declareUpdateHandler( [this](Property&){ this->m_trackChi = std::sqrt(this->m_trackMaxChi2); } )
    .useUpdateHandler();
```
this keeps m_trackChi in sync with m_trackMaxChi2. Without the call
to useUpdateHandler, if there is no entry in the JobOptionsSvc,
m_trackChi would not be set, and one would have to duplicate the
code to 'derive' m_trackChi from m_trackMaxChi2 just to initialize
it to the proper default.

Fixes GAUDI-1160.

See merge request !85
parents cd47f7e4 7314e810
No related branches found
No related tags found
Loading
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