Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CountedObject< X > Class Template Reference

#include <G4ReferenceCountedHandle.hh>

Public Member Functions

 G4CountedObject (X *pObj=0)
 
 ~G4CountedObject ()
 
void AddRef ()
 
void Release ()
 
void * operator new (size_t)
 
void operator delete (void *pObj)
 

Friends

class G4ReferenceCountedHandle< X >
 

Detailed Description

template<class X>
class G4CountedObject< X >

Definition at line 134 of file G4ReferenceCountedHandle.hh.

Constructor & Destructor Documentation

◆ G4CountedObject()

template<class X >
G4CountedObject< X >::G4CountedObject ( X *  pObj = 0)

Definition at line 180 of file G4ReferenceCountedHandle.hh.

181 : fCount(0), fRep( pObj )
182{
183 if( pObj != 0 ) {
184 fCount = 1;
185 }
186}

◆ ~G4CountedObject()

template<class X >
G4CountedObject< X >::~G4CountedObject

Definition at line 189 of file G4ReferenceCountedHandle.hh.

190{
191 delete fRep;
192}

Member Function Documentation

◆ AddRef()

template<class X >
void G4CountedObject< X >::AddRef
inline

Definition at line 195 of file G4ReferenceCountedHandle.hh.

196{
197 ++fCount;
198}

◆ operator delete()

template<class X >
void G4CountedObject< X >::operator delete ( void *  pObj)
inline

Definition at line 213 of file G4ReferenceCountedHandle.hh.

214{
216}
G4DLLIMPORT G4Allocator< G4CountedObject< void > > aCountedObjectAllocator

◆ operator new()

template<class X >
void * G4CountedObject< X >::operator new ( size_t  )
inline

Definition at line 207 of file G4ReferenceCountedHandle.hh.

208{
209 return( (void *)aCountedObjectAllocator.MallocSingle() );
210}

◆ Release()

template<class X >
void G4CountedObject< X >::Release
inline

Definition at line 201 of file G4ReferenceCountedHandle.hh.

202{
203 if( --fCount == 0 ) delete this;
204}

Friends And Related Function Documentation

◆ G4ReferenceCountedHandle< X >

template<class X >
friend class G4ReferenceCountedHandle< X >
friend

Definition at line 123 of file G4ReferenceCountedHandle.hh.


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