ROOT
Version v6.28
master
v6.36
v6.34
v6.32
v6.30
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
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 "
RooSentinel.h
"
32
#include "
RooArgSet.h
"
33
#include "
RooRealConstant.h
"
34
#include "
RooResolutionModel.h
"
35
#include "
RooExpensiveObjectCache.h
"
36
#include "
RooDataSet.h
"
37
38
bool
RooSentinel::_active
= false ;
39
40
static
void
CleanUpRooFitAtExit
()
41
{
42
// Clean up function called at program termination before global objects go out of scope.
43
RooArgSet::cleanup
() ;
44
RooDataSet::cleanup
();
45
RooRealVar::cleanup
();
46
}
47
48
49
50
////////////////////////////////////////////////////////////////////////////////
51
/// Install atexit handler that calls CleanupRooFitAtExit()
52
/// on program termination
53
54
void
RooSentinel::activate
()
55
{
56
if
(!
_active
) {
57
_active
= true ;
58
atexit(
CleanUpRooFitAtExit
) ;
59
}
60
}
61
62
63
RooArgSet.h
RooDataSet.h
RooExpensiveObjectCache.h
RooRealConstant.h
RooResolutionModel.h
CleanUpRooFitAtExit
static void CleanUpRooFitAtExit()
Definition
RooSentinel.cxx:40
RooSentinel.h
RooArgSet::cleanup
static void cleanup()
Definition
RooArgSet.cxx:80
RooDataSet::cleanup
static void cleanup()
Definition
RooDataSet.cxx:124
RooRealVar::cleanup
static void cleanup()
Explicitely deletes the shared properties list on exit to avoid problems with the initialization orde...
Definition
RooRealVar.cxx:76
RooSentinel::_active
static bool _active
Definition
RooSentinel.h:28
RooSentinel::activate
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
Definition
RooSentinel.cxx:54
roofit
roofitcore
src
RooSentinel.cxx
ROOT v6-28 - Reference Guide Generated on Thu Oct 24 2024 01:49:50 (GVA Time) using Doxygen 1.9.8