23.05.2014 Views

Athena Developer Guide

Athena Developer Guide

Athena Developer Guide

SHOW MORE
SHOW LESS

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><br />

Chapter 14 Tools and ToolSvc Version/Issue: 2.0.0<br />

Listing 14.1 The definition of the AlgTool Base class<br />

1: class AlgTool : public virtual IAlgTool,<br />

2: public virtual IProperty {<br />

3:<br />

4: public:<br />

5: // Standard Constructor.<br />

6: AlgTool( const std::string& type, const std::string& name,<br />

const IInterface* parent);<br />

7:<br />

8: virtual const std::string& name() const;<br />

9: virtual const std::string& type() const;<br />

10: virtual const IInterface* parent() const;<br />

11:<br />

12: virtual StatusCode setProperty(const Property& p);<br />

13: virtual StatusCode getProperty(Property* p) const;<br />

14: virtual const Property& getProperty( const std::string& name) const;<br />

15: virtual const std::vector& getProperties( ) const;<br />

16:<br />

17: ISvcLocator* serviceLocator();<br />

18: IMessageSvc* msgSvc();<br />

19: IMessageSvc* msgSvc() const;<br />

20:<br />

21: StatusCode setProperties();<br />

22:<br />

23: StatusCode declareProperty(const std::string& name, int& reference);<br />

24: StatusCode declareProperty(const std::string& name, double& reference);<br />

25: StatusCode declareProperty(const std::string& name, bool& reference);<br />

26: StatusCode declareProperty(const std::string& name,<br />

std::string& reference);<br />

27: StatusCode declareProperty(const std::string& name,<br />

std::vector& reference);<br />

28: StatusCode declareProperty(const std::string& name,<br />

std::vector& reference);<br />

29: StatusCode declareProperty(const std::string& name,<br />

std::vector& reference);<br />

30: StatusCode declareProperty(const std::string& name,<br />

std::vector& reference);<br />

31:<br />

32: protected:<br />

33: // Standard destructor.<br />

34: virtual ~AlgTool();<br />

Access to Services - A serviceLocator() method is provided to enable the derived tools to<br />

locate the services necessary to perform their jobs. Since concrete Tools are instantiated by the<br />

ToolSvc upon request, all Services created by the framework prior to the creation of a tool are<br />

available. In addition access to the message service is provided via the msgSvc() method. Both<br />

pointers are retrieved from the parent of the tool.<br />

page 125

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

Saved successfully!

Ooh no, something went wrong!