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

#include <G4TDigiCollection.hh>

Inheritance diagram for G4TDigiCollection< T >:
Collaboration diagram for G4TDigiCollection< T >:

Public Member Functions

 G4TDigiCollection ()
 
 G4TDigiCollection (G4String detName, G4String colNam)
 
virtual ~G4TDigiCollection ()
 
G4int operator== (const G4TDigiCollection &right) const
 
voidoperator new (size_t)
 
void operator delete (void *aDC)
 
virtual void DrawAllDigi ()
 
virtual void PrintAllDigi ()
 
T * operator[] (size_t i) const
 
std::vector< T * > * GetVector () const
 
G4int insert (T *aHit)
 
G4int entries () const
 
virtual G4VDigiGetDigi (size_t i) const
 
virtual size_t GetSize () const
 
- Public Member Functions inherited from G4DigiCollection
 G4DigiCollection ()
 
 G4DigiCollection (G4String detName, G4String colNam)
 
virtual ~G4DigiCollection ()
 
G4int operator== (const G4DigiCollection &right) const
 
- Public Member Functions inherited from G4VDigiCollection
 G4VDigiCollection ()
 
 G4VDigiCollection (G4String DMnam, G4String colNam)
 
virtual ~G4VDigiCollection ()
 
G4int operator== (const G4VDigiCollection &right) const
 
G4String GetName ()
 
G4String GetDMname ()
 

Additional Inherited Members

- Protected Attributes inherited from G4DigiCollection
voidtheCollection
 
- Protected Attributes inherited from G4VDigiCollection
G4String collectionName
 
G4String DMname
 

Detailed Description

template<class T>
class G4TDigiCollection< T >

Definition at line 66 of file G4TDigiCollection.hh.

Constructor & Destructor Documentation

template<class T >
G4TDigiCollection< T >::G4TDigiCollection ( )

Definition at line 147 of file G4TDigiCollection.hh.

148 {
150  std::vector<T*> * theDigiCollection = new std::vector<T*>;
151  theCollection = (void*)theDigiCollection;
152 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T >
G4TDigiCollection< T >::G4TDigiCollection ( G4String  detName,
G4String  colNam 
)

Definition at line 154 of file G4TDigiCollection.hh.

155 : G4DigiCollection(detName,colNam)
156 {
158 
159  std::vector<T*> * theDigiCollection = new std::vector<T*>;
160  theCollection = (void*)theDigiCollection;
161 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T >
G4TDigiCollection< T >::~G4TDigiCollection ( )
virtual

Definition at line 163 of file G4TDigiCollection.hh.

164 {
166  std::vector<T*> * theDigiCollection = (std::vector<T*>*)theCollection;
167  //theDigiCollection->clearAndDestroy();
168  for(size_t i=0;i<theDigiCollection->size();i++)
169  { delete (*theDigiCollection)[i]; }
170  theDigiCollection->clear();
171  delete theDigiCollection;
172 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_

Member Function Documentation

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

Reimplemented from G4VDigiCollection.

Definition at line 180 of file G4TDigiCollection.hh.

181 {
183  std::vector<T*> * theDigiCollection = (std::vector<T*>*)theCollection;
184  size_t n = theDigiCollection->size();
185  for(size_t i=0;i<n;i++)
186  { (*theDigiCollection)[i]->Draw(); }
187 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T>
G4int G4TDigiCollection< T >::entries ( ) const
inline

Definition at line 108 of file G4TDigiCollection.hh.

109  {
111  std::vector<T*>*theDigiCollection
112  = (std::vector<T*>*)theCollection;
113  return theDigiCollection->size();
114  }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T>
virtual G4VDigi* G4TDigiCollection< T >::GetDigi ( size_t  i) const
inlinevirtual

Reimplemented from G4VDigiCollection.

Definition at line 118 of file G4TDigiCollection.hh.

119  {
121  return (*((std::vector<T*>*)theCollection))[i];
122  }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T>
virtual size_t G4TDigiCollection< T >::GetSize ( ) const
inlinevirtual

Reimplemented from G4VDigiCollection.

Definition at line 123 of file G4TDigiCollection.hh.

124  {
126  return ((std::vector<T*>*)theCollection)->size();
127  }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T>
std::vector<T*>* G4TDigiCollection< T >::GetVector ( ) const
inline

Definition at line 92 of file G4TDigiCollection.hh.

93  {
95  return (std::vector<T*>*)theCollection;
96  }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T>
G4int G4TDigiCollection< T >::insert ( T *  aHit)
inline

Definition at line 98 of file G4TDigiCollection.hh.

99  {
101  std::vector<T*>*theDigiCollection
102  = (std::vector<T*>*)theCollection;
103  theDigiCollection->push_back(aHit);
104  return theDigiCollection->size();
105  }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T >
void G4TDigiCollection< T >::operator delete ( void aDC)
inline

Definition at line 140 of file G4TDigiCollection.hh.

141 {
144  aDCAllocator.FreeSingle((G4DigiCollection*)aDC);
145 }
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:212
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_

Here is the call graph for this function:

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

Definition at line 131 of file G4TDigiCollection.hh.

132 {
135  void* aDC;
136  aDC = (void*)aDCAllocator.MallocSingle();
137  return aDC;
138 }
Type * MallocSingle()
Definition: G4Allocator.hh:202
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_

Here is the call graph for this function:

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

Definition at line 174 of file G4TDigiCollection.hh.

175 {
177  return (collectionName==right.collectionName);
178 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T>
T* G4TDigiCollection< T >::operator[] ( size_t  i) const
inline

Definition at line 86 of file G4TDigiCollection.hh.

87  {
89  return (*((std::vector<T*>*)theCollection))[i];
90  }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_
template<class T >
void G4TDigiCollection< T >::PrintAllDigi ( )
virtual

Reimplemented from G4VDigiCollection.

Definition at line 189 of file G4TDigiCollection.hh.

190 {
192  std::vector<T*> * theDigiCollection = (std::vector<T*>*)theCollection;
193  size_t n = theDigiCollection->size();
194  for(size_t i=0;i<n;i++)
195  { (*theDigiCollection)[i]->Print(); }
196 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DigiCollection > * aDCAllocator_G4MT_TLS_

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