33 #ifndef G4MANYFASTLISTS_HH_
34 #define G4MANYFASTLISTS_HH_
38 template<
class OBJECT>
44 template<
class OBJECT>
64 fAssociatedLists.
pop(__list);
69 if (__list == 0)
return;
88 if (__list == 0)
return;
89 fAssociatedLists.
pop(__list);
100 inline bool Holds(OBJECT* __track)
const
104 for (; __it != __end; __it++)
105 if ((*__it)->Holds(__track))
return true;
116 for (; __it != __end; __it++)
118 __size += (*__it)->size();
127 for (; __it != __end; __it++)
146 fAssociatedLists.
clear();
153 for (; __it != __end; __it++)
154 if (*__it) (*__it)->clear();
157 inline iterator
begin();
158 inline iterator
end();
163 template<
class OBJECT>
178 fIterator(), fLists(0)
186 ManyLists* __lists) :
187 fIterator(__x), fCurrentListIt(__it), fLists(__lists)
192 fIterator(__x.fIterator),
193 fCurrentListIt(__x.fCurrentListIt),
241 if (fCurrentListIt == fLists->
begin())
243 if (fIterator == (*fCurrentListIt)->begin())
250 if (fCurrentListIt == fLists->
end())
253 fIterator = (*fCurrentListIt)->end();
255 else if (fIterator == (*fCurrentListIt)->begin())
258 fIterator = (*fCurrentListIt)->end();
263 while (((*fCurrentListIt)->empty() || fIterator.
GetNode() == 0
265 && fCurrentListIt != fLists->
begin())
267 fIterator = (*fCurrentListIt)->begin();
269 fIterator = (*fCurrentListIt)->end();
273 if (fIterator.
GetNode() == 0 && fCurrentListIt == fLists->
begin())
300 if (fLists->
empty() ==
false)
302 fIterator = (*(fLists->
end()--))->end();
311 template<
class OBJECT>
314 if (fAssociatedLists.empty())
317 fAssociatedLists.end(),
329 if (*it && (*it)->empty() ==
false)
331 trackList_it = (*it)->begin();
338 if (i == fAssociatedLists.size() || it == _end)
349 template<
class OBJECT>
352 if (fAssociatedLists.empty())
355 fAssociatedLists.end(),
360 fAssociatedLists.end(),
G4ManyFastLists_iterator _Self
G4FastList is used by G4TrackHolder to save G4IT tracks only.
void AddWatcher(Watcher *watcher)
void Remove(G4FastList< OBJECT > *__list)
G4FastList_iterator enables to go through the tracks contained by a list.
G4FastList< G4FastList< OBJECT > > ManyLists
G4ManyFastLists< OBJECT > * GetTrackList()
const OBJECT * operator*() const
G4ManyFastLists_iterator()
virtual void NotifyDeletingList(G4FastList< OBJECT > *__list)
void Add(G4FastList< OBJECT > *__list)
G4ManyFastLists_iterator(G4FastList_iterator< OBJECT > __x, typename ManyLists::iterator __it, ManyLists *__lists)
void clear()
Complexity = linear in size between __first and __last.
ManyLists::iterator fCurrentListIt
const OBJECT * operator->() const
G4FastListNode< OBJECT > _Node
G4FastList< G4FastList< OBJECT > > ManyLists
_Self UpdateToNextValidList()
void RemoveWatcher(Watcher *watcher)
bool operator!=(const _Self &__x) const
G4ManyFastLists_iterator< OBJECT > iterator
void push_back(OBJECT *__track)
bool Holds(OBJECT *__track) const
void SetListNode(G4FastListNode< G4FastList< OBJECT > > *__node)
virtual ~G4ManyFastLists()
ManyLists fAssociatedLists
G4ManyFastLists_iterator(const G4ManyFastLists_iterator &__x)
void StopWatching(G4FastList< OBJECT > *fastList, bool removeWatcher=true)
G4FastList_iterator enables to go through the tracks contained by a list.
G4FastList_iterator< OBJECT > fIterator
void Watch(G4FastList< OBJECT > *fastList)
bool operator==(const _Self &__x) const