Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4SolidStore.cc,v 2.1 1998/07/12 02:55:40 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// G4SolidStore
|
||||
//
|
||||
// Implementation for singleton container
|
||||
//
|
||||
// History:
|
||||
// 10.07.95 P.Kent Initial version
|
||||
|
||||
#include "G4SolidStore.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
// Protected constructor: Construct underlying container with
|
||||
// initial size of 100 entries
|
||||
G4SolidStore::G4SolidStore() : RWTPtrOrderedVector<G4VSolid>(100)
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
G4SolidStore::~G4SolidStore()
|
||||
{
|
||||
while (!isEmpty()) delete first();
|
||||
}
|
||||
|
||||
// Static class variable
|
||||
G4SolidStore* G4SolidStore::fgInstance = 0;
|
||||
|
||||
// Add Solid to container
|
||||
void G4SolidStore::Register(G4VSolid* pSolid)
|
||||
{
|
||||
GetInstance()->insert(pSolid);
|
||||
}
|
||||
|
||||
// Remove Solid from container
|
||||
void G4SolidStore::DeRegister(G4VSolid* pSolid)
|
||||
{
|
||||
GetInstance()->remove(pSolid);
|
||||
}
|
||||
|
||||
// Return ptr to Store, setting if necessary
|
||||
G4SolidStore* G4SolidStore::GetInstance()
|
||||
{
|
||||
static G4SolidStore worldStore;
|
||||
if (!fgInstance)
|
||||
{
|
||||
fgInstance = &worldStore;
|
||||
}
|
||||
return fgInstance;
|
||||
}
|
||||
Reference in New Issue
Block a user