Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

IRegisterSource Class Reference

Abstract definition of a tool to be called from FluxSvc to load external ISpectrumFactory enteries. More...

#include <IRegisterSource.h>

List of all members.

Public Member Functions

virtual StatusCode registerMe (IFluxSvc *)=0
 Pass a pointer to the service to the tool.


Static Public Member Functions

const InterfaceID & interfaceID ()
 Retrieve interface ID.


Detailed Description

Abstract definition of a tool to be called from FluxSvc to load external ISpectrumFactory enteries.

Header
/nfs/slac/g/glast/ground/cvs/FluxSvc/FluxSvc/IRegisterSource.h,v 1.6 2007/04/02 01:34:10 heather Exp


Example of an implementation:

#include "GaudiKernel/AlgTool.h" #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ToolFactory.h"

#include "FluxSvc/IRegisterSource.h" #include "FluxSvc/ISpectrumFactory.h" #include "FluxSvc/IFluxSvc.h" // GRB includes

#include "GRB/GRBSpectrum.h" #include "GRBmaker/GRBobsSpectrum.h"

class RegisterGRB : public AlgTool, virtual public IRegisterSource { public:

RegisterGRB( const std::string& type, const std::string& name, const IInterface* parent); virtual ~RegisterGRB() { }

/// implement to define sources: will be called from FluxSvc StatusCode registerMe(IFluxSvc* );

};

// Static factory for instantiation of algtool objects static ToolFactory<RegisterGRB> s_factory; const IToolFactory& RegisterGRBFactory = s_factory;

// Standard Constructor RegisterGRB::RegisterGRB(const std::string& type, const std::string& name, const IInterface* parent) : AlgTool( type, name, parent ) {

// Declare additional interface declareInterface<IRegisterSource>(this);

}

StatusCode RegisterGRB::registerMe(IFluxSvc* fsvc) { MsgStream log(msgSvc(), name()); log << MSG::INFO << "Register GRB Spectra..." << endreq; static RemoteSpectrumFactory<GRBSpectrum> factory(fsvc);

log << MSG::INFO << "Register Sandhia GRB Spectra..." << endreq; static RemoteSpectrumFactory<GRBobsSpectrum> factory2(fsvc);

return StatusCode::SUCCESS; } *

Definition at line 79 of file IRegisterSource.h.


Member Function Documentation

const InterfaceID& IRegisterSource::interfaceID  )  [inline, static]
 

Retrieve interface ID.

Definition at line 82 of file IRegisterSource.h.

Referenced by FluxSvc::initialize().

00082 { return IID_IRegisterSource; }

virtual StatusCode IRegisterSource::registerMe IFluxSvc  )  [pure virtual]
 

Pass a pointer to the service to the tool.

Referenced by FluxSvc::initialize().


The documentation for this class was generated from the following file:
Generated on Wed Nov 26 20:29:33 2008 by doxygen 1.3.3