Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4FastList< OBJECT > Class Template Reference

#include <G4FastList.hh>

Collaboration diagram for G4FastList< OBJECT >:

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

Member Typedef Documentation

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

Definition at line 324 of file G4FastList.hh.

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

Definition at line 323 of file G4FastList.hh.

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

Definition at line 325 of file G4FastList.hh.

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

Definition at line 322 of file G4FastList.hh.

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

Definition at line 317 of file G4FastList.hh.

Constructor & Destructor Documentation

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

Member Function Documentation

template<class OBJECT>
static G4FastListNode<OBJECT>* G4FastList< OBJECT >::__GetNode ( OBJECT *  )
staticprotected
template<class OBJECT>
void G4FastList< OBJECT >::AddWatcher ( Watcher watcher)
inline

Definition at line 340 of file G4FastList.hh.

341  {
342  fWatchers.insert(watcher);
343  }
WatcherSet fWatchers
Definition: G4FastList.hh:318

Here is the caller graph for this function:

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

Definition at line 352 of file G4FastList.hh.

353  {
354 // if (fNbObjects != 0) return fpFinish->GetObject();
355  if (fNbObjects != 0) return fBoundary.GetPrevious()->GetObject();
356  else return 0;
357  }
G4int fNbObjects
Definition: G4FastList.hh:223
G4FastListNode< OBJECT > fBoundary
Definition: G4FastList.hh:228
template<class OBJECT>
iterator G4FastList< OBJECT >::begin ( )
inline

Here is the caller graph for this function:

template<class OBJECT>
const_iterator G4FastList< OBJECT >::begin ( ) const
inline
template<class OBJECT>
void G4FastList< OBJECT >::CheckFlag ( G4FastListNode< OBJECT > *  )
protected
template<class OBJECT>
void G4FastList< OBJECT >::clear ( )

Complexity = linear in size between __first and __last

Here is the caller graph for this function:

template<class OBJECT>
G4FastListNode<OBJECT>* G4FastList< OBJECT >::CreateNode ( OBJECT *  )
protected
template<class OBJECT>
void G4FastList< OBJECT >::DeleteObject ( OBJECT *  )
protected
template<class OBJECT>
bool G4FastList< OBJECT >::empty ( ) const
inline

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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.

template<class OBJECT>
G4FastListNode<OBJECT>* G4FastList< OBJECT >::EraseListNode ( OBJECT *  )
protected
template<class OBJECT>
G4FastListNode<OBJECT>* G4FastList< OBJECT >::Flag ( OBJECT *  )
protected
template<class OBJECT>
static G4FastList<OBJECT>* G4FastList< OBJECT >::GetList ( OBJECT *  )
static
template<class OBJECT>
static G4FastList<OBJECT>* G4FastList< OBJECT >::GetList ( G4FastListNode< OBJECT > *  __trackListNode)
static
template<class OBJECT>
G4FastListNode<G4FastList<OBJECT> >* G4FastList< OBJECT >::GetListNode ( )
inline

Definition at line 335 of file G4FastList.hh.

336  {
337  return fpNodeInManyLists;
338  }
G4FastListNode< G4FastList< OBJECT > > * fpNodeInManyLists
Definition: G4FastList.hh:319

Here is the caller graph for this function:

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

Complexity = constant

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

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

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

Here is the caller graph for this function:

template<class OBJECT>
iterator G4FastList< OBJECT >::pop ( G4FastListNode< OBJECT > *  )
template<class OBJECT>
iterator G4FastList< OBJECT >::pop ( iterator  __first,
iterator  __last 
)
template<class OBJECT>
static void G4FastList< OBJECT >::Pop ( OBJECT *  )
static
template<class OBJECT>
OBJECT* G4FastList< OBJECT >::pop_back ( )
template<class OBJECT>
void G4FastList< OBJECT >::push_back ( OBJECT *  __track)
inline

Here is the caller graph for this function:

template<class OBJECT>
void G4FastList< OBJECT >::push_front ( OBJECT *  __track)
inline
template<class OBJECT>
void G4FastList< OBJECT >::remove ( OBJECT *  )
template<class OBJECT>
void G4FastList< OBJECT >::RemoveWatcher ( Watcher watcher)
inline

Definition at line 345 of file G4FastList.hh.

346  {
347  typename WatcherSet::iterator it = fWatchers.find(watcher);
348  if(it == fWatchers.end()) return; //TODO: exception?
349  fWatchers.erase(it);
350  }
WatcherSet fWatchers
Definition: G4FastList.hh:318

Here is the caller graph for this function:

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

Definition at line 330 of file G4FastList.hh.

331  {
332  fpNodeInManyLists = __node;
333  }
G4FastListNode< G4FastList< OBJECT > > * fpNodeInManyLists
Definition: G4FastList.hh:319

Here is the caller graph for this function:

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

Definition at line 359 of file G4FastList.hh.

360  {
361  return fNbObjects;
362  }
G4int fNbObjects
Definition: G4FastList.hh:223

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 228 of file G4FastList.hh.

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

Definition at line 226 of file G4FastList.hh.

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

Definition at line 223 of file G4FastList.hh.

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

Definition at line 319 of file G4FastList.hh.

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

Definition at line 318 of file G4FastList.hh.


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