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
#ifndef TATTELEMENT_H
#define TATTELEMENT_H
//*************************************************************************
//* ===================
//* TAttElement Class
//* ===================
//*
//* (Description)
//* TAttElement class adds constituent attribute to an object.
//* (Requires)
//* none
//* (Provides)
//* class TAttElement
//* (Update Recored)
//* 2003/10/10 K.Fujii Original very primitive version.
//*
//*************************************************************************
//
#include <Rtypes.h>
//_____________________________________________________________________
// --------------------------------
// Base Class for Element Objects
// --------------------------------
//
class TAttElement {
public:
TAttElement() : fParentPtr(0) {}
virtual ~TAttElement() {}
inline virtual const TAttElement & GetParent(Bool_t recur = kTRUE) const;
inline virtual void SetParentPtr(TAttElement *obj) { fParentPtr = obj; }
private:
TAttElement *fParentPtr; // pointer to parent
ClassDef(TAttElement,1) // Base class for lockable objects
};
//_____________________________________________________________________
// --------------------------------
// Inline functions, if any
// --------------------------------
const TAttElement & TAttElement::GetParent(Bool_t recursive) const
{
if (fParentPtr) {
if (recursive) return fParentPtr->GetParent(recursive);
else return *fParentPtr;
} else {
return *this;
}
}
#endif