Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VPersistencyManager.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4VPersistencyManager
27//
28// Class description:
29//
30// This is an abstract base class for persistency management. The user's
31// concrete class derived from this class must act as a singleton. The user
32// must construct the object of his/her concrete persistency manager in
33// the main().
34// The virtual methods of Store() and Retrieve() will be invoked from
35// G4RunManager if the persistency manager exists.
36// Even if the user does not use any ODBMS system, the user can use this
37// class especially for Store() methods. Writing an ASCII file for storing
38// event information can be delegated to this class, for example.
39
40// Author: Youhei Morita, 2001
41// --------------------------------------------------------------------
42#ifndef G4VPersistencyManager_hh
43#define G4VPersistencyManager_hh 1
44
45#include "globals.hh"
46
47class G4Event;
48class G4Run;
50
52{
53 public:
54
56 // Static method to return the pointer to the singleton object.
57 // Note that this method does NOT create the singleton itself.
58
59 virtual ~G4VPersistencyManager();
60
61 virtual G4bool Store(const G4Event* anEvent) = 0;
62 virtual G4bool Store(const G4Run* aRun) = 0;
63 virtual G4bool Store(const G4VPhysicalVolume* world) = 0;
64 // Stores G4Event, G4Run, and geometry tree characterised
65 // by the world volume.
66
67 virtual G4bool Retrieve(G4Event*& anEvent) = 0;
68 virtual G4bool Retrieve(G4Run*& aRun) = 0;
69 virtual G4bool Retrieve(G4VPhysicalVolume*& theWorld) = 0;
70 // Restores G4Event, G4Run, and geometry tree characterised
71 // by the world volume.
72
73 protected:
74
76
77 private:
78
79 static G4ThreadLocal G4VPersistencyManager* fPersistencyManager;
80};
81
82#endif
bool G4bool
Definition: G4Types.hh:86
Definition: G4Run.hh:49
virtual G4bool Store(const G4Run *aRun)=0
static G4VPersistencyManager * GetPersistencyManager()
virtual G4bool Retrieve(G4Run *&aRun)=0
virtual G4bool Store(const G4VPhysicalVolume *world)=0
virtual G4bool Store(const G4Event *anEvent)=0
virtual G4bool Retrieve(G4Event *&anEvent)=0
virtual G4bool Retrieve(G4VPhysicalVolume *&theWorld)=0
#define G4ThreadLocal
Definition: tls.hh:77