/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id$
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. All rights reserved.    *
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
//
// BEGIN_HTML
// RooMPSentinel is a singleton class that keeps track of all
// parellel execution processes for goodness-of-fit calculations.
// The primary task of RooMPSentinel is to terminate all server processes
// when the main ROOT process is exiting.
// END_HTML
//


#include "RooFit.h"

#include "RooMPSentinel.h"
#include "RooMPSentinel.h"
#include "RooRealMPFE.h"

using namespace std;

ClassImp(RooMPSentinel)
  ;


//_____________________________________________________________________________
RooMPSentinel::RooMPSentinel() 
{
  // Constructor
}



//_____________________________________________________________________________
RooMPSentinel::~RooMPSentinel() 
{
  // Destructor. Terminate all parallel processes still registered with
  // the sentinel

  TIterator *iter = _mpfeSet.createIterator() ;
  RooRealMPFE* mpfe ;
  while((mpfe=(RooRealMPFE*)iter->Next())) {
    mpfe->standby() ;
  }
  delete iter ;
}
 


//_____________________________________________________________________________
void RooMPSentinel::add(RooRealMPFE& mpfe) 
{
  // Register given multi-processor front-end object with the sentinel

  _mpfeSet.add(mpfe,kTRUE) ;
}



//_____________________________________________________________________________
void RooMPSentinel::remove(RooRealMPFE& mpfe) 
{
  // Remove given multi-processor front-end object from the sentinel

  _mpfeSet.remove(mpfe,kTRUE) ;
}
 RooMPSentinel.cxx:1
 RooMPSentinel.cxx:2
 RooMPSentinel.cxx:3
 RooMPSentinel.cxx:4
 RooMPSentinel.cxx:5
 RooMPSentinel.cxx:6
 RooMPSentinel.cxx:7
 RooMPSentinel.cxx:8
 RooMPSentinel.cxx:9
 RooMPSentinel.cxx:10
 RooMPSentinel.cxx:11
 RooMPSentinel.cxx:12
 RooMPSentinel.cxx:13
 RooMPSentinel.cxx:14
 RooMPSentinel.cxx:15
 RooMPSentinel.cxx:16
 RooMPSentinel.cxx:17
 RooMPSentinel.cxx:18
 RooMPSentinel.cxx:19
 RooMPSentinel.cxx:20
 RooMPSentinel.cxx:21
 RooMPSentinel.cxx:22
 RooMPSentinel.cxx:23
 RooMPSentinel.cxx:24
 RooMPSentinel.cxx:25
 RooMPSentinel.cxx:26
 RooMPSentinel.cxx:27
 RooMPSentinel.cxx:28
 RooMPSentinel.cxx:29
 RooMPSentinel.cxx:30
 RooMPSentinel.cxx:31
 RooMPSentinel.cxx:32
 RooMPSentinel.cxx:33
 RooMPSentinel.cxx:34
 RooMPSentinel.cxx:35
 RooMPSentinel.cxx:36
 RooMPSentinel.cxx:37
 RooMPSentinel.cxx:38
 RooMPSentinel.cxx:39
 RooMPSentinel.cxx:40
 RooMPSentinel.cxx:41
 RooMPSentinel.cxx:42
 RooMPSentinel.cxx:43
 RooMPSentinel.cxx:44
 RooMPSentinel.cxx:45
 RooMPSentinel.cxx:46
 RooMPSentinel.cxx:47
 RooMPSentinel.cxx:48
 RooMPSentinel.cxx:49
 RooMPSentinel.cxx:50
 RooMPSentinel.cxx:51
 RooMPSentinel.cxx:52
 RooMPSentinel.cxx:53
 RooMPSentinel.cxx:54
 RooMPSentinel.cxx:55
 RooMPSentinel.cxx:56
 RooMPSentinel.cxx:57
 RooMPSentinel.cxx:58
 RooMPSentinel.cxx:59
 RooMPSentinel.cxx:60
 RooMPSentinel.cxx:61
 RooMPSentinel.cxx:62
 RooMPSentinel.cxx:63
 RooMPSentinel.cxx:64
 RooMPSentinel.cxx:65
 RooMPSentinel.cxx:66
 RooMPSentinel.cxx:67
 RooMPSentinel.cxx:68
 RooMPSentinel.cxx:69
 RooMPSentinel.cxx:70
 RooMPSentinel.cxx:71
 RooMPSentinel.cxx:72
 RooMPSentinel.cxx:73
 RooMPSentinel.cxx:74
 RooMPSentinel.cxx:75
 RooMPSentinel.cxx:76
 RooMPSentinel.cxx:77
 RooMPSentinel.cxx:78
 RooMPSentinel.cxx:79
 RooMPSentinel.cxx:80