Geant4-11
Public Member Functions | Protected Attributes
G4TDigiCollection< T > Class Template Reference

#include <G4TDigiCollection.hh>

Inheritance diagram for G4TDigiCollection< T >:
G4DigiCollection G4VDigiCollection

Public Member Functions

virtual void DrawAllDigi ()
 
size_t entries () const
 
 G4TDigiCollection ()
 
 G4TDigiCollection (G4String detName, G4String colNam)
 
virtual G4VDigiGetDigi (size_t i) const
 
const G4StringGetDMname () const
 
const G4StringGetName () const
 
virtual size_t GetSize () const
 
std::vector< T * > * GetVector () const
 
size_t insert (T *aHit)
 
void operator delete (void *aDC)
 
void * operator new (size_t)
 
G4bool operator== (const G4DigiCollection &right) const
 
G4bool operator== (const G4TDigiCollection &right) const
 
G4bool operator== (const G4VDigiCollection &right) const
 
T * operator[] (size_t i) const
 
virtual void PrintAllDigi ()
 
virtual ~G4TDigiCollection ()
 

Protected Attributes

G4String collectionName
 
G4String DMname
 
void * theCollection
 

Detailed Description

template<class T>
class G4TDigiCollection< T >

Definition at line 66 of file G4TDigiCollection.hh.

Constructor & Destructor Documentation

◆ G4TDigiCollection() [1/2]

template<class T >
G4TDigiCollection< T >::G4TDigiCollection

Definition at line 160 of file G4TDigiCollection.hh.

161{
164 std::vector<T*>* theDigiCollection = new std::vector<T*>;
165 theCollection = (void*) theDigiCollection;
166}
G4DLLIMPORT G4Allocator< G4DigiCollection > *& aDCAllocator_G4MT_TLS_()

References aDCAllocator_G4MT_TLS_().

◆ G4TDigiCollection() [2/2]

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

Definition at line 169 of file G4TDigiCollection.hh.

170 : G4DigiCollection(detName, colNam)
171{
174
175 std::vector<T*>* theDigiCollection = new std::vector<T*>;
176 theCollection = (void*) theDigiCollection;
177}

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ ~G4TDigiCollection()

template<class T >
G4TDigiCollection< T >::~G4TDigiCollection
virtual

Definition at line 180 of file G4TDigiCollection.hh.

181{
184 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
185 // theDigiCollection->clearAndDestroy();
186 for(size_t i = 0; i < theDigiCollection->size(); i++)
187 {
188 delete(*theDigiCollection)[i];
189 }
190 theDigiCollection->clear();
191 delete theDigiCollection;
192}

References aDCAllocator_G4MT_TLS_().

Member Function Documentation

◆ DrawAllDigi()

template<class T >
void G4TDigiCollection< T >::DrawAllDigi
virtual

Reimplemented from G4VDigiCollection.

Definition at line 203 of file G4TDigiCollection.hh.

204{
207 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
208 size_t n = theDigiCollection->size();
209 for(size_t i = 0; i < n; i++)
210 {
211 (*theDigiCollection)[i]->Draw();
212 }
213}

References aDCAllocator_G4MT_TLS_(), and CLHEP::detail::n.

◆ entries()

template<class T >
size_t G4TDigiCollection< T >::entries ( ) const
inline

Definition at line 112 of file G4TDigiCollection.hh.

113 {
116 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
117 return theDigiCollection->size();
118 }

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ GetDigi()

template<class T >
virtual G4VDigi * G4TDigiCollection< T >::GetDigi ( size_t  i) const
inlinevirtual

Reimplemented from G4VDigiCollection.

Definition at line 122 of file G4TDigiCollection.hh.

123 {
126 return (*((std::vector<T*>*) theCollection))[i];
127 }

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ GetDMname()

const G4String & G4VDigiCollection::GetDMname ( ) const
inlineinherited

Definition at line 62 of file G4VDigiCollection.hh.

62{ return DMname; }

References G4VDigiCollection::DMname.

◆ GetName()

const G4String & G4VDigiCollection::GetName ( ) const
inlineinherited

◆ GetSize()

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

Reimplemented from G4VDigiCollection.

Definition at line 128 of file G4TDigiCollection.hh.

129 {
132 return ((std::vector<T*>*) theCollection)->size();
133 }

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ GetVector()

template<class T >
std::vector< T * > * G4TDigiCollection< T >::GetVector ( ) const
inline

Definition at line 95 of file G4TDigiCollection.hh.

96 {
99 return (std::vector<T*>*) theCollection;
100 }

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ insert()

template<class T >
size_t G4TDigiCollection< T >::insert ( T *  aHit)
inline

Definition at line 102 of file G4TDigiCollection.hh.

103 {
106 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
107 theDigiCollection->push_back(aHit);
108 return theDigiCollection->size();
109 }

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ operator delete()

template<class T >
void G4TDigiCollection< T >::operator delete ( void *  aDC)
inline

Definition at line 148 of file G4TDigiCollection.hh.

149{
153 ;
154 ;
155 ;
156 aDCAllocator.FreeSingle((G4DigiCollection*) aDC);
157}
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:206

References aDCAllocator_G4MT_TLS_(), and G4Allocator< Type >::FreeSingle().

◆ operator new()

template<class T >
void * G4TDigiCollection< T >::operator new ( size_t  )
inline

Definition at line 137 of file G4TDigiCollection.hh.

138{
142 void* aDC;
143 aDC = (void*) aDCAllocator.MallocSingle();
144 return aDC;
145}
Type * MallocSingle()
Definition: G4Allocator.hh:196

References aDCAllocator_G4MT_TLS_(), and G4Allocator< Type >::MallocSingle().

◆ operator==() [1/3]

G4bool G4DigiCollection::operator== ( const G4DigiCollection right) const
inherited

Definition at line 61 of file G4TDigiCollection.cc.

62{
65 return (collectionName == right.collectionName);
66}
G4Allocator< G4DigiCollection > *& aDCAllocator_G4MT_TLS_()

References aDCAllocator_G4MT_TLS_(), and G4VDigiCollection::collectionName.

◆ operator==() [2/3]

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

◆ operator==() [3/3]

G4bool G4VDigiCollection::operator== ( const G4VDigiCollection right) const
inherited

Definition at line 47 of file G4VDigiCollection.cc.

48{
49 return ((collectionName == right.collectionName) && (DMname == right.DMname));
50}

References G4VDigiCollection::collectionName, and G4VDigiCollection::DMname.

◆ operator[]()

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

Definition at line 88 of file G4TDigiCollection.hh.

89 {
92 return (*((std::vector<T*>*) theCollection))[i];
93 }

References aDCAllocator_G4MT_TLS_(), and G4DigiCollection::theCollection.

◆ PrintAllDigi()

template<class T >
void G4TDigiCollection< T >::PrintAllDigi
virtual

Reimplemented from G4VDigiCollection.

Definition at line 216 of file G4TDigiCollection.hh.

217{
220 std::vector<T*>* theDigiCollection = (std::vector<T*>*) theCollection;
221 size_t n = theDigiCollection->size();
222 for(size_t i = 0; i < n; i++)
223 {
224 (*theDigiCollection)[i]->Print();
225 }
226}

References aDCAllocator_G4MT_TLS_(), and CLHEP::detail::n.

Field Documentation

◆ collectionName

G4String G4VDigiCollection::collectionName
protectedinherited

◆ DMname

G4String G4VDigiCollection::DMname
protectedinherited

◆ theCollection

void* G4DigiCollection::theCollection
protectedinherited

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