Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooMPSentinel.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 RooMPSentinel.cxx
19 \class RooMPSentinel
20 \ingroup Roofitcore
21 
22 RooMPSentinel is a singleton class that keeps track of all
23 parellel execution processes for goodness-of-fit calculations.
24 The primary task of RooMPSentinel is to terminate all server processes
25 when the main ROOT process is exiting.
26 **/
27 
28 
29 #include "RooFit.h"
30 
31 #include "RooMPSentinel.h"
32 #include "RooMPSentinel.h"
33 #include "RooRealMPFE.h"
34 
35 using namespace std;
36 
37 ClassImp(RooMPSentinel);
38  ;
39 
40 
41 ////////////////////////////////////////////////////////////////////////////////
42 /// Constructor
43 
44 RooMPSentinel::RooMPSentinel()
45 {
46 }
47 
48 
49 
50 ////////////////////////////////////////////////////////////////////////////////
51 /// Destructor. Terminate all parallel processes still registered with
52 /// the sentinel
53 
54 RooMPSentinel::~RooMPSentinel()
55 {
56  TIterator *iter = _mpfeSet.createIterator() ;
57  RooRealMPFE* mpfe ;
58  while((mpfe=(RooRealMPFE*)iter->Next())) {
59  mpfe->standby() ;
60  }
61  delete iter ;
62 }
63 
64 
65 
66 ////////////////////////////////////////////////////////////////////////////////
67 /// Register given multi-processor front-end object with the sentinel
68 
69 void RooMPSentinel::add(RooRealMPFE& mpfe)
70 {
71  _mpfeSet.add(mpfe,kTRUE) ;
72 }
73 
74 
75 
76 ////////////////////////////////////////////////////////////////////////////////
77 /// Remove given multi-processor front-end object from the sentinel
78 
79 void RooMPSentinel::remove(RooRealMPFE& mpfe)
80 {
81  _mpfeSet.remove(mpfe,kTRUE) ;
82 }