Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4FastList< OBJECT >::Watcher Class Reference

#include <G4FastList.hh>

+ Inheritance diagram for G4FastList< OBJECT >::Watcher:

Public Types

enum  Priority {
  eExtreme , eHigh , eNormal , eLow ,
  eVeryLow
}
 
using list = G4FastList<OBJECT>
 

Public Member Functions

 Watcher ()
 
virtual ~Watcher ()
 
virtual G4String GetWatcherName ()
 
Priority GetPriority () const
 
void NotifyDeletingList (G4FastList< OBJECT > *)
 
virtual void NotifyAddObject (OBJECT *, G4FastList< OBJECT > *)
 
virtual void NotifyRemoveObject (OBJECT *, G4FastList< OBJECT > *)
 
void Watch (G4FastList< OBJECT > *fastList)
 
void StopWatching (G4FastList< OBJECT > *fastList, bool removeWatcher=true)
 

Protected Attributes

Priority fPriority
 

Detailed Description

template<class OBJECT>
class G4FastList< OBJECT >::Watcher

Definition at line 231 of file G4FastList.hh.

Member Typedef Documentation

◆ list

template<class OBJECT >
using G4FastList< OBJECT >::Watcher::list = G4FastList<OBJECT>

Definition at line 243 of file G4FastList.hh.

Member Enumeration Documentation

◆ Priority

template<class OBJECT >
enum G4FastList::Watcher::Priority
Enumerator
eExtreme 
eHigh 
eNormal 
eLow 
eVeryLow 

Definition at line 234 of file G4FastList.hh.

Constructor & Destructor Documentation

◆ Watcher()

template<class OBJECT >
G4FastList< OBJECT >::Watcher::Watcher ( )
inline

Definition at line 245 of file G4FastList.hh.

246 {
248 }

◆ ~Watcher()

template<class OBJECT >
virtual G4FastList< OBJECT >::Watcher::~Watcher ( )
inlinevirtual

Definition at line 250 of file G4FastList.hh.

251 {
252 auto it = fWatching.begin();
253 auto end = fWatching.end();
254 for(;it!=end;it++)
255 {
256 (*it)->RemoveWatcher(this);
257 }
258 }
iterator end()

Member Function Documentation

◆ GetPriority()

template<class OBJECT >
Priority G4FastList< OBJECT >::Watcher::GetPriority ( ) const
inline

Definition at line 264 of file G4FastList.hh.

264 {
265 return fPriority;
266 }

Referenced by sortWatcher< OBJECT >::operator()().

◆ GetWatcherName()

template<class OBJECT >
virtual G4String G4FastList< OBJECT >::Watcher::GetWatcherName ( )
inlinevirtual

Reimplemented in G4FastList< OBJECT >::TWatcher< WATCHER_TYPE >.

Definition at line 260 of file G4FastList.hh.

260 {
261 return "";
262 }

◆ NotifyAddObject()

template<class OBJECT >
virtual void G4FastList< OBJECT >::Watcher::NotifyAddObject ( OBJECT * ,
G4FastList< OBJECT > *  )
inlinevirtual

Definition at line 273 of file G4FastList.hh.

273{;}

◆ NotifyDeletingList()

template<class OBJECT >
void G4FastList< OBJECT >::Watcher::NotifyDeletingList ( G4FastList< OBJECT > * )
inline

Definition at line 270 of file G4FastList.hh.

270{;}

◆ NotifyRemoveObject()

template<class OBJECT >
virtual void G4FastList< OBJECT >::Watcher::NotifyRemoveObject ( OBJECT * ,
G4FastList< OBJECT > *  )
inlinevirtual

Definition at line 274 of file G4FastList.hh.

274{;}

◆ StopWatching()

template<class OBJECT >
void G4FastList< OBJECT >::Watcher::StopWatching ( G4FastList< OBJECT > * fastList,
bool removeWatcher = true )
inline

Definition at line 285 of file G4FastList.hh.

286 {
287 auto it = fWatching.find(fastList);
288 if(it == fWatching.end()) return; //TODO: exception?
289 fWatching.erase(it);
290 if(removeWatcher) fastList->RemoveWatcher(this);
291 }
void RemoveWatcher(Watcher *watcher)

Referenced by G4ManyFastLists< OBJECT >::Remove().

◆ Watch()

template<class OBJECT >
void G4FastList< OBJECT >::Watcher::Watch ( G4FastList< OBJECT > * fastList)
inline

Definition at line 279 of file G4FastList.hh.

280 {
281 fWatching.insert(fastList);
282 fastList->AddWatcher(this);
283 }
void AddWatcher(Watcher *watcher)

Referenced by G4ManyFastLists< OBJECT >::Add(), and G4ManyFastLists< OBJECT >::AddGlobalWatcher().

Member Data Documentation

◆ fPriority

template<class OBJECT >
Priority G4FastList< OBJECT >::Watcher::fPriority
protected

The documentation for this class was generated from the following file: