23.05.2014 Views

Athena Developer Guide

Athena Developer Guide

Athena Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Athena</strong> Chapter 13 Framework services Version/Issue: 2.0.0<br />

13.7.2 Overriding the default Algorithm monitoring<br />

By default, only monitoring of the Algorithm execute() function is enabled by default. This default<br />

can be overridden for individual Algorithms by use of the following Algorithm properties:<br />

// Enable initialize and finalize auditing & disable execute auditing<br />

// for the myAlgorithm Algorithm<br />

myAlgorithm.AuditInitialize = true;<br />

myAlgorithm.AuditExecute = false;<br />

myAlgorithm.AuditFinalize = true;<br />

13.7.3 Implementing new Auditors<br />

The relevant portion of the IAuditor abstract interface is shown below:<br />

virtual StatusCode beforeInitialize( IAlgorithm* theAlg ) = 0;<br />

virtual StatusCode afterInitialize ( IAlgorithm* theAlg ) = 0;<br />

virtual StatusCode beforeExecute ( IAlgorithm* theAlg ) = 0;<br />

virtual StatusCode afterExecute ( IAlgorithm* theAlg ) = 0;<br />

virtual StatusCode beforeFinalize ( IAlgorithm* theAlg ) = 0;<br />

virtual StatusCode afterFinalize ( IAlgorithm* theAlg ) = 0;<br />

A new Auditor should inherit from the Auditor base class and override the appropriate functions from<br />

the IAuditor abstract interface. The following code fragment is taken from the ChronoAuditor:<br />

#include "GaudiKernel/Auditor.h"<br />

class ChronoAuditor : virtual public Auditor {<br />

public:<br />

ChronoAuditor(const std::string& name, ISvcLocator* pSvcLocator);<br />

virtual ~ChronoAuditor();<br />

virtual StatusCode beforeInitialize(IAlgorithm* alg);<br />

virtual StatusCode afterInitialize(IAlgorithm* alg);<br />

virtual StatusCode beforeExecute(IAlgorithm* alg);<br />

virtual StatusCode afterExecute(IAlgorithm* alg);<br />

virtual StatusCode beforeFinalize(IAlgorithm* alg);<br />

virtual StatusCode afterFinalize(IAlgorithm* alg);<br />

};<br />

page 114

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!