Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 234 of file G4FastList.hh.

Member Typedef Documentation

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

Definition at line 246 of file G4FastList.hh.

Member Enumeration Documentation

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

Definition at line 237 of file G4FastList.hh.

Constructor & Destructor Documentation

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

Definition at line 248 of file G4FastList.hh.

249  {
250  fPriority = Priority::eVeryLow;
251  }
template<class OBJECT>
virtual G4FastList< OBJECT >::Watcher::~Watcher ( )
inlinevirtual

Definition at line 253 of file G4FastList.hh.

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

Member Function Documentation

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

Definition at line 267 of file G4FastList.hh.

267  {
268  return fPriority;
269  }

Here is the caller graph for this function:

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

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

Definition at line 263 of file G4FastList.hh.

263  {
264  return "";
265  }

Here is the caller graph for this function:

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

Definition at line 276 of file G4FastList.hh.

276 {;}
template<class OBJECT>
void G4FastList< OBJECT >::Watcher::NotifyDeletingList ( G4FastList< OBJECT > *  )
inline

Definition at line 273 of file G4FastList.hh.

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

Definition at line 277 of file G4FastList.hh.

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

Definition at line 288 of file G4FastList.hh.

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

Here is the caller graph for this function:

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

Definition at line 282 of file G4FastList.hh.

283  {
284  fWatching.insert(fastList);
285  fastList->AddWatcher(this);
286  }
void AddWatcher(Watcher *watcher)
Definition: G4FastList.hh:340

Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 297 of file G4FastList.hh.


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