20 using std::random_shuffle;
21 typedef vector<TObject*> VecTObj;
23 typedef vector<TObject*>::iterator VecTObjIter;
24 typedef vector<TObject*>::const_iterator const_VecTObjIter;
25 typedef VecTObjIter StObjArrayIter;
26 typedef VecTObjIter StStrArrayIter;
27 typedef VecTObjIter StRefArrayIter;
28 typedef const_VecTObjIter const_StObjArrayIter;
29 typedef const_VecTObjIter const_StStrArrayIter;
30 typedef const_VecTObjIter const_StRefArrayIter;
36 class const_VecTObjIter;
40 class const_StObjArrayIter;
41 class const_StStrArrayIter;
42 class const_StRefArrayIter;
54 StObject &operator*() {
return *fLink;}
55 StObject *operator->() {
return fLink;}
59 virtual Bool_t IsFolder()
const {
return 1;}
60 virtual void Browse(TBrowser* b);
70 typedef T element_type;
72 StLink<T> &operator=(T *obj) {fLink=obj;
return *
this;}
74 T &operator*() {
return *((T*)fLink);}
75 T *operator->() {
return (T*)fLink; }
76 const T *operator->()
const {
return (
const T*)fLink; }
77 operator const T *()
const{
return (
const T*)fLink; }
78 operator T *&() {
return ( T*&)fLink; }
91 virtual void Browse(TBrowser *b);
92 void random_shuffle(
int start=0,
int end=0x7fffffff);
93 size_t capacity()
const {
return fV.capacity();}
94 size_t max_size()
const {
return fV.max_size();}
95 void clear() {fV.clear() ;}
96 void pop_back() {fV.pop_back() ;}
97 int empty()
const {
return fV.empty() ;}
98 size_t size ()
const {
return fV.size() ;}
99 void reserve(
size_t sz) {fV.reserve(sz) ;}
100 void resize(
size_t sz,TObject *v=0) {fV.resize(sz,v);}
101 virtual Bool_t IsFolder()
const;
102 TObject * &at(
int i) {
return fV[i];}
103 void put_at(TObject *obj,
int i){fV[i]=obj;}
105 TObject *
const &front()
const {
return fV.front();}
106 TObject * &front() {
return fV.front();}
108 TObject *
const &back()
const {
return fV.back();}
109 TObject * &back() {
return fV.back();}
110 TObject * find(
const char *name)
const;
113 const_VecTObjIter begin()
const {
return fV.begin();}
114 VecTObjIter begin() {
return fV.begin();}
115 const_VecTObjIter end()
const {
return fV.end();}
116 VecTObjIter end() {
return fV.end();}
117 TObject** Erase(TObject** it ,
int del);
118 TObject** Erase(TObject** fst,TObject** lst,
int del);
121 TObject *& operator[](Int_t i) {return fV[i];}
122 TObject *
const &
operator[](Int_t i)
const {
return fV[i];}
123 void push_back(
const TObject *
const to){fV.push_back((TObject*)to);}
124 Int_t getEntries()
const;
125 void ls(
const char *tit=
"")
const;
126 void Print(
const char *tit=
"")
const { ls(tit); }
146 void push_back(
const TObject *to);
147 void put_at(TObject *obj,
int i);
149 virtual void makeZombie(
int flg);
169 #define StCollectionDef(QWERTY) \
171 typedef St ## QWERTY** St ## QWERTY ## Iterator;\
172 typedef St ## QWERTY * const * const_St ## QWERTY ## Iterator;\
174 class StPtrVec ## QWERTY : public StRefArray \
177 StPtrVec ## QWERTY(Int_t sz=0):StRefArray(sz){};\
178 StPtrVec ## QWERTY(const StPtrVec ## QWERTY &from):StRefArray(from){};\
179 virtual ~StPtrVec ## QWERTY(){};\
181 St ## QWERTY * const &at(Int_t idx) const {return (St ## QWERTY * const &)fV[idx];}\
182 St ## QWERTY * &at(Int_t idx) {return (St ## QWERTY * &)fV[idx];}\
184 St ## QWERTY * const &front() const {return (St ## QWERTY * const &)fV.front();}\
185 St ## QWERTY * &front() {return (St ## QWERTY * &)fV.front();}\
187 St ## QWERTY * const &back() const {return (St ## QWERTY * const &)fV.back();}\
188 St ## QWERTY * &back() {return (St ## QWERTY * &)fV.back();}\
190 const_St ## QWERTY ## Iterator begin() const {return (const_St ## QWERTY ## Iterator)&(*(fV.begin()));}\
191 St ## QWERTY ## Iterator begin() {return ( St ## QWERTY ## Iterator)&(*(fV.begin()));}\
192 const_St ## QWERTY ## Iterator end() const {return (const_St ## QWERTY ## Iterator)&(*(fV.end()));}\
193 St ## QWERTY ## Iterator end() {return ( St ## QWERTY ## Iterator)&(*(fV.end()));}\
194 St ## QWERTY ## Iterator erase(St ## QWERTY ## Iterator it)\
195 {return (St ## QWERTY ## Iterator)Erase((TObject**)it,0);}\
196 St ## QWERTY ## Iterator erase(St ## QWERTY ## Iterator fst,St ## QWERTY ## Iterator lst)\
197 {return (St ## QWERTY ## Iterator)Erase((TObject**)fst,(TObject**)lst,0);}\
198 St ## QWERTY * &operator[](Int_t i) {return at(i);}\
199 St ## QWERTY * const &operator[](Int_t i) const {return at(i);}\
200 void push_back(const St ## QWERTY * const to){fV.push_back((TObject*const)to);}\
202 ClassDef(StPtrVec ## QWERTY ,1) \
206 class StSPtrVec ## QWERTY : public StStrArray \
209 StSPtrVec ## QWERTY(Int_t sz=0):StStrArray(sz){};\
210 StSPtrVec ## QWERTY(const StSPtrVec ## QWERTY &from):StStrArray(from){};\
212 St ## QWERTY * const &at(Int_t idx) const {return (St ## QWERTY * const &)fV[idx];}\
213 St ## QWERTY * &at(Int_t idx) {return (St ## QWERTY * &)fV[idx];}\
215 St ## QWERTY * const &front() const {return (St ## QWERTY * const &)fV.front();}\
216 St ## QWERTY * &front() {return (St ## QWERTY * &)fV.front();}\
218 St ## QWERTY * const &back() const {return (St ## QWERTY * const &)fV.back();}\
219 St ## QWERTY * &back() {return (St ## QWERTY * &)fV.back();}\
221 const_St ## QWERTY ## Iterator begin() const {return (const_St ## QWERTY ## Iterator)&(*(fV.begin()));}\
222 St ## QWERTY ## Iterator begin() {return ( St ## QWERTY ## Iterator)&(*(fV.begin()));}\
223 const_St ## QWERTY ## Iterator end() const {return (const_St ## QWERTY ## Iterator)&(*(fV.end()));}\
224 St ## QWERTY ## Iterator end() {return ( St ## QWERTY ## Iterator)&(*(fV.end()));}\
225 St ## QWERTY ## Iterator erase(St ## QWERTY ## Iterator it)\
226 {return (St ## QWERTY ## Iterator)Erase((TObject**)it,1);}\
227 St ## QWERTY ## Iterator erase(St ## QWERTY ## Iterator fst,St ## QWERTY ## Iterator lst)\
228 {return (St ## QWERTY ## Iterator)Erase((TObject**)fst,(TObject**)lst,1);}\
229 St ## QWERTY * &operator[](Int_t i) {return at(i);}\
230 St ## QWERTY * const &operator[](Int_t i) const {return at(i);}\
231 void push_back(const St ## QWERTY *to){StStrArray::push_back((TObject*)to);}\
233 ClassDef(StSPtrVec ## QWERTY,1) \
235 typedef St ## QWERTY ## Iterator StPtrVec ## QWERTY ## Iterator;\
236 typedef const_St ## QWERTY ## Iterator StPtrVec ## QWERTY ## ConstIterator;\
237 typedef St ## QWERTY ## Iterator StSPtrVec ## QWERTY ## Iterator;\
238 typedef const_St ## QWERTY ## Iterator StSPtrVec ## QWERTY ## ConstIterator;\
241 #define StCollectionImp(QWERTY) \
243 ClassImpUnique(StPtrVec ## QWERTY ,1 ) \
244 void StPtrVec ## QWERTY::Streamer(TBuffer& b){StRefArray::Streamer(b);} \
246 ClassImpUnique(StSPtrVec ## QWERTY , 2 ) \
248 void StSPtrVec ## QWERTY::Streamer(TBuffer& b){StStrArray::Streamer(b);} \
TObject *& operator[](Int_t i)