Commit 7d714f91 authored by Gerhard Raven's avatar Gerhard Raven
Browse files

Add Property constructors which accept an updateHandler

The updatehandler can either be anything which satisfies
the `void(PropertyBase&)` signature, or a member function
with the signature `void()` or `void(PropertyBase&)`.
In addition, an additonal argument can be passed which specifies
whether or not the provided handel should be invoked immediately.
Default is to _not_ invoke it immediately.
parent 381a8f7c
......@@ -733,15 +733,6 @@ public:
/// get the list of aquired services
const Services& services() const { return m_services; } // get all services
// ==========================================================================
private:
// ==========================================================================
/// handler for "ErrorPrint" property
void printErrorHandler( Gaudi::Details::PropertyBase& /* theProp */ ); // "ErrorPrint"
/// handler for "PropertiesPrint" property
void printPropsHandler( Gaudi::Details::PropertyBase& /* theProp */ ); // "PropertiesPrint"
/// handler for "StatPrint" property
void printStatHandler( Gaudi::Details::PropertyBase& /* theProp */ ); // "StatPrint"
// ==========================================================================
public:
// ==========================================================================
/// Returns the "context" string. Used to identify different processing states.
......@@ -787,9 +778,32 @@ private:
mutable IUpdateManagerSvc* m_updMgrSvc = nullptr;
// ==========================================================================
// Properties
Gaudi::Property<bool> m_errorsPrint{this, "ErrorsPrint", true, "print the statistics of errors/warnings/exceptions"};
Gaudi::Property<bool> m_propsPrint{this, "PropertiesPrint", false, "print the properties of the component"};
Gaudi::Property<bool> m_statPrint{this, "StatPrint", true, "print the table of counters"};
Gaudi::Property<bool> m_errorsPrint{this, "ErrorsPrint", true,
[this]( auto& ) {
// no action if not yet initialized
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED &&
this->errorsPrint() ) {
this->printErrors();
}
},
"print the statistics of errors/warnings/exceptions"};
Gaudi::Property<bool> m_propsPrint{this, "PropertiesPrint", false,
[this]( auto& ) {
// no action if not yet initialized
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED &&
this->propsPrint() ) {
this->printProps( MSG::ALWAYS );
}
},
"print the properties of the component"};
Gaudi::Property<bool> m_statPrint{this, "StatPrint", true,
[this]( auto& ) {
// no action if not yet initialized
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED && this->statPrint() ) {
this->printStat( MSG::ALWAYS );
}
},
"print the table of counters"};
Gaudi::Property<bool> m_printEmptyCounters{this, "PrintEmptyCounters", false,
"force printing of empty counters, otherwise only printed in DEBUG mode"};
Gaudi::Property<bool> m_typePrint{this, "TypePrint", true, "add the actual C++ component type into the messages"};
......
......@@ -2694,13 +2694,14 @@ public: // trivial setters
inline void setHistoDir( const std::string& val ) { m_histoDir = val; }
// ==========================================================================
public:
// FIXME: due to a bug in gcc7, the following two cannot be replaced with
// using PBASE::PBASE...
// ==========================================================================
/// Algorithm constructor - the SFINAE constraint below ensures that this is
/// constructor is only defined if PBASE derives from GaudiAlgorithm
template <typename U = PBASE, typename = std::enable_if_t<std::is_base_of<GaudiAlgorithm, PBASE>::value, U>>
GaudiHistos( const std::string& name, ISvcLocator* pSvcLocator ) : PBASE( name, pSvcLocator )
{
initGaudiHistosConstructor();
}
// ==========================================================================
/// Tool constructor - SFINAE-ed to insure this constructor is only defined
......@@ -2709,7 +2710,6 @@ public:
GaudiHistos( const std::string& type, const std::string& name, const IInterface* parent )
: PBASE( type, name, parent )
{
initGaudiHistosConstructor();
}
// ==========================================================================
protected:
......@@ -2743,9 +2743,6 @@ private:
/// Check if all histogram maps are empty
bool noHistos() const;
// ===========================================unsigned===============================
/// Constructor initialisation and job options
void initGaudiHistosConstructor();
// ==========================================================================
/** @brief Declare a histogram to the monitor service
*
* Uses the histogram ID as the 'name' sent to the monitor service and
......@@ -2764,14 +2761,15 @@ protected:
/// Create an ID string from a title string
std::string convertTitleToID( std::string title ) const;
// ==========================================================================
private:
// ==========================================================================
/// the handler for "HistoPrint" property
void printHistoHandler( Gaudi::Details::PropertyBase& /* theProp */ ); // "HistoPrint"
// ==========================================================================
private:
Gaudi::Property<bool> m_produceHistos{this, "HistoProduce", true, "Switch on/off the production of histograms"};
Gaudi::Property<bool> m_histosPrint{this, "HistoPrint", false,
[this]( const auto& ) {
// no action if not yet initialized
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED &&
this->histosPrint() )
this->printHistos( MSG::ALWAYS );
},
"Switch on/off the printout of histograms at finalization"};
Gaudi::Property<bool> m_histoCountersPrint{this, "HistoCountersPrint", true,
"Switch on/off the printout of histogram counters at finalization"};
......
......@@ -73,14 +73,6 @@ namespace
}
}
}
// =============================================================================
// Constructor initialisation and job options
// =============================================================================
template <class PBASE>
void GaudiHistos<PBASE>::initGaudiHistosConstructor()
{
m_histosPrint.declareUpdateHandler( &GaudiHistos<PBASE>::printHistoHandler, this );
}
// ============================================================================
// Initialise Histogramming
// ============================================================================
......@@ -390,21 +382,6 @@ std::string GaudiHistos<PBASE>::convertTitleToID( std::string title ) const
}
return title;
}
// ============================================================================
// the handler for "HistoPrint" property
// ============================================================================
template <class PBASE>
void GaudiHistos<PBASE>::printHistoHandler( Gaudi::Details::PropertyBase& )
{
// no action if not yet initialized
if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
return;
}
if ( this->histosPrint() ) {
this->printHistos( MSG::ALWAYS );
}
}
// ============================================================================
// get the constructed histogram path
// ============================================================================
template <class PBASE>
......
......@@ -27,7 +27,7 @@ class GAUDI_API GaudiSequencer : public GaudiAlgorithm
{
public:
/// Standard constructor
GaudiSequencer( const std::string& name, ISvcLocator* pSvcLocator );
using GaudiAlgorithm::GaudiAlgorithm;
StatusCode initialize() override; ///< Algorithm initialization
StatusCode execute() override; ///< Algorithm execution
......@@ -61,17 +61,18 @@ private:
StatusCode decodeNames();
/** for asynchronous changes in the list of algorithms */
void membershipHandler( Gaudi::Details::PropertyBase& theProp );
void membershipHandler();
/** copy/assignment not allowed **/
GaudiSequencer( const GaudiSequencer& a ) = delete;
GaudiSequencer& operator=( const GaudiSequencer& a ) = delete;
Gaudi::Property<std::vector<std::string>> m_names = {this, "Members", {}, "list of algorithms"};
Gaudi::Property<bool> m_sequential = {this, "Sequential", false, "execute members one at a time"};
Gaudi::Property<bool> m_modeOR = {this, "ModeOR", false, "use OR logic instead of AND"};
Gaudi::Property<bool> m_ignoreFilter = {this, "IgnoreFilterPassed", false, "always continue"};
Gaudi::Property<bool> m_measureTime = {this, "MeasureTime", false, "measure time"};
Gaudi::Property<std::vector<std::string>> m_names = {
this, "Members", {}, &GaudiSequencer::membershipHandler, "list of algorithms"};
Gaudi::Property<bool> m_sequential = {this, "Sequential", false, "execute members one at a time"};
Gaudi::Property<bool> m_modeOR = {this, "ModeOR", false, "use OR logic instead of AND"};
Gaudi::Property<bool> m_ignoreFilter = {this, "IgnoreFilterPassed", false, "always continue"};
Gaudi::Property<bool> m_measureTime = {this, "MeasureTime", false, "measure time"};
Gaudi::Property<bool> m_returnOK = {this, "ReturnOK", false, "forces the sequencer to return a good status"};
Gaudi::Property<bool> m_shortCircuit = {this, "ShortCircuit", true, "stop processing as soon as possible"};
Gaudi::Property<bool> m_invert = {this, "Invert", false, "invert the logic result of the sequencer"};
......
......@@ -277,7 +277,6 @@ public:
template <typename U = PBASE, typename = std::enable_if_t<std::is_base_of<GaudiHistoAlg, PBASE>::value, U>>
GaudiTuples( const std::string& name, ISvcLocator* pSvcLocator ) : PBASE( name, pSvcLocator )
{
initGaudiTuplesConstructor();
}
/// Tool constructor - SFINAE-ed to insure this constructor is only defined
/// if PBASE derives from AlgTool.
......@@ -285,7 +284,6 @@ public:
GaudiTuples( const std::string& type, const std::string& name, const IInterface* parent )
: PBASE( type, name, parent )
{
initGaudiTuplesConstructor();
}
// ==========================================================================
protected:
......@@ -313,26 +311,17 @@ protected:
#endif
;
// ==========================================================================
private:
// ==========================================================================
/// Constructor initialization and job options
inline void initGaudiTuplesConstructor()
{
m_tuplesPrint.declareUpdateHandler( &GaudiTuples<PBASE>::printNTupleHandler, this );
m_evtColsPrint.declareUpdateHandler( &GaudiTuples<PBASE>::printEvtColHandler, this );
}
// ==========================================================================
private:
// ==========================================================================
/// handler for "NTuplePrint" property
void printNTupleHandler( Gaudi::Details::PropertyBase& /* theProp */ ); // "NTuplePrint"
/// handler for "EvtColsPrint" property
void printEvtColHandler( Gaudi::Details::PropertyBase& /* theProp */ ); // "EvtcolsPrint"
// ==========================================================================
private:
// ==========================================================================
Gaudi::Property<bool> m_produceNTuples{this, "NTupleProduce", true, "general switch to enable/disable N-tuples"};
Gaudi::Property<bool> m_tuplesPrint{this, "NTuplePrint", true, "print N-tuple statistics"};
Gaudi::Property<bool> m_tuplesPrint{this, "NTuplePrint", true,
[this]( auto& ) {
// no action if not yet initialized
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED &&
this->tuplesPrint() )
this->printTuples();
},
"print N-tuple statistics"};
Gaudi::Property<bool> m_splitNTupleDir{this, "NTupleSplitDir", false,
"split long directory names into short pieces (suitable for HBOOK)"};
Gaudi::Property<TupleID::NumericID> m_nTupleOffSet{this, "NTupleOffSet", 0, "offset for numerical N-tuple ID"};
......@@ -343,7 +332,14 @@ private:
Gaudi::Property<bool> m_produceEvtCols{this, "EvtColsProduce", false,
"general switch to enable/disable Event Tag Collections"};
Gaudi::Property<bool> m_evtColsPrint{this, "EvtColsPrint", false, "print statistics for Event Tag Collections "};
Gaudi::Property<bool> m_evtColsPrint{this, "EvtColsPrint", false,
[this]( auto& ) {
// no action if not yet initialized
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED &&
this->evtColsPrint() )
this->printEvtCols();
},
"print statistics for Event Tag Collections "};
Gaudi::Property<bool> m_splitEvtColDir{this, "EvtColSplitDir", false, "split long directory names into short pieces"};
Gaudi::Property<TupleID::NumericID> m_evtColOffSet{this, "EvtColOffSet", 0, "offset for numerical N-tuple ID"};
Gaudi::Property<std::string> m_evtColLUN{this, "EvtColLUN", "EVTCOL", "Logical File Unit for Event Tag Collections"};
......
......@@ -368,26 +368,6 @@ bool GaudiTuples<PBASE>::evtColExists( const TupleID& ID ) const
return m.find( ID ) != m.end();
}
// ============================================================================
// Handle method for changes in the 'NTuplePrint' property
// ============================================================================
template <class PBASE>
void GaudiTuples<PBASE>::printNTupleHandler( Gaudi::Details::PropertyBase& )
{
// no action if not yet initialized
if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) return;
if ( this->tuplesPrint() ) this->printTuples();
}
// ============================================================================
// Handle method for changes in the 'EvtColsPrint' property
// ============================================================================
template <class PBASE>
void GaudiTuples<PBASE>::printEvtColHandler( Gaudi::Details::PropertyBase& )
{
// no action if not yet initialized
if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) return;
if ( this->evtColsPrint() ) this->printEvtCols();
}
// ============================================================================
// get the constructed N-Tuple path
// ============================================================================
template <class PBASE>
......
......@@ -32,8 +32,26 @@ namespace Gaudi
MergingTransformer( const std::string& name, ISvcLocator* locator, const KeyValues& inputs,
const KeyValue& output );
// accessor to input Locations
const std::string& inputLocation( unsigned int n ) const { return m_inputLocations.value()[n]; }
unsigned int inputLocationSize() const { return m_inputLocations.value().size(); }
// derived classes can NOT implement execute
StatusCode execute() override final;
StatusCode execute() override final
{
vector_of_const_<In> ins;
ins.reserve( m_inputs.size() );
std::transform( m_inputs.begin(), m_inputs.end(), std::back_inserter( ins ),
details::details2::get_from_handle<In>{} );
try {
using details::as_const;
details::put( std::get<0>( this->m_outputs ), as_const( *this )( as_const( ins ) ) );
} catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
return e.code();
}
return StatusCode::SUCCESS;
}
virtual Out operator()( const vector_of_const_<In>& inputs ) const = 0;
......@@ -41,8 +59,10 @@ namespace Gaudi
// if In is a pointer, it signals optional (as opposed to mandatory) input
template <typename T>
using InputHandle_t = details::InputHandle_t<Traits_, typename std::remove_pointer<T>::type>;
std::vector<std::string> m_inputLocations; // TODO/FIXME: remove this duplication...
std::vector<InputHandle_t<In>> m_inputs; // and make the handles properties instead...
std::vector<InputHandle_t<In>> m_inputs; // and make the handles properties instead...
Gaudi::Property<std::vector<std::string>> m_inputLocations; // TODO/FIXME: remove this duplication...
// TODO/FIXME: replace vector of string property + call-back with a
// vector<handle> property ... as soon as declareProperty can deal with that.
};
template <typename Out, typename In, typename Traits_>
......@@ -50,36 +70,20 @@ namespace Gaudi
ISvcLocator* pSvcLocator,
const KeyValues& inputs,
const KeyValue& output )
: base_class( name, pSvcLocator, output ), m_inputLocations( inputs.second )
: base_class( name, pSvcLocator, output )
, m_inputLocations{this, inputs.first, inputs.second,
[=]( Gaudi::Details::PropertyBase& ) {
this->m_inputs =
details::make_vector_of_handles<decltype( this->m_inputs )>( this, m_inputLocations );
if ( std::is_pointer<In>::value ) { // handle constructor does not (yet) allow to set
// optional flag... so do it
// explicitly here...
std::for_each( this->m_inputs.begin(), this->m_inputs.end(),
[]( auto& h ) { h.setOptional( true ); } );
}
},
Gaudi::Details::Property::ImmediatelyInvokeHandler{true}}
{
// TODO/FIXME: replace vector of string property + call-back with a
// vector<handle> property ... as soon as declareProperty can deal with that.
auto p = this->declareProperty( inputs.first, m_inputLocations );
p->declareUpdateHandler( [=]( Gaudi::Details::PropertyBase& ) {
this->m_inputs = details::make_vector_of_handles<decltype( this->m_inputs )>( this, m_inputLocations );
if ( std::is_pointer<In>::value ) { // handle constructor does not (yet) allow to set optional flag... so do it
// explicitly here...
std::for_each( this->m_inputs.begin(), this->m_inputs.end(), []( auto& h ) { h.setOptional( true ); } );
}
} );
p->useUpdateHandler(); // invoke call-back now, to be sure the input handles are synced with the property...
}
template <typename Out, typename In, typename Traits_>
StatusCode MergingTransformer<Out( const vector_of_const_<In>& ), Traits_>::execute()
{
vector_of_const_<In> ins;
ins.reserve( m_inputs.size() );
std::transform( m_inputs.begin(), m_inputs.end(), std::back_inserter( ins ),
details::details2::get_from_handle<In>{} );
try {
using details::as_const;
details::put( std::get<0>( this->m_outputs ), as_const( *this )( as_const( ins ) ) );
} catch ( GaudiException& e ) {
( e.code() ? this->warning() : this->error() ) << e.message() << endmsg;
return e.code();
}
return StatusCode::SUCCESS;
}
}
}
......
......@@ -26,10 +26,7 @@ public:
/**
** Constructor(s)
**/
Sequencer( const std::string& name, // The path object's name
ISvcLocator* svcloc // A pointer to a service location service
);
using Algorithm::Algorithm;
/*****************************
** Public Function Members **
*****************************/
......@@ -214,8 +211,22 @@ private:
** Private Data Members **
**************************/
Gaudi::Property<std::vector<std::string>> m_names{this, "Members", {}, "member names"};
Gaudi::Property<std::vector<std::string>> m_branchNames{this, "BranchMembers", {}, "branch member names"};
Gaudi::Property<std::vector<std::string>> m_names{this,
"Members",
{},
[this]( auto& ) {
if ( this->isInitialized() ) this->decodeMemberNames().ignore();
},
"member names"};
Gaudi::Property<std::vector<std::string>> m_branchNames{this,
"BranchMembers",
{},
[this]( auto& ) {
if ( this->isInitialized() )
this->decodeBranchMemberNames().ignore();
},
"branch member names"};
Gaudi::Property<bool> m_stopOverride{this, "StopOverride", false, "stop on filter failure override"};
std::vector<bool> m_isInverted; // Member logic inverted list
......
......@@ -45,8 +45,8 @@ namespace Gaudi
}
// accessor to output Locations
const std::string& outputLocation( unsigned int n ) const { return m_outputLocations[n]; }
unsigned int outputLocationSize() const { return m_outputLocations.size(); }
const std::string& outputLocation( unsigned int n ) const { return m_outputLocations.value()[n]; }
unsigned int outputLocationSize() const { return m_outputLocations.value().size(); }
// derived classes can NOT implement execute
StatusCode execute() override final
......@@ -76,25 +76,29 @@ namespace Gaudi
private:
template <typename T>
using OutputHandle = details::OutputHandle_t<Traits_, details::remove_optional_t<T>>;
std::vector<std::string> m_outputLocations; // TODO/FIXME for now: use a call-back to update the actual handles!
std::vector<OutputHandle<Out>> m_outputs;
std::vector<OutputHandle<Out>> m_outputs;
Gaudi::Property<std::vector<std::string>> m_outputLocations; // TODO/FIXME for now: use a call-back to update the
// actual handles!
};
template <typename Out, typename... In, typename Traits_>
SplittingTransformer<vector_of_<Out>( const In&... ), Traits_>::SplittingTransformer(
const std::string& name, ISvcLocator* pSvcLocator, const std::array<KeyValue, N>& inputs,
const KeyValues& outputs )
: base_class( name, pSvcLocator, inputs ), m_outputLocations( outputs.second )
: base_class( name, pSvcLocator, inputs )
, m_outputLocations( this, outputs.first, outputs.second,
[=]( Gaudi::Details::PropertyBase& ) {
this->m_outputs = details::make_vector_of_handles<decltype( this->m_outputs )>(
this, m_outputLocations );
if ( details::is_optional<Out>::value ) { // handle constructor does not (yet) allow to
// set optional flag... so
// do it explicitly here...
std::for_each( this->m_outputs.begin(), this->m_outputs.end(),
[]( auto& h ) { h.setOptional( true ); } );
}
},
Gaudi::Details::Property::ImmediatelyInvokeHandler{true} )
{
auto p = this->declareProperty( outputs.first, m_outputLocations );
p->declareUpdateHandler( [=]( Gaudi::Details::PropertyBase& ) {
this->m_outputs = details::make_vector_of_handles<decltype( this->m_outputs )>( this, m_outputLocations );
if ( details::is_optional<Out>::value ) { // handle constructor does not (yet) allow to set optional flag... so
// do it explicitly here...
std::for_each( this->m_outputs.begin(), this->m_outputs.end(), []( auto& h ) { h.setOptional( true ); } );
}
} );
p->useUpdateHandler(); // invoke now, to be sure the input handles are synced with the property...
}
}
}
......
......@@ -64,10 +64,6 @@
template <class PBASE>
void GaudiCommon<PBASE>::initGaudiCommonConstructor( const IInterface* parent )
{
m_errorsPrint.declareUpdateHandler( &GaudiCommon<PBASE>::printErrorHandler, this );
m_propsPrint.declareUpdateHandler( &GaudiCommon<PBASE>::printPropsHandler, this );
m_statPrint.declareUpdateHandler( &GaudiCommon<PBASE>::printStatHandler, this );
// setup context from parent if available
if ( parent ) {
if ( const GaudiAlgorithm* gAlg = dynamic_cast<const GaudiAlgorithm*>( parent ) ) {
......@@ -631,50 +627,6 @@ DataObject* GaudiCommon<PBASE>::put( IDataProviderSvc* svc, std::unique_ptr<Data
}
// ============================================================================
// ============================================================================
// Handle method for changes in the 'ErrorsPrint'
// ============================================================================
template <class PBASE>
void GaudiCommon<PBASE>::printErrorHandler( Gaudi::Details::PropertyBase& /* theProp */ )
{
// no action if not yet initialized
if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
return;
}
if ( this->errorsPrint() ) {
this->printErrors();
}
}
// ============================================================================
// Handle method for changes in the 'PropertiesPrint'
// ============================================================================
template <class PBASE>
void GaudiCommon<PBASE>::printPropsHandler( Gaudi::Details::PropertyBase& /* theProp */ )
{
// no action if not yet initialized
if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
return;
}
if ( this->propsPrint() ) {
this->printProps( MSG::ALWAYS );
}
}
// ============================================================================
// Handle method for changes in the 'StatPrint'
// ============================================================================
template <class PBASE>
void GaudiCommon<PBASE>::printStatHandler( Gaudi::Details::PropertyBase& /* theProp */ )
{
// no action if not yet initialized
if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
return;
}
if ( this->statPrint() ) {
this->printStat( MSG::ALWAYS );
}
}
// ============================================================================
// ============================================================================
// The END
// ============================================================================
......@@ -70,14 +70,6 @@ namespace
// 2004-05-13 : Olivier Callot
//-----------------------------------------------------------------------------
//=============================================================================
// Standard constructor, initializes variables
//=============================================================================
GaudiSequencer::GaudiSequencer( const std::string& name, ISvcLocator* pSvcLocator )
: GaudiAlgorithm( name, pSvcLocator )
{
m_names.declareUpdateHandler( &GaudiSequencer::membershipHandler, this );
}
//=============================================================================
// Initialisation. Check parameters
//=============================================================================
......@@ -276,7 +268,7 @@ StatusCode GaudiSequencer::decodeNames()
//=========================================================================
// Interface for the Property manager
//=========================================================================
void GaudiSequencer::membershipHandler( Gaudi::Details::PropertyBase& /* p */ )
void GaudiSequencer::membershipHandler()
{
// no action for not-yet initialized sequencer
if ( Gaudi::StateMachine::INITIALIZED > FSMState() ) return; // RETURN
......
......@@ -14,20 +14,6 @@
#define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
#define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) )
/**
** Constructor(s)
**/
Sequencer::Sequencer( const std::string& name, ISvcLocator* pSvcLocator ) : Algorithm( name, pSvcLocator )
{
// Associate action handlers with the "Members" and "BranchMembers" properties
m_names.declareUpdateHandler( [this]( Gaudi::Details::PropertyBase& ) {
if ( isInitialized() ) decodeMemberNames().ignore();
} );
m_branchNames.declareUpdateHandler( [this]( Gaudi::Details::PropertyBase& ) {
if ( isInitialized() ) decodeBranchMemberNames().ignore();
} );
}
StatusCode Sequencer::initialize()
{
StatusCode result = StatusCode::SUCCESS;
......
#include "CommonAuditor.h"
#include "GaudiKernel/GaudiException.h"
CommonAuditor::CommonAuditor( const std::string& name, ISvcLocator* svcloc ) : Auditor( name, svcloc )
{
auto deprecated_property = [this]( Gaudi::Details::PropertyBase& p ) {
if ( m_customTypes.size() > 0 ) {
if ( m_types.size() > 0 ) {
error() << p.name() << " is deprecated, but both " << m_customTypes.name() << " and " << m_types.name()
<< " used." << endmsg;
throw GaudiException( "Property CustomEventTypes is deprecated, but both CustomEventTypes and EventTypes used",
this->name(), StatusCode::FAILURE );
} else {
warning() << p.name() << " " << p.documentation() << endmsg;
m_types = m_customTypes;
}
}
};
m_customTypes.declareUpdateHandler( deprecated_property );
}
void CommonAuditor::before( StandardEventType evt, INamedInterface* caller )
{
if ( caller ) before( toStr( evt ), caller->name() );
......