PhysicsListBuilder.hh

Go to the documentation of this file.
00001 #ifndef SLIC_PHYSICSLISTBUILDER_HH
00002 #define SLIC_PHYSICSLISTBUILDER_HH 1
00003 
00004 #include "G4VUserPhysicsList.hh"
00005 
00006 namespace slic
00007 {
00008 
00012   class VPhysicsListBuilder
00013   {
00014 
00015   public:
00016     VPhysicsListBuilder( const G4String& name,
00017                          const G4String& description)
00018       : m_name( name ),
00019         m_description( description )
00020     {}
00021 
00022     virtual ~VPhysicsListBuilder() 
00023     {;}
00024 
00025   public:
00026 
00027     const G4String& getName()
00028     {
00029       return m_name;
00030     }
00031 
00032     const G4String& getDescription()
00033     {
00034       return m_description;
00035     }
00036 
00037     virtual G4VUserPhysicsList* create() const = 0;
00038 
00039   private:
00040 
00041     G4String m_name;
00042     G4String m_description;
00043 
00044   };
00045 
00050   template < class T >
00051   class TPhysicsListBuilder : public VPhysicsListBuilder
00052   {
00053   public:
00054     TPhysicsListBuilder( const G4String& name,
00055                          const G4String& description )
00056       : VPhysicsListBuilder( name, description )    
00057     {}
00058 
00059     virtual ~TPhysicsListBuilder()
00060     {;}
00061 
00062   public:
00063 
00064     virtual G4VUserPhysicsList* create() const
00065     {
00066       return new T();
00067     }
00068   };
00069 } // namespace slic
00070 
00071 #endif

Generated on Thu Nov 15 15:24:16 2007 for Simulator for the Linear Collider by  doxygen 1.5.4