TJAlienMasterJobStatus.h 2.22 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// @(#)root/alien:$Id$
// Author: Jan Fiete Grosse-Oetringhaus   28/10/2004

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TJAlienMasterJobStatus
#define ROOT_TJAlienMasterJobStatus

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TJAlienMasterJobStatus                                                //
//                                                                      //
// Status of a MasterJob.                                               //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGridJobStatus
#include "TGridJobStatus.h"
#endif
#ifndef ROOT_TMap
#include "TMap.h"
#endif

class TJAlienJobStatus;
class TJAlienMasterJob;


class TJAlienMasterJobStatus : public TGridJobStatus {

friend class TJAlienMasterJob;

private:
    TJAlienJobStatus *fMasterJob;  // Status of the master job
    TMap             fJobs;        // Map which contains the sub jobs,
                                   // key is the job ID, values are
                                   // TJAlienJobStatus objects

public:
    TJAlienMasterJobStatus(const char* jobid) : fMasterJob(0)
        { TString name; name = jobid; SetName(name); SetTitle(name); }
    virtual ~TJAlienMasterJobStatus();

    EGridJobStatus GetStatus() const;
    void Print(Option_t *) const;

    Float_t PercentFinished();

    Bool_t IsFolder() const { return kTRUE; }
    void   Browse(TBrowser *b);
    TMap  *GetJobs() { return &fJobs; }
    Int_t  GetNSubJobs() const { return fJobs.GetSize(); }

    ClassDef(TJAlienMasterJobStatus, 1)  // Status of Alien master job
};

#endif