ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
montecarlo
vmc
src
TVirtualMCApplication.cxx
Go to the documentation of this file.
1
// @(#)root/vmc:$Id$
2
// Author: Ivana Hrivnacova, 27/03/2002
3
4
/*************************************************************************
5
* Copyright (C) 2006, Rene Brun and Fons Rademakers. *
6
* Copyright (C) 2002, ALICE Experiment at CERN. *
7
* All rights reserved. *
8
* *
9
* For the licensing terms see $ROOTSYS/LICENSE. *
10
* For the list of contributors see $ROOTSYS/README/CREDITS. *
11
*************************************************************************/
12
13
#include "
TVirtualMCApplication.h
"
14
#include "
TError.h
"
15
16
/** \class TVirtualMCApplication
17
\ingroup vmc
18
19
Interface to a user Monte Carlo application.
20
21
*/
22
23
ClassImp
(
TVirtualMCApplication
)
24
25
TMCThreadLocal
TVirtualMCApplication
*
TVirtualMCApplication
::fgInstance = 0;
26
27
////////////////////////////////////////////////////////////////////////////////
28
///
29
/// Standard constructor
30
///
31
32
TVirtualMCApplication
::
TVirtualMCApplication
(const
char
*name,
33
const
char
*title)
34
:
TNamed
(name,title)
35
{
36
if
(fgInstance) {
37
Fatal
(
"TVirtualMCApplication"
,
38
"Attempt to create two instances of singleton."
);
39
}
40
41
fgInstance =
this
;
42
}
43
44
////////////////////////////////////////////////////////////////////////////////
45
///
46
/// Default constructor
47
///
48
49
TVirtualMCApplication::TVirtualMCApplication
()
50
:
TNamed
()
51
{
52
fgInstance =
this
;
53
}
54
55
////////////////////////////////////////////////////////////////////////////////
56
///
57
/// Destructor
58
///
59
60
TVirtualMCApplication::~TVirtualMCApplication
()
61
{
62
fgInstance = 0;
63
}
64
65
////////////////////////////////////////////////////////////////////////////////
66
///
67
/// Static access method
68
///
69
70
TVirtualMCApplication
*
TVirtualMCApplication::Instance
()
71
{
72
return
fgInstance
;
73
}
74
Fatal
void Fatal(const char *location, const char *msgfmt,...)
TVirtualMCApplication::fgInstance
static TMCThreadLocal TVirtualMCApplication * fgInstance
Singleton instance.
Definition:
TVirtualMCApplication.h:119
TVirtualMCApplication.h
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition:
TNamed.h:33
TVirtualMCApplication::~TVirtualMCApplication
virtual ~TVirtualMCApplication()
Destructor.
Definition:
TVirtualMCApplication.cxx:60
TError.h
TVirtualMCApplication
Interface to a user Monte Carlo application.
Definition:
TVirtualMCApplication.h:30
TMCThreadLocal
#define TMCThreadLocal
Definition:
TMCtls.h:59
ClassImp
#define ClassImp(name)
Definition:
Rtypes.h:279
TVirtualMCApplication::Instance
static TVirtualMCApplication * Instance()
Static access method.
Definition:
TVirtualMCApplication.cxx:70
TVirtualMCApplication::TVirtualMCApplication
TVirtualMCApplication()
Default constructor.
Definition:
TVirtualMCApplication.cxx:49