Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4THitsUnorderedMultiMap< _Tp > Class Template Reference

#include <G4THitsMap.hh>

+ Inheritance diagram for G4THitsUnorderedMultiMap< _Tp >:

Public Types

using parent_type = G4VTHitsMap<_Tp, std::unordered_multimap<G4int, _Tp *>>
 
- Public Types inherited from G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >
using this_type
 
using value_type
 
using map_type
 
using iterator
 
using const_iterator
 

Public Member Functions

 G4THitsUnorderedMultiMap ()
 
 G4THitsUnorderedMultiMap (const G4String &detName, const G4String &colName)
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
G4bool operator== (const G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > > &right) const
 
_Tp * operator[] (G4int key) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
void DrawAllHits () override
 
iterator end ()
 
const_iterator end () const
 
std::size_t entries () const
 
G4VHitGetHit (std::size_t) const override
 
std::unordered_multimap< G4int, _Tp * > * GetMap () const
 
std::size_t GetSize () const override
 
void PrintAllHits () override
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
- Public Member Functions inherited from G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >
 G4VTHitsMap ()
 
 G4VTHitsMap (const G4String &detName, const G4String &colNam)
 
 ~G4VTHitsMap () override
 
G4bool operator== (const G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
void DrawAllHits () override
 
void PrintAllHits () override
 
std::unordered_multimap< G4int, _Tp * > * GetContainer () const
 
std::unordered_multimap< G4int, _Tp * >::size_type size ()
 
std::unordered_multimap< G4int, _Tp * >::size_type GetIndex (iterator itr)
 
std::unordered_multimap< G4int, _Tp * >::size_type GetIndex (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
std::unordered_multimap< G4int, _Tp * > * GetMap () const
 
std::size_t entries () const
 
void clear ()
 
G4VHitGetHit (std::size_t) const override
 
std::size_t GetSize () const override
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
_Tp * operator[] (G4int key) const
 
_Tp * operator[] (G4int key) const
 
 G4VTHitsMap ()
 
 G4VTHitsMap (const G4String &detName, const G4String &colNam)
 
 ~G4VTHitsMap () override
 
G4bool operator== (const G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > > &right) const
 
this_typeoperator+= (const G4VTHitsMap< U, MapU_t > &right) const
 
void DrawAllHits () override
 
void PrintAllHits () override
 
std::unordered_multimap< G4int, _Tp * > * GetContainer () const
 
std::unordered_multimap< G4int, _Tp * >::size_type size ()
 
std::unordered_multimap< G4int, _Tp * >::size_type GetIndex (iterator itr)
 
std::unordered_multimap< G4int, _Tp * >::size_type GetIndex (const_iterator itr) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (G4int idx) const
 
_Tp * GetObject (iterator itr) const
 
const _Tp * GetObject (const_iterator itr) const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
std::unordered_multimap< G4int, _Tp * > * GetMap () const
 
std::size_t entries () const
 
void clear ()
 
G4VHitGetHit (std::size_t) const override
 
std::size_t GetSize () const override
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U *&aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t add (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U *&aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
std::size_t set (const G4int &key, U &aHit) const
 
_Tp * operator[] (G4int key) const
 
_Tp * operator[] (G4int key) const
 
- Public Member Functions inherited from G4HitsCollection
 ~G4HitsCollection () override=default
 
G4bool operator== (const G4HitsCollection &right) const
 
 G4VHitsCollection ()=default
 
 G4VHitsCollection (const G4String &detName, const G4String &colNam)
 
- Public Member Functions inherited from G4VHitsCollection
 G4VHitsCollection ()=default
 
 G4VHitsCollection (const G4String &detName, const G4String &colNam)
 
virtual ~G4VHitsCollection ()=default
 
G4bool operator== (const G4VHitsCollection &right) const
 
const G4StringGetName () const
 
const G4StringGetSDname () const
 
void SetColID (G4int i)
 
G4int GetColID () const
 

Additional Inherited Members

- Protected Attributes inherited from G4HitsCollection
void * theCollection = nullptr
 
- Protected Attributes inherited from G4VHitsCollection
G4String collectionName = "Unknown"
 
G4String SDname = "Unknown"
 
G4int colID = -1
 

Detailed Description

template<typename _Tp>
class G4THitsUnorderedMultiMap< _Tp >

Definition at line 612 of file G4THitsMap.hh.

Member Typedef Documentation

◆ parent_type

template<typename _Tp>
using G4THitsUnorderedMultiMap< _Tp >::parent_type = G4VTHitsMap<_Tp, std::unordered_multimap<G4int, _Tp *>>

Definition at line 615 of file G4THitsMap.hh.

Constructor & Destructor Documentation

◆ G4THitsUnorderedMultiMap() [1/2]

template<typename _Tp>
G4THitsUnorderedMultiMap< _Tp >::G4THitsUnorderedMultiMap ( )
inline

Definition at line 618 of file G4THitsMap.hh.

618: parent_type() {}
G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > > parent_type

◆ G4THitsUnorderedMultiMap() [2/2]

template<typename _Tp>
G4THitsUnorderedMultiMap< _Tp >::G4THitsUnorderedMultiMap ( const G4String & detName,
const G4String & colName )
inline

Definition at line 619 of file G4THitsMap.hh.

Member Function Documentation

◆ add() [1/2]

template<typename _Tp>
std::size_t G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::add ( const G4int & key,
U & aHit ) const
inline

Definition at line 214 of file G4THitsMap.hh.

215 {
217 if (theHitsMap->find(key) == theHitsMap->end())
218 theHitsMap->insert(pair_t(key, new T(aHit)));
219 else
220 *theHitsMap->find(key)->second += aHit;
221 return theHitsMap->size();
222 }
std::unordered_multimap< G4int, _Tp * > * GetMap() const
Map_t::size_type size()
std::unordered_multimap< G4int, _Tp * > map_type
Definition G4THitsMap.hh:86

◆ add() [2/2]

template<typename _Tp>
std::size_t G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::add ( const G4int & key,
U *& aHit ) const
inline

Definition at line 171 of file G4THitsMap.hh.

172 {
174 if (theHitsMap->find(key) == theHitsMap->end())
175 theHitsMap->insert(pair_t(key, new T(*aHit)));
176 else
177 *theHitsMap->find(key)->second += *aHit;
178 return theHitsMap->size();
179 }

◆ begin() [1/2]

template<typename _Tp>
iterator G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::begin ( )
inline

Definition at line 143 of file G4THitsMap.hh.

143{ return GetContainer()->begin(); }
std::unordered_multimap< G4int, _Tp * > * GetContainer() const

◆ begin() [2/2]

template<typename _Tp>
const_iterator G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::begin ( ) const
inline

Definition at line 145 of file G4THitsMap.hh.

145{ return GetContainer()->begin(); }

◆ cbegin()

template<typename _Tp>
const_iterator G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::cbegin ( ) const
inline

Definition at line 147 of file G4THitsMap.hh.

147{ return GetContainer()->cbegin(); }

◆ cend()

template<typename _Tp>
const_iterator G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::cend ( ) const
inline

Definition at line 148 of file G4THitsMap.hh.

148{ return GetContainer()->cend(); }

◆ clear()

template<typename _Tp>
void G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::clear ( )
inline

◆ DrawAllHits()

template<typename _Tp>
void G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::DrawAllHits ( )
overridevirtual

Reimplemented from G4VHitsCollection.

◆ end() [1/2]

template<typename _Tp>
iterator G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::end ( )
inline

Definition at line 144 of file G4THitsMap.hh.

144{ return GetContainer()->end(); }

◆ end() [2/2]

template<typename _Tp>
const_iterator G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::end ( ) const
inline

Definition at line 146 of file G4THitsMap.hh.

146{ return GetContainer()->end(); }

◆ entries()

template<typename _Tp>
std::size_t G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::entries ( ) const
inline

Definition at line 154 of file G4THitsMap.hh.

154{ return ((Map_t*)theCollection)->size(); }

◆ GetHit()

template<typename _Tp>
G4VHit * G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::GetHit ( std::size_t ) const
inlineoverridevirtual

Reimplemented from G4VHitsCollection.

Definition at line 158 of file G4THitsMap.hh.

158{ return nullptr; }

◆ GetMap()

template<typename _Tp>
std::unordered_multimap< G4int, _Tp * > * G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::GetMap ( ) const
inline

Definition at line 151 of file G4THitsMap.hh.

151{ return (Map_t*)theCollection; }

◆ GetSize()

template<typename _Tp>
std::size_t G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::GetSize ( ) const
inlineoverridevirtual

Reimplemented from G4VHitsCollection.

Definition at line 159 of file G4THitsMap.hh.

159{ return ((Map_t*)theCollection)->size(); }

◆ operator+=()

template<typename _Tp>
this_type & G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::operator+= ( const G4VTHitsMap< U, MapU_t > & right) const
inline

Definition at line 104 of file G4THitsMap.hh.

105 {
107 for (auto itr = aHitsMap->begin(); itr != aHitsMap->end(); ++itr)
108 add<U, map_type>(itr->first, *(itr->second));
109 return (this_type&)(*this);
110 }
std::size_t add(const G4int &key, U *&aHit) const
G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > > this_type
Definition G4THitsMap.hh:84

◆ operator==()

template<typename _Tp>
G4bool G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::operator== ( const G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > > & right) const

◆ operator[]()

template<typename _Tp>
_Tp * G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::operator[] ( G4int key) const
inline

Definition at line 400 of file G4THitsMap.hh.

401 {
403 if (theHitsMap->find(key) != theHitsMap->end()) return theHitsMap->find(key)->second;
404 return nullptr;
405 }

◆ PrintAllHits()

template<typename _Tp>
void G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::PrintAllHits ( )
overridevirtual

Reimplemented from G4VHitsCollection.

◆ set() [1/2]

template<typename _Tp>
std::size_t G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::set ( const G4int & key,
U & aHit ) const
inline

Definition at line 336 of file G4THitsMap.hh.

337 {
339 T* hit = nullptr;
340 if (theHitsMap->find(key) != theHitsMap->end())
341 hit = theHitsMap->find(key)->second;
342 else
343 theHitsMap->insert(pair_t(key, hit = allocate()));
344 *hit = aHit;
345 return theHitsMap->size();
346 }

◆ set() [2/2]

template<typename _Tp>
std::size_t G4VTHitsMap< _Tp, std::unordered_multimap< G4int, _Tp * > >::set ( const G4int & key,
U *& aHit ) const
inline

Definition at line 270 of file G4THitsMap.hh.

271 {
273 if (theHitsMap->find(key) != theHitsMap->end()) delete theHitsMap->find(key)->second;
274 theHitsMap->find(key)->second = aHit;
275 return theHitsMap->size();
276 }

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