ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4TAtomicHitsCollection< T > Class Template Reference

#include <geant4/tree/geant4-10.6-release/examples/extended/parallel/ThreadsafeScorers/include/G4TAtomicHitsCollection.hh>

+ Inheritance diagram for G4TAtomicHitsCollection< T >:
+ Collaboration diagram for G4TAtomicHitsCollection< T >:

Public Types

typedef T base_type
 
typedef G4atomic< Tvalue_type
 
typedef std::deque< value_type * > container_type
 

Public Member Functions

 G4TAtomicHitsCollection ()
 
 G4TAtomicHitsCollection (G4String detName, G4String colNam)
 
virtual ~G4TAtomicHitsCollection ()
 
G4bool operator== (const G4TAtomicHitsCollection< T > &right) const
 
virtual void DrawAllHits ()
 
virtual void PrintAllHits ()
 
value_typeoperator[] (size_t i) const
 
container_typeGetVector () const
 
G4int insert (T *aHit)
 
G4int entries () const
 
virtual G4VHitGetHit (size_t i) const
 
virtual size_t GetSize () const
 
- Public Member Functions inherited from G4VHitsCollection
 G4VHitsCollection ()
 
 G4VHitsCollection (G4String detName, G4String colNam)
 
virtual ~G4VHitsCollection ()
 
G4bool operator== (const G4VHitsCollection &right) const
 
G4String GetName ()
 
G4String GetSDname ()
 
 G4VHitsCollection ()
 
 G4VHitsCollection (G4String detName, G4String colNam)
 
virtual ~G4VHitsCollection ()
 
G4bool operator== (const G4VHitsCollection &right) const
 
G4String GetName ()
 
G4String GetSDname ()
 
 G4VHitsCollection ()
 
 G4VHitsCollection (G4String detName, G4String colNam)
 
virtual ~G4VHitsCollection ()
 
G4bool operator== (const G4VHitsCollection &right) const
 
const G4StringGetName () const
 
const G4StringGetSDname () const
 
void SetColID (G4int i)
 
G4int GetColID () const
 

Protected Attributes

container_typetheCollection
 
G4Mutex fMutex
 
- Protected Attributes inherited from G4VHitsCollection
G4String collectionName
 
G4String SDname
 
G4int colID
 

Detailed Description

template<class T>
class G4TAtomicHitsCollection< T >

This is an implementation of G4THitsCollection<T> where the underlying type is G4atomic<T>, not just T. A static assert is provided to ensure that T is fundamental. This class should be used in lieu of G4THitsCollection<T> when memory is a concern. Atomics are thread-safe and generally faster that mutexes (as long as the STL implementation is lock-free) but the synchronization does not come without a cost. If performance is the primary concern, use G4THitsCollection<T> in thread-local instances.

Definition at line 85 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 85 of file G4TAtomicHitsCollection.hh

Member Typedef Documentation

template<class T>
typedef T G4TAtomicHitsCollection< T >::base_type

Definition at line 89 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 89 of file G4TAtomicHitsCollection.hh

template<class T>
typedef std::deque<value_type*> G4TAtomicHitsCollection< T >::container_type

Definition at line 94 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 94 of file G4TAtomicHitsCollection.hh

template<class T>
typedef G4atomic<T> G4TAtomicHitsCollection< T >::value_type

Definition at line 93 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 93 of file G4TAtomicHitsCollection.hh

Constructor & Destructor Documentation

Definition at line 162 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 162 of file G4TAtomicHitsCollection.hh

template<class T >
G4TAtomicHitsCollection< T >::G4TAtomicHitsCollection ( G4String  detName,
G4String  colNam 
)

Definition at line 167 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 167 of file G4TAtomicHitsCollection.hh

template<class T >
G4TAtomicHitsCollection< T >::~G4TAtomicHitsCollection ( )
virtual

Definition at line 173 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 173 of file G4TAtomicHitsCollection.hh

Member Function Documentation

template<class T >
void G4TAtomicHitsCollection< T >::DrawAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Definition at line 189 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 189 of file G4TAtomicHitsCollection.hh

template<class T>
G4int G4TAtomicHitsCollection< T >::entries ( ) const
inline

Definition at line 136 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 136 of file G4TAtomicHitsCollection.hh

References G4TAtomicHitsCollection< T >::fMutex, and G4TAtomicHitsCollection< T >::theCollection.

template<class T>
virtual G4VHit* G4TAtomicHitsCollection< T >::GetHit ( size_t  i) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 144 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 144 of file G4TAtomicHitsCollection.hh

References G4TAtomicHitsCollection< T >::theCollection.

template<class T>
virtual size_t G4TAtomicHitsCollection< T >::GetSize ( ) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 148 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 148 of file G4TAtomicHitsCollection.hh

References G4TAtomicHitsCollection< T >::fMutex, and G4TAtomicHitsCollection< T >::theCollection.

template<class T>
container_type* G4TAtomicHitsCollection< T >::GetVector ( ) const
inline

Definition at line 123 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 123 of file G4TAtomicHitsCollection.hh

References G4TAtomicHitsCollection< T >::theCollection.

template<class T>
G4int G4TAtomicHitsCollection< T >::insert ( T aHit)
inline

Definition at line 128 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 128 of file G4TAtomicHitsCollection.hh

References G4TAtomicHitsCollection< T >::fMutex, and G4TAtomicHitsCollection< T >::theCollection.

template<class T >
G4bool G4TAtomicHitsCollection< T >::operator== ( const G4TAtomicHitsCollection< T > &  right) const

Definition at line 183 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 183 of file G4TAtomicHitsCollection.hh

References G4VHitsCollection::collectionName.

template<class T>
value_type* G4TAtomicHitsCollection< T >::operator[] ( size_t  i) const
inline

Definition at line 118 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 118 of file G4TAtomicHitsCollection.hh

References G4TAtomicHitsCollection< T >::theCollection.

template<class T >
void G4TAtomicHitsCollection< T >::PrintAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Definition at line 197 of file G4TAtomicHitsCollection.hh.

View newest version in sPHENIX GitHub at line 197 of file G4TAtomicHitsCollection.hh

Member Data Documentation

template<class T>
G4Mutex G4TAtomicHitsCollection< T >::fMutex
protected

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