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

SpectrumFactory Class Template Reference

Template class designed to hold method by which to polymorphically instantiate new Spectrum objects. More...

#include <SpectrumFactory.h>

Inheritance diagram for SpectrumFactory::

ISpectrumFactory List of all members.

Public Methods

 SpectrumFactory ()
virtual ISpectruminstantiate (const std::string &params) const
 return a new Spectrum object. More...

virtual void addRef () const
 dummy to follow Gaudi model. More...


Detailed Description

template<class T>
class SpectrumFactory< T >

Template class designed to hold method by which to polymorphically instantiate new Spectrum objects.

$Header $

Definition at line 22 of file SpectrumFactory.h.


Constructor & Destructor Documentation

template<class T>
SpectrumFactory< T >::SpectrumFactory   [inline]
 

Definition at line 26 of file SpectrumFactory.h.

References SpectrumFactoryTable::addFactory(), and SpectrumFactoryTable::instance().

00026                      {
00027         //Get class name using RTTI:
00028         std::string classname = typeid(T).name();
00029         int s = classname.find_first_of("class");
00030         if( s==0 ) s=6; //found it
00031         else s =classname.find_first_not_of("0123456789");
00032         classname = classname.substr(s);
00033         SpectrumFactoryTable::instance()->addFactory(classname, this); 
00034     }


Member Function Documentation

template<class T>
virtual void SpectrumFactory< T >::addRef   const [inline, virtual]
 

dummy to follow Gaudi model.

Reimplemented from ISpectrumFactory.

Definition at line 39 of file SpectrumFactory.h.

00039 {}

template<class T>
virtual ISpectrum* SpectrumFactory< T >::instantiate const std::string &    params const [inline, virtual]
 

return a new Spectrum object.

Reimplemented from ISpectrumFactory.

Definition at line 36 of file SpectrumFactory.h.

00036 {return new T(params);}


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