Module.hh

Go to the documentation of this file.
00001 // $Header: /cvs/lcd/slic/include/Module.hh,v 1.9 2008/04/09 22:09:35 jeremy Exp $
00002 
00003 #ifndef SLIC_MODULE_HH
00004 #define SLIC_MODULE_HH 1
00005 
00006 // slic
00007 #include "LogManager.hh"
00008 
00009 // std
00010 #include <string>
00011 
00012 // geant4
00013 #include "G4ClassificationOfNewTrack.hh"
00014 
00015 class G4Event;
00016 class G4Run;
00017 class G4Step;
00018 class G4Track;
00019 
00020 namespace slic
00021 {
00027     class Module 
00028     {
00029         public:
00030             enum ModuleStatus {
00031                 eOkay = 0,
00032                 eNotInitialized = 1,
00033                 eBadState = 2,
00034                 eFatalError = 3
00035             };
00036 
00037         protected:
00038 
00042             Module( const std::string& name, 
00043                     bool deleteOnExit = true, 
00044                     bool autoRegister = true);
00045 
00046         public:
00047             virtual ~Module();
00048 
00049         public:
00050 
00051             const std::string& getName() const 
00052             {
00053                 return m_name;
00054             }
00055 
00056             const ModuleStatus getStatus() const 
00057             {
00058                 return m_status;
00059             }
00060 
00061             virtual void initialize() 
00062             {;}
00063 
00064             virtual void reset() 
00065             {;}
00066 
00067             virtual void cleanup() 
00068             {;}
00069 
00070             bool deleteOnExit()
00071             {
00072                 return m_deleteOnExit;
00073             }
00074 
00075             LogStream& log()
00076             {
00077                 return *m_log;
00078             }
00079 
00080             virtual void beginEvent( const G4Event* )
00081             {;}
00082 
00083             virtual void endEvent( const G4Event* )
00084             {;}
00085 
00086             virtual void beginRun( const G4Run* )
00087             {;}
00088 
00089             virtual void endRun( const G4Run* )
00090             {;}
00091 
00092             virtual void preTracking( const G4Track* )
00093             {;}
00094 
00095             virtual void postTracking( const G4Track* )
00096             {;}    
00097 
00098             virtual void stepping( const G4Step* ) 
00099             {;}
00100 
00101             G4ClassificationOfNewTrack stackingClassifyNewTrack( const G4Track* )
00102             {
00103                 G4Exception("This method should never be called.  Please override it.");
00104                 // Arbitrary return value.  Will never reach here.
00105                 return fWaiting;
00106             }
00107     
00108             void stackingNewStage()
00109             {;}
00110 
00111             void stackingPrepareNewEvent()
00112             {;}
00113 
00114         public:
00115             ModuleStatus m_status;
00116             std::string m_name;
00117             LogStream* m_log;          
00118             bool m_deleteOnExit;
00119     };
00120 }
00121 
00122 #endif

Generated on Mon Jun 7 17:45:20 2010 for Simulator for the Linear Collider by  doxygen 1.5.4