Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4DCofThisEvent Class Reference

#include <G4DCofThisEvent.hh>

Public Member Functions

 G4DCofThisEvent ()
 
 G4DCofThisEvent (G4int cap)
 
 ~G4DCofThisEvent ()
 
voidoperator new (size_t)
 
void operator delete (void *anDCoTE)
 
void AddDigiCollection (G4int DCID, G4VDigiCollection *aDC)
 
 G4DCofThisEvent (const G4DCofThisEvent &)
 
G4DCofThisEventoperator= (const G4DCofThisEvent &)
 
G4VDigiCollectionGetDC (G4int i) const
 
G4int GetNumberOfCollections () const
 
G4int GetCapacity () const
 

Detailed Description

Definition at line 50 of file G4DCofThisEvent.hh.

Constructor & Destructor Documentation

G4DCofThisEvent::G4DCofThisEvent ( )

Definition at line 35 of file G4DCofThisEvent.cc.

37  DC = new std::vector<G4VDigiCollection*>;
38 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_
G4DCofThisEvent::G4DCofThisEvent ( G4int  cap)

Definition at line 40 of file G4DCofThisEvent.cc.

42  DC = new std::vector<G4VDigiCollection*>;
43  for(G4int i=0;i<cap;i++)
44  {
45  DC->push_back((G4VDigiCollection*)0);
46  }
47 }
int G4int
Definition: G4Types.hh:78
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_
G4DCofThisEvent::~G4DCofThisEvent ( )

Definition at line 49 of file G4DCofThisEvent.cc.

51  //DC->clearAndDestroy();
52  for(size_t i=0;i<DC->size();i++)
53  { delete (*DC)[i]; }
54  DC->clear();
55  delete DC;
56 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_
G4DCofThisEvent::G4DCofThisEvent ( const G4DCofThisEvent rhs)

Definition at line 64 of file G4DCofThisEvent.cc.

65 {
67  DC = new std::vector<G4VDigiCollection*>(rhs.DC->size());
68  for ( unsigned int i = 0 ; i < rhs.DC->size() ; ++i )
69  *(DC->at(i)) = *(rhs.DC->at(i));
70 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_

Member Function Documentation

void G4DCofThisEvent::AddDigiCollection ( G4int  DCID,
G4VDigiCollection aDC 
)

Definition at line 58 of file G4DCofThisEvent.cc.

60  if(DCID>=0 && DCID<G4int(DC->size()))
61  { (*DC)[DCID] = aDC; }
62 }
int G4int
Definition: G4Types.hh:78
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_

Here is the caller graph for this function:

G4int G4DCofThisEvent::GetCapacity ( ) const
inline

Definition at line 83 of file G4DCofThisEvent.hh.

84  {
85  return DC->size();
86  }

Here is the caller graph for this function:

G4VDigiCollection* G4DCofThisEvent::GetDC ( G4int  i) const
inline

Definition at line 67 of file G4DCofThisEvent.hh.

68  { return (*DC)[i]; }

Here is the caller graph for this function:

G4int G4DCofThisEvent::GetNumberOfCollections ( ) const
inline

Definition at line 74 of file G4DCofThisEvent.hh.

75  {
76  G4int n = 0;
77  for(auto dc : *DC) if(dc) n++;
78  return n;
79  }
int G4int
Definition: G4Types.hh:78
const G4int n
void G4DCofThisEvent::operator delete ( void anDCoTE)
inline

Definition at line 102 of file G4DCofThisEvent.hh.

104  anDCoTHAllocator.FreeSingle((G4DCofThisEvent*)anDCoTH);
105 }
void FreeSingle(Type *anElement)
Definition: G4Allocator.hh:212
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_

Here is the call graph for this function:

void * G4DCofThisEvent::operator new ( size_t  )
inline

Definition at line 95 of file G4DCofThisEvent.hh.

97  void* anDCoTH;
98  anDCoTH = (void*)anDCoTHAllocator.MallocSingle();
99  return anDCoTH;
100 }
Type * MallocSingle()
Definition: G4Allocator.hh:202
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_

Here is the call graph for this function:

G4DCofThisEvent & G4DCofThisEvent::operator= ( const G4DCofThisEvent rhs)

Definition at line 72 of file G4DCofThisEvent.cc.

73 {
74  if ( this == &rhs ) return *this;
76  for ( std::vector<G4VDigiCollection*>::const_iterator it = DC->begin() ;
77  it != DC->end() ; ++it )
78  {
79  delete *it;
80  }
81  DC->resize(rhs.DC->size());
82  for ( unsigned int i = 0 ; i < rhs.DC->size() ; ++i )
83  *(DC->at(i)) = *(rhs.DC->at(i));
84  return *this;
85 }
G4DLLIMPORT G4ThreadLocal G4Allocator< G4DCofThisEvent > * anDCoTHAllocator_G4MT_TLS_

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