00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 00030 #ifndef G4VPersistencyManager_h 00031 #define G4VPersistencyManager_h 1 00032 00033 #include "globals.hh" 00034 00035 class G4Event; 00036 class G4Run; 00037 class G4VPhysicalVolume; 00038 00039 // class description: 00040 // 00041 // This is an abstract base class for persistency management. The user's 00042 // concrete class derived from this class must be a singleton. The user 00043 // must construct the object of his/her concrete persistency manager at 00044 // his/her main(). 00045 // The virtual methods of Store() and Retreive() will be invoked from 00046 // G4RunManager if the persistency manager exists. 00047 // Even if the user does not use any ODBMS, the user can use this class 00048 // especially for Store() methods. Writing an ASCII file for storing 00049 // event information can be delegated to this class, for example. 00050 // 00051 00052 class G4VPersistencyManager 00053 { 00054 public: // with description 00055 static G4VPersistencyManager* GetPersistencyManager(); 00056 // Static method to return the pointer to the singleton object. 00057 // Note that this method does NOT create the singleton object. 00058 00059 protected: 00060 G4VPersistencyManager(); 00061 00062 public: 00063 virtual ~G4VPersistencyManager(); 00064 00065 private: 00066 static G4VPersistencyManager * fPersistencyManager; 00067 00068 public: // with description 00069 virtual G4bool Store(const G4Event* anEvent)=0; 00070 virtual G4bool Store(const G4Run* aRun)=0; 00071 virtual G4bool Store(const G4VPhysicalVolume* theWorld)=0; 00072 // Stores G4Event, G4Run, and geometry tree characterized by the world volume. 00073 00074 virtual G4bool Retrieve(G4Event*& anEvent)=0; 00075 virtual G4bool Retrieve(G4Run*& aRun)=0; 00076 virtual G4bool Retrieve(G4VPhysicalVolume*& theWorld)=0; 00077 // Restore G4Event, G4Run, and geometry tree characterized by the world volume. 00078 00079 }; 00080 00081 00082 00083 00084 #endif 00085