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

#include <G4FastList.hh>

Classes

class  TWatcher
 
class  Watcher
 

Public Types

typedef OBJECT object
 
typedef G4FastList_iterator< OBJECT > iterator
 
typedef G4FastList_const_iterator< OBJECT > const_iterator
 
typedef G4FastListNode< OBJECT > node
 

Public Member Functions

 G4FastList ()
 
 ~G4FastList ()
 
void SetListNode (G4FastListNode< G4FastList< OBJECT > > *__node)
 
G4FastListNode< G4FastList< OBJECT > > * GetListNode ()
 
void AddWatcher (Watcher *watcher)
 
void RemoveWatcher (Watcher *watcher)
 
OBJECT * back ()
 
G4int size () const
 
bool empty () const
 
iterator insert (iterator, OBJECT *)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
bool Holds (const OBJECT *) const
 
void push_front (OBJECT *__track)
 
void push_back (OBJECT *__track)
 
OBJECT * pop_back ()
 
void remove (OBJECT *)
 
iterator pop (OBJECT *)
 
iterator pop (G4FastListNode< OBJECT > *)
 
iterator pop (iterator __first, iterator __last)
 
iterator erase (OBJECT *)
 
iterator erase (iterator __first, iterator __last)
 
void clear ()
 
void transferTo (G4FastList< OBJECT > *)
 

Static Public Member Functions

static G4FastListNode< OBJECT > * GetNode (OBJECT *)
 
static void SetNode (OBJECT *__obj, G4FastListNode< OBJECT > *__node)
 
static G4FastList< OBJECT > * GetList (OBJECT *)
 
static G4FastList< OBJECT > * GetList (G4FastListNode< OBJECT > *__trackListNode)
 
static void Pop (OBJECT *)
 

Protected Types

typedef std::set< typename G4FastList< OBJECT >::Watcher *, sortWatcher< OBJECT > > WatcherSet
 

Protected Member Functions

G4FastListNode< OBJECT > * CreateNode (OBJECT *)
 
G4FastListNode< OBJECT > * Flag (OBJECT *)
 
G4FastListNode< OBJECT > * Unflag (OBJECT *)
 
void Unflag (G4FastListNode< OBJECT > *__trackListNode)
 
void CheckFlag (G4FastListNode< OBJECT > *)
 
void DeleteObject (OBJECT *)
 
void Hook (G4FastListNode< OBJECT > *, G4FastListNode< OBJECT > *)
 
void Unhook (G4FastListNode< OBJECT > *)
 
G4FastListNode< OBJECT > * EraseListNode (OBJECT *)
 

Static Protected Member Functions

static G4FastListNode< OBJECT > * __GetNode (OBJECT *)
 

Protected Attributes

G4int fNbObjects
 
G4shared_ptr< _ListRef< G4FastList< OBJECT > > > fListRef
 
G4FastListNode< OBJECT > fBoundary
 
WatcherSet fWatchers
 
G4FastListNode< G4FastList< OBJECT > > * fpNodeInManyLists
 

Detailed Description

template<class OBJECT>
class G4FastList< OBJECT >

G4FastList is used by G4TrackHolder to save G4IT tracks only. Its advantage lies to a fast search of a track in this list.

Definition at line 218 of file G4FastList.hh.

Member Typedef Documentation

◆ const_iterator

template<class OBJECT >
typedef G4FastList_const_iterator<OBJECT> G4FastList< OBJECT >::const_iterator

Definition at line 322 of file G4FastList.hh.

◆ iterator

template<class OBJECT >
typedef G4FastList_iterator<OBJECT> G4FastList< OBJECT >::iterator

Definition at line 321 of file G4FastList.hh.

◆ node

template<class OBJECT >
typedef G4FastListNode<OBJECT> G4FastList< OBJECT >::node

Definition at line 323 of file G4FastList.hh.

◆ object

template<class OBJECT >
typedef OBJECT G4FastList< OBJECT >::object

Definition at line 320 of file G4FastList.hh.

◆ WatcherSet

template<class OBJECT >
typedef std::set<typename G4FastList<OBJECT>::Watcher*, sortWatcher<OBJECT> > G4FastList< OBJECT >::WatcherSet
protected

Definition at line 315 of file G4FastList.hh.

Constructor & Destructor Documentation

◆ G4FastList()

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

◆ ~G4FastList()

template<class OBJECT >
G4FastList< OBJECT >::~G4FastList ( )

Member Function Documentation

◆ __GetNode()

template<class OBJECT >
static G4FastListNode< OBJECT > * G4FastList< OBJECT >::__GetNode ( OBJECT *  )
staticprotected

◆ AddWatcher()

template<class OBJECT >
void G4FastList< OBJECT >::AddWatcher ( Watcher watcher)
inline

Definition at line 338 of file G4FastList.hh.

339 {
340 fWatchers.insert(watcher);
341 }
WatcherSet fWatchers
Definition: G4FastList.hh:316

Referenced by G4ITTrackHolder::AddWatcher(), and G4FastList< OBJECT >::Watcher::Watch().

◆ back()

template<class OBJECT >
OBJECT * G4FastList< OBJECT >::back ( )
inline

Definition at line 350 of file G4FastList.hh.

351 {
352// if (fNbObjects != 0) return fpFinish->GetObject();
353 if (fNbObjects != 0) return fBoundary.GetPrevious()->GetObject();
354 else return 0;
355 }
G4int fNbObjects
Definition: G4FastList.hh:221
G4FastListNode< OBJECT > fBoundary
Definition: G4FastList.hh:226

◆ begin() [1/2]

◆ begin() [2/2]

template<class OBJECT >
const_iterator G4FastList< OBJECT >::begin ( ) const
inline

◆ CheckFlag()

template<class OBJECT >
void G4FastList< OBJECT >::CheckFlag ( G4FastListNode< OBJECT > *  )
protected

◆ clear()

template<class OBJECT >
void G4FastList< OBJECT >::clear ( )

Complexity = linear in size between __first and __last

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

◆ CreateNode()

template<class OBJECT >
G4FastListNode< OBJECT > * G4FastList< OBJECT >::CreateNode ( OBJECT *  )
protected

◆ DeleteObject()

template<class OBJECT >
void G4FastList< OBJECT >::DeleteObject ( OBJECT *  )
protected

◆ empty()

◆ end() [1/2]

◆ end() [2/2]

template<class OBJECT >
const_iterator G4FastList< OBJECT >::end ( ) const
inline

◆ erase() [1/2]

template<class OBJECT >
iterator G4FastList< OBJECT >::erase ( iterator  __first,
iterator  __last 
)

Complexity = constant By storing the node inside the object, we avoid searching through all the container.

◆ erase() [2/2]

template<class OBJECT >
iterator G4FastList< OBJECT >::erase ( OBJECT *  )

◆ EraseListNode()

template<class OBJECT >
G4FastListNode< OBJECT > * G4FastList< OBJECT >::EraseListNode ( OBJECT *  )
protected

◆ Flag()

template<class OBJECT >
G4FastListNode< OBJECT > * G4FastList< OBJECT >::Flag ( OBJECT *  )
protected

◆ GetList() [1/2]

template<class OBJECT >
static G4FastList< OBJECT > * G4FastList< OBJECT >::GetList ( G4FastListNode< OBJECT > *  __trackListNode)
static

◆ GetList() [2/2]

template<class OBJECT >
static G4FastList< OBJECT > * G4FastList< OBJECT >::GetList ( OBJECT *  )
static

◆ GetListNode()

template<class OBJECT >
G4FastListNode< G4FastList< OBJECT > > * G4FastList< OBJECT >::GetListNode ( )
inline

Definition at line 333 of file G4FastList.hh.

334 {
335 return fpNodeInManyLists;
336 }
G4FastListNode< G4FastList< OBJECT > > * fpNodeInManyLists
Definition: G4FastList.hh:317

Referenced by PriorityList::PushToListOfSecondaries().

◆ GetNode()

template<class OBJECT >
static G4FastListNode< OBJECT > * G4FastList< OBJECT >::GetNode ( OBJECT *  )
static

Complexity = constant

◆ Holds()

template<class OBJECT >
bool G4FastList< OBJECT >::Holds ( const OBJECT *  ) const

return an iterator that contains an empty node use for boundary checking only

◆ Hook()

template<class OBJECT >
void G4FastList< OBJECT >::Hook ( G4FastListNode< OBJECT > *  ,
G4FastListNode< OBJECT > *   
)
protected

◆ insert()

template<class OBJECT >
iterator G4FastList< OBJECT >::insert ( iterator  ,
OBJECT *   
)

◆ pop() [1/3]

template<class OBJECT >
iterator G4FastList< OBJECT >::pop ( G4FastListNode< OBJECT > *  )

◆ pop() [2/3]

template<class OBJECT >
iterator G4FastList< OBJECT >::pop ( iterator  __first,
iterator  __last 
)

◆ pop() [3/3]

template<class OBJECT >
iterator G4FastList< OBJECT >::pop ( OBJECT *  )

◆ Pop()

template<class OBJECT >
static void G4FastList< OBJECT >::Pop ( OBJECT *  )
static

◆ pop_back()

template<class OBJECT >
OBJECT * G4FastList< OBJECT >::pop_back ( )

◆ push_back()

◆ push_front()

template<class OBJECT >
void G4FastList< OBJECT >::push_front ( OBJECT *  __track)
inline

◆ remove()

template<class OBJECT >
void G4FastList< OBJECT >::remove ( OBJECT *  )

◆ RemoveWatcher()

template<class OBJECT >
void G4FastList< OBJECT >::RemoveWatcher ( Watcher watcher)
inline

Definition at line 343 of file G4FastList.hh.

344 {
345 typename WatcherSet::iterator it = fWatchers.find(watcher);
346 if(it == fWatchers.end()) return; //TODO: exception?
347 fWatchers.erase(it);
348 }

Referenced by G4ManyFastLists< OBJECT >::Remove(), and G4FastList< OBJECT >::Watcher::StopWatching().

◆ SetListNode()

template<class OBJECT >
void G4FastList< OBJECT >::SetListNode ( G4FastListNode< G4FastList< OBJECT > > *  __node)
inline

Definition at line 328 of file G4FastList.hh.

329 {
330 fpNodeInManyLists = __node;
331 }

◆ SetNode()

template<class OBJECT >
static void G4FastList< OBJECT >::SetNode ( OBJECT *  __obj,
G4FastListNode< OBJECT > *  __node 
)
static

◆ size()

template<class OBJECT >
G4int G4FastList< OBJECT >::size ( ) const
inline

◆ transferTo()

template<class OBJECT >
void G4FastList< OBJECT >::transferTo ( G4FastList< OBJECT > *  )

◆ Unflag() [1/2]

template<class OBJECT >
void G4FastList< OBJECT >::Unflag ( G4FastListNode< OBJECT > *  __trackListNode)
protected

◆ Unflag() [2/2]

template<class OBJECT >
G4FastListNode< OBJECT > * G4FastList< OBJECT >::Unflag ( OBJECT *  )
protected

◆ Unhook()

template<class OBJECT >
void G4FastList< OBJECT >::Unhook ( G4FastListNode< OBJECT > *  )
protected

Member Data Documentation

◆ fBoundary

template<class OBJECT >
G4FastListNode<OBJECT> G4FastList< OBJECT >::fBoundary
protected

Definition at line 226 of file G4FastList.hh.

Referenced by G4FastList< OBJECT >::back().

◆ fListRef

template<class OBJECT >
G4shared_ptr<_ListRef<G4FastList<OBJECT> > > G4FastList< OBJECT >::fListRef
protected

Definition at line 224 of file G4FastList.hh.

◆ fNbObjects

template<class OBJECT >
G4int G4FastList< OBJECT >::fNbObjects
protected

Definition at line 221 of file G4FastList.hh.

Referenced by G4FastList< OBJECT >::back(), and G4FastList< OBJECT >::size().

◆ fpNodeInManyLists

template<class OBJECT >
G4FastListNode<G4FastList<OBJECT> >* G4FastList< OBJECT >::fpNodeInManyLists
protected

◆ fWatchers

template<class OBJECT >
WatcherSet G4FastList< OBJECT >::fWatchers
protected

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