33 #ifndef G4MANYFASTLISTS_HH_
34 #define G4MANYFASTLISTS_HH_
39 template<
class OBJECT>
45 template<
class OBJECT>
53 typedef std::set<typename G4FastList<OBJECT>::Watcher*,
86 for(;it != _end ;++it)
96 if (__list == 0)
return;
110 for(;it_watcher != end_watcher ;++it_watcher)
115 (*it_watcher)->Watch(__list);
118 if(__list->
empty() ==
false)
122 for(;it_watcher != end_watcher ;++it_watcher)
125 for(;it_obj != __list->
end() ;++it_obj)
131 (*it_watcher)->NotifyAddObject(*it_obj,__list);
154 if (__list == 0)
return;
162 for(;it != _end ;++it)
164 (*it)->StopWatching(__list);
175 inline bool Holds(OBJECT* __track)
const
179 for (; __it != __end; __it++)
180 if ((*__it)->Holds(__track))
return true;
191 for (; __it != __end; __it++)
193 __size += (*__it)->size();
202 for (; __it != __end; __it++)
228 for (; __it != __end; __it++)
229 if (*__it) (*__it)->clear();
238 template<
class OBJECT>
318 if (
fIterator == (*fCurrentListIt)->begin())
330 else if (
fIterator == (*fCurrentListIt)->begin())
338 while (((*fCurrentListIt)->empty() ||
fIterator.GetNode() == 0
339 ||
fIterator.GetNode()->GetObject() == 0)
386 template<
class OBJECT>
389 if (fAssociatedLists.empty())
392 fAssociatedLists.end(),
404 if (*it && (*it)->empty() ==
false)
406 trackList_it = (*it)->begin();
413 if (i == fAssociatedLists.size() || it == _end)
424 template<
class OBJECT>
427 if (fAssociatedLists.empty())
430 fAssociatedLists.end(),
435 fAssociatedLists.end(),
439 #include "G4ManyFastLists.icc"
G4ManyFastLists_iterator _Self
virtual void NotifyDeletingList(G4FastList< OBJECT > *__list)
const OBJECT * operator*() const
void Add(G4FastList< OBJECT > *__list)
bool Holds(OBJECT *__track) const
G4ManyFastLists_iterator(G4FastList_iterator< OBJECT > __x, typename ManyLists::iterator __it, ManyLists *__lists)
WatcherSet * fMainListWatchers
G4GLOB_DLL std::ostream G4cout
ManyLists::iterator fCurrentListIt
virtual G4String GetWatcherName()
ManyLists fAssociatedLists
const OBJECT * operator->() const
G4FastListNode< OBJECT > _Node
G4FastList< G4FastList< OBJECT > > ManyLists
G4ManyFastLists_iterator< OBJECT > iterator
virtual ~G4ManyFastLists()
_Self UpdateToNextValidList()
void Remove(G4FastList< OBJECT > *__list)
void SetListNode(G4FastListNode< G4FastList< OBJECT > > *__node)
G4FastList< OBJECT > * GetTrackList()
bool operator!=(const _Self &__x) const
std::set< typename G4FastList< OBJECT >::Watcher *, sortWatcher< OBJECT > > WatcherSet
void push_back(OBJECT *__track)
void RemoveWatcher(Watcher *watcher)
G4ManyFastLists_iterator(const G4ManyFastLists_iterator &__x)
void StopWatching(G4FastList< OBJECT > *fastList, bool removeWatcher=true)
G4FastList_iterator< OBJECT > fIterator
void Watch(G4FastList< OBJECT > *fastList)
bool operator==(const _Self &__x) const
G4FastList< G4FastList< OBJECT > > ManyLists
void AddGlobalWatcher(typename G4FastList< OBJECT >::Watcher *watcher)