Geant4 11.1.1
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
}
 
typedef G4FastList< OBJECT > list
 

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 232 of file G4FastList.hh.

Member Typedef Documentation

◆ list

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

Definition at line 244 of file G4FastList.hh.

Member Enumeration Documentation

◆ Priority

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

Definition at line 235 of file G4FastList.hh.

Constructor & Destructor Documentation

◆ Watcher()

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

Definition at line 246 of file G4FastList.hh.

247 {
249 }

◆ ~Watcher()

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

Definition at line 251 of file G4FastList.hh.

252 {
253 typename std::set<G4FastList<OBJECT>*>::iterator it = fWatching.begin();
254 typename std::set<G4FastList<OBJECT>*>::iterator end = fWatching.end();
255 for(;it!=end;it++)
256 {
257 (*it)->RemoveWatcher(this);
258 }
259 }
iterator end()
G4FastList_iterator< OBJECT > iterator
Definition: G4FastList.hh:321

Member Function Documentation

◆ GetPriority()

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

Definition at line 265 of file G4FastList.hh.

265 {
266 return fPriority;
267 }

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 261 of file G4FastList.hh.

261 {
262 return "";
263 }

◆ NotifyAddObject()

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

Definition at line 274 of file G4FastList.hh.

274{;}

◆ NotifyDeletingList()

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

Definition at line 271 of file G4FastList.hh.

271{;}

◆ NotifyRemoveObject()

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

Definition at line 275 of file G4FastList.hh.

275{;}

◆ StopWatching()

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

Definition at line 286 of file G4FastList.hh.

287 {
288 typename std::set<G4FastList<OBJECT>*>::iterator it = fWatching.find(fastList);
289 if(it == fWatching.end()) return; //TODO: exception?
290 fWatching.erase(it);
291 if(removeWatcher) fastList->RemoveWatcher(this);
292 }
void RemoveWatcher(Watcher *watcher)
Definition: G4FastList.hh:343

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

◆ Watch()

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

Definition at line 280 of file G4FastList.hh.

281 {
282 fWatching.insert(fastList);
283 fastList->AddWatcher(this);
284 }
void AddWatcher(Watcher *watcher)
Definition: G4FastList.hh:338

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: