28 std::unique_ptr<Gaudi::IAuditor> aud{
48 auto it = std::find_if(
51 return it != std::end(
m_pAudList ) ? it->get() :
nullptr;
70 auto it = std::find_if(
74 auto sc = ( *it )->sysFinalize();
75 if ( sc.isFailure() ) {
error() <<
"Finalization of auditor " <<
name <<
" failed : " << sc <<
endmsg; }
84 auto pastEnd = std::remove_if( begin(
m_pAudList ), end(
m_pAudList ), [
this](
auto& entry ) ->
bool {
87 std::for_each( pastEnd,
m_pAudList.end(), [
this](
auto& entry ) {
88 if ( entry->isEnabled() ) {
89 auto sc = entry->sysFinalize();
90 if ( sc.isFailure() ) { error() <<
"Finalization of auditor " << entry->name() <<
" failed : " << sc << endmsg; }
93 m_pAudList.erase( pastEnd, m_pAudList.end() );
96 for (
auto& it : m_audNameList ) {
104 if ( it->isEnabled() ) it->sysFinalize().ignore();
113 if ( it->isEnabled() ) it->before( evt,
name, context );
121 if ( it->isEnabled() ) it->after( evt,
name, context, sc );
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
This service manages Auditors.
void before(std::string const &, std::string const &, EventContext const &) override
std::vector< std::unique_ptr< Gaudi::IAuditor > > m_pAudList
void after(std::string const &, std::string const &, EventContext const &, StatusCode const &) override
Gaudi::IAuditor * getAuditor(std::string const &name) const override
management functionality: retrieve an Auditor
std::unique_ptr< Gaudi::IAuditor > newAuditor(MsgStream &, std::string_view)
StatusCode addAuditor(std::string const &name) override
adds a new Auditor
StatusCode finalize() override
Gaudi::Property< std::vector< std::string > > m_audNameList
bool isEnabled() const override
bool hasAuditor(std::string const &name) const override
management functionality: check if an Auditor exists
std::optional< StatusCode > removesAuditor(std::string const &name) override
removes an Auditor. Returns whether the Auditor was present (and thus removed)
StatusCode syncAuditors()
internal mathod to update auditors when m_audNameList is changed
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & msgStream() const
Return an uninitialized MsgStream.
This class represents an entry point to all the event specific data.
The IAuditor is the interface implemented by the Auditor base class.
Helper class to parse a string of format "type/name".
const std::string & type() const
const std::string & name() const
Definition of the MsgStream class used to transmit messages.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
StatusCode finalize() override
const std::string & name() const override
Retrieve name of the service.
Gaudi::StateMachine::State m_targetState
Service state.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...