ROOT  6.06/09
Reference Guide
TVirtualProofPlayer.cxx
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Fons Rademakers 15/03/07
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TVirtualProofPlayer //
15 // //
16 // Abstract interface for the PROOF player. //
17 // See the concrete implementations under 'proofplayer' for details. //
18 // //
19 //////////////////////////////////////////////////////////////////////////
20 
21 #include "TVirtualProofPlayer.h"
22 #include "TPluginManager.h"
23 #include "TROOT.h"
24 #include "TError.h"
25 
26 ////////////////////////////////////////////////////////////////////////////////
27 /// Create a PROOF player.
28 
30  TProof *pr, TSocket *s)
31 {
33  TVirtualProofPlayer *p = 0;
34 
35  if (!player || !*player) {
36  ::Error("TVirtualProofPlayer::Create", "player name missing");
37  return 0;
38  }
39 
40  if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualProofPlayer", player))) {
41  if (h->LoadPlugin() == -1)
42  return 0;
43  if (!strcmp(player, "slave"))
44  p = (TVirtualProofPlayer *) h->ExecPlugin(1, s);
45  else
46  p = (TVirtualProofPlayer *) h->ExecPlugin(1, pr);
47  }
48 
49  return p;
50 }
TH1 * h
Definition: legend2.C:5
#define gROOT
Definition: TROOT.h:340
Int_t LoadPlugin()
Load the plugin library for this handler.
Long_t ExecPlugin(int nargs, const T &...params)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
static TVirtualProofPlayer * Create(const char *player, TProof *p, TSocket *s=0)
Create a PROOF player.
Definition: TProof.h:339