fixed compiler problem
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisDataSlot.h
CommitLineData
d3106602 1#ifndef ALIANALYSISDATASLOT_H
2#define ALIANALYSISDATASLOT_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7// Author: Andrei Gheata, 31/05/2006
8
9//==============================================================================
10// AliAnalysysDataSlot - Class representing a data slot of an analysis task.
11// An analysis slot enforces a certain data type required by the Exec()
12// method of the analysis task. The slot must be connected to a data
13// container with data of the same type.
14//==============================================================================
15
16#ifndef ROOT_TObject
17#include "TObject.h"
18#endif
19
20class TClass;
21class AliAnalysisDataContainer;
22class AliAnalysisTask;
23
24class AliAnalysisDataSlot : public TObject {
25
26public:
37a26056 27 AliAnalysisDataSlot() : fType(NULL), fParent(NULL), fContainer(NULL) {}
28 AliAnalysisDataSlot(TClass *type, AliAnalysisTask *task) : fType(type), fParent(task), fContainer(NULL) {}
29 AliAnalysisDataSlot(const AliAnalysisDataSlot &slot) : TObject(), fType(slot.fType), fParent(slot.fParent), fContainer(slot.fContainer) {}
30 virtual ~AliAnalysisDataSlot() {}
31
32 // Assignment
33 AliAnalysisDataSlot &operator=(const AliAnalysisDataSlot &slot);
d3106602 34 // Connect some container to the slot
35 Bool_t ConnectContainer(AliAnalysisDataContainer *cont);
36 // Getters
327eaf46 37 void *GetBranchAddress(const char *branch) const;
38 Bool_t SetBranchAddress(const char *branch, void *address);
d3106602 39 TClass *GetType() const {return fType;}
40 AliAnalysisTask *GetParent() const {return fParent;}
41 AliAnalysisDataContainer *GetContainer() const {return fContainer;}
42 TObject *GetData() const;
43 // Slot status checking
44 Bool_t IsConnected() const {return ((fContainer)?kTRUE:kFALSE);}
45 Bool_t IsDataReady() const;
46
47protected:
48 TClass *fType; // Data type required by the slot
49 AliAnalysisTask *fParent; // Analysis task to which the slot belongs
50 AliAnalysisDataContainer *fContainer; // Container connected to the slot
51
52 ClassDef(AliAnalysisDataSlot,1) // Class describing an analysis data slot
53};
54#endif