ROOT
v6-22
Reference Guide
RooSentinel.cxx
Go to the documentation of this file.
1
/*****************************************************************************
2
* Project: RooFit *
3
* Package: RooFitCore *
4
* @(#)root/roofitcore:$Id$
5
* Authors: *
6
* WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7
* DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8
* *
9
* Copyright (c) 2000-2005, Regents of the University of California *
10
* and Stanford University. All rights reserved. *
11
* *
12
* Redistribution and use in source and binary forms, *
13
* with or without modification, are permitted according to the terms *
14
* listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15
*****************************************************************************/
16
17
/**
18
\file RooSentinel.cxx
19
\class RooSentinel
20
\ingroup Roofitcore
21
22
RooSentinel is a special purpose singleton class that terminates
23
all other RooFit singleton services when the process exits.
24
25
All function RooFit singleton services are created on the heap with
26
a static wrapper function to avoid the 'static initialization order fiasco'
27
but are not automatically destroyed at the end of the session. This class
28
installs an atexit() function that takes care of this
29
**/
30
31
#include "
RooFit.h
"
32
33
#include "
RooSentinel.h
"
34
#include "
RooMinuit.h
"
35
#include "
RooArgSet.h
"
36
#include "
RooRealConstant.h
"
37
#include "
RooResolutionModel.h
"
38
#include "
RooExpensiveObjectCache.h
"
39
#include "
RooDataSet.h
"
40
41
Bool_t
RooSentinel::_active
=
kFALSE
;
42
43
static
void
CleanUpRooFitAtExit
()
44
{
45
// Clean up function called at program termination before global objects go out of scope.
46
RooMinuit::cleanup
() ;
47
RooArgSet::cleanup
() ;
48
RooDataSet::cleanup
();
49
RooRealVar::cleanup
();
50
}
51
52
53
54
////////////////////////////////////////////////////////////////////////////////
55
/// Install atexit handler that calls CleanupRooFitAtExit()
56
/// on program termination
57
58
void
RooSentinel::activate
()
59
{
60
if
(!
_active
) {
61
_active
=
kTRUE
;
62
atexit(
CleanUpRooFitAtExit
) ;
63
}
64
}
65
66
67
RooArgSet.h
RooDataSet.h
RooExpensiveObjectCache.h
RooFit.h
RooMinuit.h
RooRealConstant.h
RooResolutionModel.h
CleanUpRooFitAtExit
static void CleanUpRooFitAtExit()
Definition:
RooSentinel.cxx:43
RooSentinel.h
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:90
kTRUE
const Bool_t kTRUE
Definition:
RtypesCore.h:89
RooArgSet::cleanup
static void cleanup()
Definition:
RooArgSet.cxx:71
RooDataSet::cleanup
static void cleanup()
Definition:
RooDataSet.cxx:93
RooMinuit::cleanup
static void cleanup()
Cleanup method called by atexit handler installed by RooSentinel to delete all global heap objects wh...
Definition:
RooMinuit.cxx:87
RooRealVar::cleanup
static void cleanup()
Explicitely deletes the shared properties list on exit to avoid problems with the initialization orde...
Definition:
RooRealVar.cxx:74
RooSentinel::activate
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
Definition:
RooSentinel.cxx:58
RooSentinel::_active
static Bool_t _active
Definition:
RooSentinel.h:28
bool
roofit
roofitcore
src
RooSentinel.cxx
ROOT v6-22 - Reference Guide Generated on Fri Apr 1 2022 11:52:50 (GVA Time) using Doxygen 1.9.4