Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:26

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4VPersistencyManager
0027 //
0028 // Class description:
0029 //
0030 // This is an abstract base class for persistency management. The user's
0031 // concrete class derived from this class must act as a singleton. The user
0032 // must construct the object of his/her concrete persistency manager in
0033 // the main().
0034 // The virtual methods of Store() and Retrieve() will be invoked from
0035 // G4RunManager if the persistency manager exists.
0036 // Even if the user does not use any ODBMS system, the user can use this
0037 // class especially for Store() methods. Writing an ASCII file for storing
0038 // event information can be delegated to this class, for example.
0039 
0040 // Author: Youhei Morita, 2001
0041 // --------------------------------------------------------------------
0042 #ifndef G4VPersistencyManager_hh
0043 #define G4VPersistencyManager_hh 1
0044 
0045 #include "globals.hh"
0046 
0047 class G4Event;
0048 class G4Run;
0049 class G4VPhysicalVolume;
0050 
0051 class G4VPersistencyManager
0052 {
0053   public:
0054     // Static method to return the pointer to the singleton object.
0055     // Note that this method does NOT create the singleton itself.
0056     static G4VPersistencyManager* GetPersistencyManager();
0057 
0058     virtual ~G4VPersistencyManager();
0059 
0060     // Stores G4Event, G4Run, and geometry tree characterised
0061     // by the world volume.
0062 
0063     virtual G4bool Store(const G4Event* anEvent) = 0;
0064     virtual G4bool Store(const G4Run* aRun) = 0;
0065     virtual G4bool Store(const G4VPhysicalVolume* world) = 0;
0066 
0067     // Restores G4Event, G4Run, and geometry tree characterised
0068     // by the world volume.
0069     virtual G4bool Retrieve(G4Event*& anEvent) = 0;
0070     virtual G4bool Retrieve(G4Run*& aRun) = 0;
0071     virtual G4bool Retrieve(G4VPhysicalVolume*& theWorld) = 0;
0072 
0073   protected:
0074     G4VPersistencyManager();
0075 
0076   private:
0077     static G4ThreadLocal G4VPersistencyManager* fPersistencyManager;
0078 };
0079 
0080 #endif