Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TDSetProxy.cxx
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Maarten Ballintijn 12/03/02
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2001, 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 // TDSetProxy //
15 // //
16 // TDSet proxy for use on slaves. //
17 // //
18 //////////////////////////////////////////////////////////////////////////
19 
20 #include "TDSetProxy.h"
21 #include "TProofServ.h"
22 
23 
24 ClassImp(TDSetProxy);
25 
26 ////////////////////////////////////////////////////////////////////////////////
27 /// Constructor
28 
29 TDSetProxy::TDSetProxy()
30 {
31  fServ = 0;
32 }
33 
34 ////////////////////////////////////////////////////////////////////////////////
35 /// Constructor
36 
37 TDSetProxy::TDSetProxy(const char *type, const char *objname, const char *dir)
38  : TDSet(type,objname,dir)
39 {
40  fServ = 0;
41  fCurrent = 0;
42 }
43 
44 ////////////////////////////////////////////////////////////////////////////////
45 /// Set the reference TProofServ instance
46 
47 void TDSetProxy::SetProofServ(TProofServ *serv)
48 {
49  fServ = serv;
50  fCurrent = 0;
51 }
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /// Reset this instance
55 
56 void TDSetProxy::Reset()
57 {
58  delete fCurrent; fCurrent = 0;
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Get the next packet
63 
64 TDSetElement *TDSetProxy::Next(Long64_t totalEntries)
65 {
66  fCurrent = fServ->GetNextPacket(totalEntries);
67 
68  // Check log file length (before processing the next packet, so we have the
69  // chance to keep the latest logs)
70  fServ->TruncateLogFile();
71 
72  return fCurrent;
73 }