Logo ROOT  
Reference Guide
 
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
22RooSentinel is a special purpose singleton class that terminates
23all other RooFit singleton services when the process exits.
24
25All function RooFit singleton services are created on the heap with
26a static wrapper function to avoid the 'static initialization order fiasco'
27but are not automatically destroyed at the end of the session. This class
28installs an atexit() function that takes care of this
29**/
30
31#include "RooFit.h"
32
33#include "RooSentinel.h"
34#include "RooArgSet.h"
35#include "RooRealConstant.h"
36#include "RooResolutionModel.h"
38#include "RooDataSet.h"
39
41
43{
44 // Clean up function called at program termination before global objects go out of scope.
48}
49
50
51
52////////////////////////////////////////////////////////////////////////////////
53/// Install atexit handler that calls CleanupRooFitAtExit()
54/// on program termination
55
57{
58 if (!_active) {
59 _active = kTRUE ;
60 atexit(CleanUpRooFitAtExit) ;
61 }
62}
63
64
65
static void CleanUpRooFitAtExit()
const Bool_t kFALSE
Definition RtypesCore.h:101
const Bool_t kTRUE
Definition RtypesCore.h:100
static void cleanup()
Definition RooArgSet.cxx:73
static void cleanup()
static void cleanup()
Explicitely deletes the shared properties list on exit to avoid problems with the initialization orde...
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
static Bool_t _active
Definition RooSentinel.h:28