Athena Developer Guide
Athena Developer Guide
Athena Developer Guide
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Athena</strong> Chapter 5 Writing algorithms Version/Issue: 2.0.0<br />
Listing 5.1 The definition of the Algorithm base class.<br />
1: class Algorithm : virtual public IAlgorithm,<br />
2: virtual public IProperty {<br />
3: public:<br />
4: // Constructor and destructor<br />
5: Algorithm( const std::string& name, ISvcLocator *svcloc );<br />
6: virtual ~Algorithm();<br />
7:<br />
8: StatusCode sysInitialize();<br />
9: StatusCode initialize();<br />
10: StatusCode sysExecute();<br />
11: StatusCode execute();<br />
12: StatusCode sysFinalize();<br />
13: StatusCode finalize();<br />
14: const std::string& name() const;<br />
15:<br />
16: virtual bool isExecuted() const;<br />
17: virtual StatusCode setExecuted( bool state );<br />
18: virtual StatusCode resetExecuted();<br />
19: virtual bool isEnabled() const;<br />
20: virtual bool filterPassed() const;<br />
21: virtual StatusCode setFilterPassed( bool state );<br />
22:<br />
23: template<br />
24: StatusCode service( const std::string& svcName, Svc*& theSvc );<br />
25: IMessageSvc* msgSvc();<br />
26: void setOutputLevel( int level );<br />
27: IDataProviderSvc* eventSvc();<br />
28: IConversionSvc* eventCnvSvc();<br />
29: IDataProviderSvc* detSvc();<br />
30: IConversionSvc* detCnvSvc();<br />
31: IHistogramSvc* histoSvc();<br />
32: INtupleSvc* ntupleSvc();<br />
33: IChronoStatSvc* chronoSvc();<br />
34: IRndmGenSvc* randSvc();<br />
35: ISvcLocator* serviceLocator();<br />
36:<br />
37: StatusCode createSubAlgorithm( const std::string& type,<br />
38: const std::string& name, Algorithm*& pSubAlg );<br />
39: std::vector* subAlgorithms() const;<br />
40:<br />
41: virtual StatusCode setProperty(const Property& p);<br />
42: virtual StatusCode getProperty(Property* p) const;<br />
43: const Property& getProperty( const std::string& name) const;<br />
44: const std::vector& getProperties() const;<br />
45: StatusCode setProperties();<br />
46:<br />
47: StatusCode declareProperty(const std::string& name, int& reference);<br />
48: StatusCode declareProperty(const std::string& name, float& reference);<br />
49: StatusCode declareProperty(const std::string& name, double& reference);<br />
50: StatusCode declareProperty(const std::string& name, bool& reference);<br />
51: StatusCode declareProperty(const std::string& name,<br />
52: std::string& reference);<br />
53: // Vectors of properties not shown<br />
page 24<br />
54: private:<br />
55: // Data members not shown<br />
56: Algorithm(const Algorithm& a); // NO COPY ALLOWED<br />
57: Algorithm& operator=(const Algorithm& rhs); // NO ASSIGNMENT ALLOWED};