Geant4_10
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
source
source
processes
electromagnetic
dna
management
include
G4VTrackState.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
/*
27
* G4VTrackState.hh
28
*
29
* Created on: 8 avr. 2013
30
* Author: kara
31
*/
32
33
#ifndef G4VTRACKSTATE_HH_
34
#define G4VTRACKSTATE_HH_
35
36
#include <
CLHEP/Utility/memory.h
>
37
38
class
G4VTrackStateID
39
{
40
public
:
41
virtual
int
GetStateID
() = 0;
42
protected
:
43
G4VTrackStateID
(){;}
44
virtual
~G4VTrackStateID
(){;}
45
46
static
int
fgLastID
;
47
};
48
49
class
G4TrackState
;
50
51
template
<
class
T>
52
class
G4TrackStateID
:
public
G4VTrackStateID
53
{
54
public
:
55
static
CLHEP::shared_ptr<G4VTrackStateID>
Get
()
56
{
57
if
(!fgTrackStateID)
58
{
59
new
G4TrackStateID<T>
;
60
}
61
62
return
fgTrackStateID;
63
}
64
65
~
G4TrackStateID<T>
(){;}
66
67
virtual
int
GetStateID
()
68
{
69
return
fID;
70
}
71
72
static
int
GetID
()
73
{
74
if
(fgTrackStateID)
75
return
fgTrackStateID->fID;
76
else
77
return
-1;
// TODO Exception
78
}
79
80
private
:
81
G4TrackStateID<T>
() : fID(
fgLastID
)
82
{
83
fgLastID
++;
84
fgTrackStateID =
this
;
85
}
86
87
static
CLHEP::shared_ptr<G4TrackStateID<T>
> fgTrackStateID;
88
const
int
fID;
89
};
90
91
92
class
G4TrackState
93
{
94
public
:
95
template
<
class
T>
static
G4TrackState
*
Create
()
96
{
97
G4TrackState
* output =
new
G4TrackState
(
G4TrackStateID<T>::Get
());
98
return
output;
99
}
100
101
int
GetID
()
102
{
103
return
fpTrackStateID->GetStateID();
104
}
105
106
protected
:
107
virtual
~G4TrackState
(){}
108
109
private
:
110
G4TrackState
(
CLHEP::shared_ptr<G4VTrackStateID>
_trackStateID) : fpTrackStateID(_trackStateID)
111
{}
112
113
CLHEP::shared_ptr<G4VTrackStateID>
fpTrackStateID;
114
};
115
116
#endif
/* G4VTRACKSTATE_HH_ */
memory.h
G4TrackState::~G4TrackState
virtual ~G4TrackState()
Definition:
G4VTrackState.hh:107
G4TrackState
Definition:
G4VTrackState.hh:92
G4TrackStateID
Definition:
G4VTrackState.hh:52
G4VTrackStateID::GetStateID
virtual int GetStateID()=0
G4TrackStateID::GetID
static int GetID()
Definition:
G4VTrackState.hh:72
G4TrackStateID::Get
static CLHEP::shared_ptr< G4VTrackStateID > Get()
Definition:
G4VTrackState.hh:55
G4VTrackStateID
Definition:
G4VTrackState.hh:38
G4TrackStateID::GetStateID
virtual int GetStateID()
Definition:
G4VTrackState.hh:67
G4TrackState::Create
static G4TrackState * Create()
Definition:
G4VTrackState.hh:95
G4VTrackStateID::G4VTrackStateID
G4VTrackStateID()
Definition:
G4VTrackState.hh:43
G4VTrackStateID::~G4VTrackStateID
virtual ~G4VTrackStateID()
Definition:
G4VTrackState.hh:44
G4VTrackStateID::fgLastID
static int fgLastID
Definition:
G4VTrackState.hh:46
CLHEP::shared_ptr< G4VTrackStateID >
G4TrackState::GetID
int GetID()
Definition:
G4VTrackState.hh:101
Generated on Sat Dec 14 2013 14:34:28 for Geant4_10 by
1.8.5