23 #ifndef ADF_StackOfObjects
24 #define ADF_StackOfObjects
49 UShort_t fCurrentSize;
54 fStack(), fCurrentSize(0), fMaxSize(max_size) {;}
64 T *
New(Bool_t do_reset =
true);
70 T *
At(UShort_t i)
const
72 if ( i < fCurrentSize )
86 Bool_t
SetSize(UShort_t how_many, Bool_t do_reset =
true)
90 { fCurrentSize = 0u;
return true; }
99 fCurrentSize = how_many;
102 if ( do_reset ==
true ) {
103 for (UShort_t i = 0u; i <
GetSize(); i++ )
109 UShort_t toadd = how_many -
GetSize();
110 for (UShort_t i = 0u; i < toadd; i++ )
117 {
return fCurrentSize; }
129 { fCurrentSize = 0u; }
135 if ( fCurrentSize < fStack.GetSize() ) {
136 t = fStack.At(fCurrentSize);
144 if ( fCurrentSize < fMaxSize ) {
146 fStack.Add(t); fCurrentSize++;
T * At(UShort_t i) const
To get the object at slot #i.
UShort_t GetSize() const
To know the current size of the stack.
void Reset()
Reset the stack.
to set informations about the ADF configuration
Bool_t SetSize(UShort_t how_many, Bool_t do_reset=true)
Change the current size.
StackOfObjects(UShort_t max_size=100u)
Stack of pointers to ADFObjects.
UShort_t GetMaxSize() const
To know the max size of the stack.
T * New(Bool_t do_reset=true)
It pops up a new object on the top of the stack.