12 #ifndef ROOT_TGeoExtension
13 #define ROOT_TGeoExtension
19 class TGeoExtension :
public TObject
22 TGeoExtension() : TObject() {}
23 virtual ~TGeoExtension() {}
28 virtual TGeoExtension *Grab() = 0;
31 virtual void Release()
const = 0;
33 ClassDef(TGeoExtension, 1)
36 class TGeoRCExtension :
public TGeoExtension
39 virtual ~TGeoRCExtension() {
delete fUserObject;}
41 TGeoRCExtension() : TGeoExtension(), fRC(0), fUserObject(0) {fRC++;}
42 TGeoRCExtension(TObject *obj) : TGeoExtension(), fRC(0), fUserObject(obj) {fRC++;}
44 TGeoExtension *Grab() {fRC++;
return this;}
45 void Release()
const {assert(fRC > 0); fRC--;
if (fRC ==0)
delete this;}
47 void SetUserObject(TObject *obj) {fUserObject = obj;}
48 TObject *GetUserObject()
const {
return fUserObject;}
53 TGeoRCExtension(
const TGeoRCExtension &);
54 TGeoRCExtension &operator =(
const TGeoRCExtension &);
58 ClassDef(TGeoRCExtension, 1)