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

Chapter 2 The framework architecture Version/Issue: 2.0.0<br />

In general an algorithm will be configurable: It will require certain parameters, such as cut-offs, upper<br />

limits on the number of iterations, convergence criteria, etc., to be initialised before the algorithm may<br />

be executed. These parameters may be specified at run time via the job options mechanism. This is<br />

done by the job options service. Though it is not explicitly shown in the figure this component makes<br />

use of the IProperty interface which is implemented by the Algorithm base class.<br />

During its execution an algorithm may wish to make reports on its progress or on errors that occur. All<br />

communication with the outside world should go through the message service component via the<br />

IMessageSvc interface. Use of this interface is discussed in Chapter 13.<br />

As mentioned above, by virtue of its derivation from the Algorithm base class, any concrete<br />

algorithm class implements the IAlgorithm and IProperty interfaces, except for the three<br />

methods initialize(), execute(), and finalize() which must be explicitly implemented<br />

by the concrete algorithm. IAlgorithm is used by the application manager to control top-level<br />

algorithms. IProperty is usually used only by the job options service.<br />

The figure also shows that a concrete algorithm may make use of additional objects internally to aid it<br />

in its function. These private objects do not need to inherit from any particular base class so long as they<br />

are only used internally. These objects are under the complete control of the algorithm object itself and<br />

so care is required to avoid memory leaks etc.<br />

We have used the terms “interface” and “implements” quite freely above. Let us be more explicit about<br />

what we mean. We use the term interface to describe a pure virtual C++ class, i.e. a class with no data<br />

members, and no implementation of the methods that it declares. For example:<br />

class PureAbstractClass {<br />

virtual method1() = 0;<br />

virtual method2() = 0;<br />

}<br />

is a pure abstract class or interface. We say that a class implements such an interface if it is derived<br />

from it, for example:<br />

class ConcreteComponent: public PureAbstractClass {<br />

method1() { }<br />

method2() { }<br />

}<br />

A component which implements more than one interface does so via multiple inheritance, however,<br />

since the interfaces are pure abstract classes the usual problems associated with multiple inheritance do<br />

not occur. These interfaces are identified by a unique number which is available via a global constant of<br />

the form: IID_InterfaceType, such as for example IID_IDataProviderSvc. Using these it<br />

is possible to enquire what interfaces a particular component implements (as shown for example<br />

through the use queryInterface() in the finalize() method of the SimpleAnalysis<br />

example).<br />

page 17

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

Saved successfully!

Ooh no, something went wrong!