Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   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>

Inheritance diagram for IRegisterSource::

RegisterTest List of all members.

Public Methods

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


Static Public Methods

const InterfaceID & interfaceID ()
 Retrieve interface ID. More...


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.3 2002/07/25 05:18:58 srobinsn 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 76 of file IRegisterSource.h.


Member Function Documentation

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

Retrieve interface ID.

Definition at line 79 of file IRegisterSource.h.

Referenced by FluxSvc::initialize().

00079 { return IID_IRegisterSource; }

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

Pass a pointer to the service to the tool.

Reimplemented in RegisterTest.


The documentation for this class was generated from the following file:
Generated on Wed Oct 16 14:01:34 2002 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001