Geant4-11
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions
G4FastList< OBJECT > Class Template Reference

#include <G4FastList.hh>

Data Structures

class  TWatcher
 
class  Watcher
 

Public Types

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

Public Member Functions

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

Static Public Member Functions

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

Protected Types

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

Protected Member Functions

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

Static Protected Member Functions

static G4FastListNode< OBJECT > * __GetNode (OBJECT *)
 

Protected Attributes

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

Private Member Functions

 G4FastList (const G4FastList< OBJECT > &other)
 
G4bool operator!= (const G4FastList< OBJECT > &right) const
 
G4FastList< OBJECT > & operator= (const G4FastList< OBJECT > &right)
 
G4bool operator== (const G4FastList< OBJECT > &right) const
 

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() [1/2]

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

◆ ~G4FastList()

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

◆ G4FastList() [2/2]

template<class OBJECT >
G4FastList< OBJECT >::G4FastList ( const G4FastList< OBJECT > &  other)
private

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

References G4FastList< OBJECT >::fWatchers.

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

References G4FastList< OBJECT >::fBoundary, and G4FastList< OBJECT >::fNbObjects.

◆ begin() [1/2]

template<class OBJECT >
iterator G4FastList< OBJECT >::begin ( )
inline

◆ 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()

template<class OBJECT >
bool G4FastList< OBJECT >::empty ( ) const
inline

◆ end() [1/2]

template<class OBJECT >
iterator G4FastList< OBJECT >::end ( )
inline

◆ 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

References G4FastList< OBJECT >::fpNodeInManyLists.

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 *   
)

◆ operator!=()

template<class OBJECT >
G4bool G4FastList< OBJECT >::operator!= ( const G4FastList< OBJECT > &  right) const
private

◆ operator=()

template<class OBJECT >
G4FastList< OBJECT > & G4FastList< OBJECT >::operator= ( const G4FastList< OBJECT > &  right)
private

◆ operator==()

template<class OBJECT >
G4bool G4FastList< OBJECT >::operator== ( const G4FastList< OBJECT > &  right) const
private

◆ 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()

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

◆ 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 }

References G4FastList< OBJECT >::fWatchers.

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 }

References G4FastList< OBJECT >::fpNodeInManyLists.

◆ 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

Field 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: