#include "GaudiKernel/Algorithm.h"
#include "GaudiKernel/Property.h"

#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/AlgFactory.h"
#include "GaudiKernel/DataObject.h"
#include "GaudiKernel/IDataProviderSvc.h"

/** @class HelloWorld
@brief Simple Hello World example Gaudi algorithm.

Prints Hello World with different priority levels.

$Header: /nfs/slac/g/glast/ground/cvs/workbook/pages/gaudiGuide/popup_HelloWorld.cxx.htm,v 1.1.1.1 2007/06/29 15:04:06 chuckp Exp $
*/

class HelloWorld : public Algorithm {
public:
/// Constructor of this form must be provided
HelloWorld(const std::string& name, ISvcLocator* pSvcLocator)
: Algorithm(name, pSvcLocator) { };

/// Three mandatory member functions of any Gaudi algorithm
StatusCode initialize() { return StatusCode::SUCCESS; };
StatusCode execute();
StatusCode finalize() { return StatusCode::SUCCESS; };
private:
};

// Static Factory declaration
static const AlgFactory<HelloWorld> Factory;
const IAlgFactory& HelloWorldFactory = Factory;

StatusCode HelloWorld::execute() {
MsgStream log( msgSvc(), name() );

log << MSG::DEBUG << "Hello World!" << endreq;
log << MSG::INFO << "Hello World!" << endreq;
log << MSG::WARNING << "Hello World!" << endreq;

return StatusCode::SUCCESS;
}