Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 /** \class TVirtualProofPlayer
13 \ingroup proofkernel
14 
15 Abstract interface for the PROOF player.
16 See the concrete implementations under 'proofplayer' for details.
17 
18 */
19 
20 #include "TVirtualProofPlayer.h"
21 #include "TPluginManager.h"
22 #include "TROOT.h"
23 #include "TError.h"
24 
25 ////////////////////////////////////////////////////////////////////////////////
26 /// Create a PROOF player.
27 
28 TVirtualProofPlayer *TVirtualProofPlayer::Create(const char *player,
29  TProof *pr, TSocket *s)
30 {
31  TPluginHandler *h;
32  TVirtualProofPlayer *p = 0;
33 
34  if (!player || !*player) {
35  ::Error("TVirtualProofPlayer::Create", "player name missing");
36  return 0;
37  }
38 
39  if ((h = gROOT->GetPluginManager()->FindHandler("TVirtualProofPlayer", player))) {
40  if (h->LoadPlugin() == -1)
41  return 0;
42  if (!strcmp(player, "slave"))
43  p = (TVirtualProofPlayer *) h->ExecPlugin(1, s);
44  else
45  p = (TVirtualProofPlayer *) h->ExecPlugin(1, pr);
46  }
47 
48  return p;
49 }