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

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

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

Public Types

typedef G4atomic< Tvalue_type
 
typedef value_typemapped_type
 
typedef std::map< G4int,
mapped_type
container_type
 
typedef container_type::iterator iterator
 
typedef
container_type::const_iterator 
const_iterator
 

Public Member Functions

 G4TAtomicHitsMap ()
 
 G4TAtomicHitsMap (G4String detName, G4String colNam)
 
virtual ~G4TAtomicHitsMap ()
 
G4bool operator== (const G4TAtomicHitsMap< T > &right) const
 
G4TAtomicHitsMap< T > & operator+= (const G4TAtomicHitsMap< T > &right) const
 
G4TAtomicHitsMap< T > & operator+= (const G4THitsMap< T > &right) const
 
virtual void DrawAllHits ()
 
virtual void PrintAllHits ()
 
value_typeoperator[] (G4int key) const
 
container_typeGetMap () const
 
G4int add (const G4int &key, value_type *&aHit) const
 
G4int add (const G4int &key, T &aHit) const
 
G4int set (const G4int &key, value_type *&aHit) const
 
G4int set (const G4int &key, T &aHit) const
 
G4int entries () const
 
void clear ()
 
virtual G4VHitGetHit (size_t) const
 
virtual size_t GetSize () const
 
virtual size_t size () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
iterator find (G4int p)
 
const_iterator find (G4int p) 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
 

Private Attributes

container_typetheCollection
 
G4Mutex fMutex
 

Additional Inherited Members

- Protected Attributes inherited from G4VHitsCollection
G4String collectionName
 
G4String SDname
 
G4int colID
 

Detailed Description

template<typename T>
class G4TAtomicHitsMap< T >

This is an implementation of G4THitsMap<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 G4THitsMap<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 G4THitsMap<T> in thread-local instances.

Definition at line 72 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 72 of file G4TAtomicHitsMap.hh

Member Typedef Documentation

template<typename T>
typedef container_type::const_iterator G4TAtomicHitsMap< T >::const_iterator

Definition at line 83 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 83 of file G4TAtomicHitsMap.hh

template<typename T>
typedef std::map<G4int, mapped_type> G4TAtomicHitsMap< T >::container_type

Definition at line 81 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 81 of file G4TAtomicHitsMap.hh

template<typename T>
typedef container_type::iterator G4TAtomicHitsMap< T >::iterator

Definition at line 82 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 82 of file G4TAtomicHitsMap.hh

template<typename T>
typedef value_type* G4TAtomicHitsMap< T >::mapped_type

Definition at line 80 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 80 of file G4TAtomicHitsMap.hh

template<typename T>
typedef G4atomic<T> G4TAtomicHitsMap< T >::value_type

Definition at line 76 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 76 of file G4TAtomicHitsMap.hh

Constructor & Destructor Documentation

template<typename T >
G4TAtomicHitsMap< T >::G4TAtomicHitsMap ( )

Definition at line 156 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 156 of file G4TAtomicHitsMap.hh

template<typename T >
G4TAtomicHitsMap< T >::G4TAtomicHitsMap ( G4String  detName,
G4String  colNam 
)

Definition at line 161 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 161 of file G4TAtomicHitsMap.hh

template<typename T >
G4TAtomicHitsMap< T >::~G4TAtomicHitsMap ( )
virtual

Definition at line 168 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 168 of file G4TAtomicHitsMap.hh

Member Function Documentation

template<typename T >
G4int G4TAtomicHitsMap< T >::add ( const G4int key,
value_type *&  aHit 
) const
inline

Definition at line 223 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 223 of file G4TAtomicHitsMap.hh

template<typename T>
G4int G4TAtomicHitsMap< T >::add ( const G4int key,
T aHit 
) const
inline

Definition at line 238 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 238 of file G4TAtomicHitsMap.hh

template<typename T>
iterator G4TAtomicHitsMap< T >::begin ( )
inline

Definition at line 136 of file G4TAtomicHitsMap.hh.

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

Referenced by TSRunAction::EndOfRunAction().

+ Here is the caller graph for this function:

template<typename T>
const_iterator G4TAtomicHitsMap< T >::begin ( ) const
inline

Definition at line 139 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 139 of file G4TAtomicHitsMap.hh

template<typename T>
const_iterator G4TAtomicHitsMap< T >::cbegin ( ) const
inline

Definition at line 142 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 142 of file G4TAtomicHitsMap.hh

template<typename T>
const_iterator G4TAtomicHitsMap< T >::cend ( ) const
inline

Definition at line 143 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 143 of file G4TAtomicHitsMap.hh

template<typename T >
void G4TAtomicHitsMap< T >::clear ( void  )
inline

Definition at line 294 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 294 of file G4TAtomicHitsMap.hh

template<typename T >
void G4TAtomicHitsMap< T >::DrawAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Definition at line 283 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 283 of file G4TAtomicHitsMap.hh

template<typename T>
iterator G4TAtomicHitsMap< T >::end ( )
inline

Definition at line 137 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 137 of file G4TAtomicHitsMap.hh

Referenced by TSRunAction::EndOfRunAction().

+ Here is the caller graph for this function:

template<typename T>
const_iterator G4TAtomicHitsMap< T >::end ( ) const
inline

Definition at line 140 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 140 of file G4TAtomicHitsMap.hh

template<typename T>
G4int G4TAtomicHitsMap< T >::entries ( ) const
inline

Definition at line 119 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 119 of file G4TAtomicHitsMap.hh

template<typename T>
iterator G4TAtomicHitsMap< T >::find ( G4int  p)
inline

Definition at line 145 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 145 of file G4TAtomicHitsMap.hh

template<typename T>
const_iterator G4TAtomicHitsMap< T >::find ( G4int  p) const
inline

Definition at line 146 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 146 of file G4TAtomicHitsMap.hh

template<typename T>
virtual G4VHit* G4TAtomicHitsMap< T >::GetHit ( size_t  ) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 127 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 127 of file G4TAtomicHitsMap.hh

template<typename T>
container_type* G4TAtomicHitsMap< T >::GetMap ( ) const
inline

Definition at line 108 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 108 of file G4TAtomicHitsMap.hh

Referenced by G4TAtomicHitsMap< T >::operator+=().

+ Here is the caller graph for this function:

template<typename T>
virtual size_t G4TAtomicHitsMap< T >::GetSize ( ) const
inlinevirtual

Reimplemented from G4VHitsCollection.

Definition at line 128 of file G4TAtomicHitsMap.hh.

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

template<typename T>
G4TAtomicHitsMap< T > & G4TAtomicHitsMap< T >::operator+= ( const G4TAtomicHitsMap< T > &  right) const

Definition at line 184 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 184 of file G4TAtomicHitsMap.hh

References G4TAtomicHitsMap< T >::GetMap().

+ Here is the call graph for this function:

template<typename T>
G4TAtomicHitsMap< T > & G4TAtomicHitsMap< T >::operator+= ( const G4THitsMap< T > &  right) const

Definition at line 194 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 194 of file G4TAtomicHitsMap.hh

References G4VTHitsMap< _Tp, std::map< G4int, _Tp * > >::GetMap().

+ Here is the call graph for this function:

template<typename T>
G4bool G4TAtomicHitsMap< T >::operator== ( const G4TAtomicHitsMap< T > &  right) const

Definition at line 177 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 177 of file G4TAtomicHitsMap.hh

References G4VHitsCollection::collectionName.

template<typename T >
G4TAtomicHitsMap< T >::value_type * G4TAtomicHitsMap< T >::operator[] ( G4int  key) const
inline

Definition at line 204 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 204 of file G4TAtomicHitsMap.hh

template<typename T >
void G4TAtomicHitsMap< T >::PrintAllHits ( )
virtual

Reimplemented from G4VHitsCollection.

Definition at line 287 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 287 of file G4TAtomicHitsMap.hh

References G4cout, and G4endl.

template<typename T >
G4int G4TAtomicHitsMap< T >::set ( const G4int key,
value_type *&  aHit 
) const
inline

Definition at line 256 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 256 of file G4TAtomicHitsMap.hh

template<typename T>
G4int G4TAtomicHitsMap< T >::set ( const G4int key,
T aHit 
) const
inline

Definition at line 268 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 268 of file G4TAtomicHitsMap.hh

template<typename T>
virtual size_t G4TAtomicHitsMap< T >::size ( void  ) const
inlinevirtual

Definition at line 133 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 133 of file G4TAtomicHitsMap.hh

Referenced by TSRunAction::EndOfRunAction().

+ Here is the caller graph for this function:

Member Data Documentation

template<typename T>
G4Mutex G4TAtomicHitsMap< T >::fMutex
mutableprivate

Definition at line 150 of file G4TAtomicHitsMap.hh.

View newest version in sPHENIX GitHub at line 150 of file G4TAtomicHitsMap.hh


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