1 #ifndef __HCATEGORYMANAGER_H__
2 #define __HCATEGORYMANAGER_H__
24 static HCategory *
getCategory(Short_t num,Int_t warn = 0, TString name =
"");
25 static HCategory *
addCategory(Short_t num,TString name =
"",Int_t size = 1000,TString partev =
"", Bool_t dynamicsize = kFALSE);
27 template<
class T>
static T*
getObject(T* pout,Short_t num = -1, Int_t index = -1,Bool_t silent=kFALSE)
34 if (index < 0 || num < 0) {
return pout; }
39 if(!silent) ::Error(
"getObject()",
"Cannot get category cat num = %i", num);
42 pout = (T*) cat->getObject(index);
44 if(!silent) ::Error(
"getObject()",
"ZERO pointer retrieved for object!");
49 ::Error(
"getObject()",
"ZERO pointer retrieved for event!");
55 template<
class T>
static T*
getObject(T* pout,HCategory* cat = 0, Int_t index = -1,Bool_t silent=kFALSE)
60 if (index < 0 || cat == 0) {
return pout; }
61 pout = (T*) cat->getObject(index);
63 if(!silent) ::Error(
"getObject()",
"ZERO pointer retrieved for object!");
69 template<
class T>
static T*
newObject(T* pout,Short_t num , Int_t& index)
75 if (num < 0) {
return pout; }
80 ::Error(
"newObject()",
"Cannot get category cat num = %i", num);
83 pout = (T*) cat->getNewSlot(loc,&index);
85 ::Error(
"newObject()",
"ZERO pointer retrieved for object!");
91 ::Error(
"newObject()",
"ZERO pointer retrieved for event!");
97 template<
class T>
static T*
newObject(T* pout,HCategory* cat, Int_t& index)
102 if (cat == 0) {
return pout; }
104 pout = (T*) cat->getNewSlot(loc,&index);
106 ::Error(
"newObject()",
"ZERO pointer retrieved for object!");
114 template<
class T>
static T*
newObject(T* pout,
const T* pin,Short_t num , Int_t& index)
121 if (num < 0) {
return pout; }
126 ::Error(
"newObject()",
"Cannot get category cat num = %i", num);
129 pout = (T*) cat->getNewSlot(loc,&index);
131 ::Error(
"newObject()",
"ZERO pointer retrieved for object!");
134 pout =
new (pout) T(*pin);
137 ::Error(
"newObject()",
"ZERO pointer retrieved for event!");
143 template<
class T>
static T*
newObjectCopy(T* pout,T* pin,HCategory* cat, Int_t& index)
149 if (cat == 0) {
return pout; }
151 pout = (T*) cat->getNewSlot(loc,&index);
153 ::Error(
"newObject()",
"ZERO pointer retrieved for object!");
156 pout =
new (pout) T(*pin);
162 template<
class T>
static T*
newSlot(T* pout,Short_t num , Int_t& index)
168 if (num < 0) {
return pout; }
173 ::Error(
"getObject()",
"Cannot get category cat num = %i", num);
176 pout = (T*) cat->getNewSlot(loc,&index);
178 ::Error(
"getObject()",
"ZERO pointer retrieved for object!");
186 template<
class T>
static T*
newSlot(T* pout,HCategory* cat , Int_t& index)
191 if (cat == 0) {
return pout; }
192 pout = (T*) cat->getNewSlot(loc,&index);
194 ::Error(
"newSlot()",
"ZERO pointer retrieved for object!");
204 #endif // __HCATEGORYMANAGER_H__
HCategory * getCategory(Cat_t aCat)
HEvent *& getCurrentEvent(void)
static T * newObject(T *pout, const T *pin, Short_t num, Int_t &index)
static T * getObject(T *pout, Short_t num=-1, Int_t index=-1, Bool_t silent=kFALSE)
static HCategory * getCategory(Short_t num, Int_t warn=0, TString name="")
static T * newObject(T *pout, Short_t num, Int_t &index)
static T * newObject(T *pout, HCategory *cat, Int_t &index)
static T * newSlot(T *pout, HCategory *cat, Int_t &index)
static T * newObjectCopy(T *pout, T *pin, HCategory *cat, Int_t &index)
static T * getObject(T *pout, HCategory *cat=0, Int_t index=-1, Bool_t silent=kFALSE)
static HCategory * addCategory(Short_t num, TString name="", Int_t size=1000, TString partev="", Bool_t dynamicsize=kFALSE)
static T * newSlot(T *pout, Short_t num, Int_t &index)