Import Geant4 4.1.0 source tree
This commit is contained in:
@@ -21,19 +21,23 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Allocator.hh,v 1.7 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4Allocator.hh,v 1.10 2002/05/24 10:58:27 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// Class Description:
|
||||
//
|
||||
// A class for fast allocation of objects to the heap through paging
|
||||
// mechanism. It's meant to be used by associating it to the object to
|
||||
// be allocated and defining for it new and delete operators via
|
||||
// MallocSingle() and FreeSingle() methods.
|
||||
|
||||
// ---------------- G4Allocator ----------------
|
||||
// by Tim Bell, September 1995
|
||||
// ------------------------------------------------------------
|
||||
// SG, HPW: Protection vs double deletion of the same element, June 97.
|
||||
|
||||
#ifndef G4Allocator_h
|
||||
#define G4Allocator_h 1
|
||||
@@ -41,98 +45,135 @@
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
||||
// G4AllocatorPage
|
||||
#include "G4AllocatorPage.hh"
|
||||
|
||||
template <class Type>
|
||||
class G4Allocator
|
||||
{
|
||||
G4AllocatorPage<Type> *fPages;
|
||||
G4AllocatorUnit<Type> *fFreeList;
|
||||
|
||||
private:
|
||||
void AddNewPage();
|
||||
Type *AddNewElement();
|
||||
|
||||
enum { Allocated = 0x47416C, Deleted = 0xB8BE93 };
|
||||
public: // with description
|
||||
|
||||
public:
|
||||
G4Allocator();
|
||||
~G4Allocator();
|
||||
G4Allocator();
|
||||
~G4Allocator();
|
||||
// Constructor & destructor
|
||||
|
||||
inline Type *MallocSingle()
|
||||
{
|
||||
Type *anElement;
|
||||
inline Type* MallocSingle();
|
||||
inline void FreeSingle(Type* anElement);
|
||||
// Malloc and Free methods to be used when overloading
|
||||
// new and delete operators in the client <Type> object
|
||||
|
||||
if (fFreeList != NULL)
|
||||
{
|
||||
fFreeList->deleted = Allocated;
|
||||
anElement = &fFreeList->fElement;
|
||||
fFreeList = fFreeList->fNext;
|
||||
}
|
||||
else
|
||||
anElement = AddNewElement();
|
||||
return anElement;
|
||||
}
|
||||
private:
|
||||
|
||||
inline void FreeSingle(Type *anElement)
|
||||
{
|
||||
G4AllocatorUnit<Type> *fUnit;
|
||||
void AddNewPage();
|
||||
Type* AddNewElement();
|
||||
|
||||
fUnit = (G4AllocatorUnit<Type> *)
|
||||
((char *) anElement -
|
||||
offsetof(G4AllocatorUnit<Type>, fElement));
|
||||
if (fUnit->deleted == Allocated) {
|
||||
fUnit->deleted = Deleted;
|
||||
fUnit->fNext = fFreeList;
|
||||
fFreeList = fUnit;
|
||||
}
|
||||
/*
|
||||
else if (fUnit->deleted == Deleted) {
|
||||
// G4cerr << "G4Allocator : This object is already deleted" << G4endl;
|
||||
} else {
|
||||
// G4cerr << "G4Allocator: This object is allocated not by G4Allocator"<< G4endl;
|
||||
}
|
||||
*/
|
||||
}
|
||||
private:
|
||||
|
||||
enum { Allocated = 0x47416C, Deleted = 0xB8BE93 };
|
||||
|
||||
G4AllocatorPage<Type> * fPages;
|
||||
G4AllocatorUnit<Type> * fFreeList;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// Inline implementation
|
||||
// ------------------------------------------------------------
|
||||
|
||||
static const G4int G4AllocatorPageSize = 1024;
|
||||
|
||||
// ************************************************************
|
||||
// G4Allocator constructor
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
G4Allocator<Type>::G4Allocator()
|
||||
{
|
||||
fPages = NULL;
|
||||
fFreeList = NULL;
|
||||
fPages = 0;
|
||||
fFreeList = 0;
|
||||
AddNewPage();
|
||||
return;
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// G4Allocator destructor
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
G4Allocator<Type>::~G4Allocator()
|
||||
{
|
||||
G4AllocatorPage<Type> *aPage;
|
||||
G4AllocatorPage<Type> *aNextPage;
|
||||
G4AllocatorPage<Type> * aPage;
|
||||
G4AllocatorPage<Type> * aNextPage;
|
||||
|
||||
aPage = fPages;
|
||||
while (aPage != NULL)
|
||||
while (aPage != 0)
|
||||
{
|
||||
aNextPage = aPage->fNext;
|
||||
free(aPage->fUnits);
|
||||
delete aPage;
|
||||
aPage = aNextPage;
|
||||
}
|
||||
fPages = NULL;
|
||||
fFreeList = NULL;
|
||||
fPages = 0;
|
||||
fFreeList = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static const G4int G4AllocatorPageSize = 1024;
|
||||
// ************************************************************
|
||||
// MallocSingle
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
Type* G4Allocator<Type>::MallocSingle()
|
||||
{
|
||||
Type * anElement;
|
||||
|
||||
if (fFreeList != 0)
|
||||
{
|
||||
fFreeList->deleted = Allocated;
|
||||
anElement = &fFreeList->fElement;
|
||||
fFreeList = fFreeList->fNext;
|
||||
}
|
||||
else
|
||||
anElement = AddNewElement();
|
||||
return anElement;
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// FreeSingle
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
void G4Allocator<Type>::FreeSingle(Type* anElement)
|
||||
{
|
||||
G4AllocatorUnit<Type> * fUnit;
|
||||
|
||||
// The gcc-3.1 compiler will complain and not correctly handle offsets
|
||||
// computed from non-POD types. Pointers to member data should be used
|
||||
// instead. This advanced C++ feature seems not to work on earlier
|
||||
// versions of the same compiler.
|
||||
//
|
||||
#if (GNU_GCC==1) && (__GNUC__==3) && (__GNUC_MINOR__>0)
|
||||
Type G4AllocatorUnit<Type>::*pOffset = &G4AllocatorUnit<Type>::fElement;
|
||||
fUnit = (G4AllocatorUnit<Type> *) ((char *)anElement - size_t(pOffset));
|
||||
#else
|
||||
fUnit = (G4AllocatorUnit<Type> *)
|
||||
((char *) anElement - offsetof(G4AllocatorUnit<Type>, fElement));
|
||||
#endif
|
||||
|
||||
if (fUnit->deleted == Allocated)
|
||||
{
|
||||
fUnit->deleted = Deleted;
|
||||
fUnit->fNext = fFreeList;
|
||||
fFreeList = fUnit;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// AddNewPage
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
void G4Allocator<Type>::AddNewPage()
|
||||
{
|
||||
G4AllocatorPage<Type> *aPage;
|
||||
G4AllocatorPage<Type> * aPage;
|
||||
register G4int unit_no;
|
||||
|
||||
aPage = new G4AllocatorPage<Type>;
|
||||
@@ -151,10 +192,14 @@ void G4Allocator<Type>::AddNewPage()
|
||||
fFreeList = &aPage->fUnits[0];
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// AddNewElement
|
||||
// ************************************************************
|
||||
//
|
||||
template <class Type>
|
||||
Type *G4Allocator<Type>::AddNewElement()
|
||||
Type* G4Allocator<Type>::AddNewElement()
|
||||
{
|
||||
Type *anElement;
|
||||
Type* anElement;
|
||||
|
||||
AddNewPage();
|
||||
fFreeList->deleted = Allocated;
|
||||
@@ -163,5 +208,4 @@ Type *G4Allocator<Type>::AddNewElement()
|
||||
return anElement;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,15 +21,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4AllocatorPage.hh,v 1.3 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4AllocatorPage.hh,v 1.4 2002/05/21 10:31:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// -------------- G4AllocatorPage ----------------
|
||||
// by Tim Bell, September 1995
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -21,15 +21,13 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4AllocatorUnit.hh,v 1.3 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4AllocatorUnit.hh,v 1.4 2002/05/21 10:31:25 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
//
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// -------------- G4AllocatorUnit ----------------
|
||||
// by Tim Bell, September 1995
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ApplicationState.hh,v 1.2 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
|
||||
#ifndef G4APPLICATIONSTATE_H
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DataVector.hh,v 1.10 2001/09/17 08:17:56 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4DataVector.hh,v 1.11 2002/04/19 07:10:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -60,7 +60,7 @@ class G4DataVector : public G4std::vector<G4double>
|
||||
// Constructor given a 'capacity' defining the initial number of elements
|
||||
// and initialising them to 'value'.
|
||||
|
||||
virtual ~G4DataVector(){;}
|
||||
virtual ~G4DataVector();
|
||||
// Empty destructor
|
||||
|
||||
inline void insertAt(size_t, const G4double&);
|
||||
@@ -87,24 +87,6 @@ class G4DataVector : public G4std::vector<G4double>
|
||||
friend G4std::ostream& operator<<(G4std::ostream&, const G4DataVector&);
|
||||
};
|
||||
|
||||
inline
|
||||
G4DataVector::G4DataVector()
|
||||
: G4std::vector<G4double>()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
G4DataVector::G4DataVector(size_t capacity)
|
||||
: G4std::vector<G4double>(capacity)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
G4DataVector::G4DataVector(size_t capacity, G4double value)
|
||||
: G4std::vector<G4double>(capacity, value)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
void G4DataVector::insertAt(size_t pos, const G4double& a)
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FastVector.hh,v 1.4 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LPhysicsFreeVector.hh,v 1.7 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LPhysicsFreeVector.icc,v 1.5 2001/07/11 10:00:49 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OrderedTable.hh,v 1.9 2001/09/17 08:17:57 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4OrderedTable.hh,v 1.10 2002/04/19 07:10:32 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -64,7 +64,7 @@ class G4OrderedTable : public G4std::vector<G4DataVector*>
|
||||
// Constructor given a 'capacity' defining the initial
|
||||
// number of elements (NULL pointers are filled up)
|
||||
|
||||
virtual ~G4OrderedTable(){;}
|
||||
virtual ~G4OrderedTable();
|
||||
// Empty Destructor
|
||||
|
||||
inline void clearAndDestroy();
|
||||
@@ -84,18 +84,6 @@ typedef G4OrderedTable::iterator G4OrderedTableIterator;
|
||||
|
||||
#include "G4DataVector.hh"
|
||||
|
||||
inline
|
||||
G4OrderedTable::G4OrderedTable()
|
||||
: G4std::vector<G4DataVector*>()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
G4OrderedTable::G4OrderedTable(size_t capacity)
|
||||
: G4std::vector<G4DataVector*>(capacity, (G4DataVector*)(0) )
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
void G4OrderedTable::clearAndDestroy()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsFreeVector.hh,v 1.8 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsLinearVector.hh,v 1.7 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsLnVector.hh,v 1.8 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsLogVector.hh,v 1.7 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsOrderedFreeVector.hh,v 1.8 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// PhysicsOrderedFreeVector Class Definition
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsOrderedFreeVector.icc,v 1.6 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// PhysicsOrderedFreeVector Class Inline Functions Definitions
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsTable.hh,v 1.11 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsTable.icc,v 1.4 2001/07/11 10:00:50 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsVector.hh,v 1.10 2001/07/11 10:00:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsVector.icc,v 1.7 2001/07/11 10:00:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4PhysicsVectorType.hh,v 1.3 2001/07/11 10:00:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
|
||||
Executable → Regular
+1
-1
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ReferenceCountedHandle.hh,v 1.14 2001/11/07 09:35:24 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// Class G4ReferenceCountedHandle
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4RotationMatrix.hh,v 1.3 2001/07/11 10:00:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SIunits.hh,v 1.2 2001/07/11 10:00:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StateManager.hh,v 1.5 2001/07/18 17:59:22 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4StateManager.hh,v 1.6 2002/04/16 18:19:13 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -82,6 +82,11 @@ public: // with description
|
||||
// Set Geant4 to a new state.
|
||||
// In case the request is irregal, false will be returned
|
||||
// and the state of Geant4 will not be changed.
|
||||
G4bool SetNewState(G4ApplicationState requestedState, const char* msg);
|
||||
// Set Geant4 to a new state.
|
||||
// In case the request is irregal, false will be returned
|
||||
// and the state of Geant4 will not be changed.
|
||||
// "msg" is information associating to this state change
|
||||
G4bool RegisterDependent(G4VStateDependent* aDependent,G4bool bottom=false);
|
||||
// Register a concrete class of G4VStateDependent.
|
||||
// Registered concrete classes will be notified via
|
||||
@@ -121,10 +126,12 @@ private:
|
||||
G4std::vector<G4VStateDependent*> theDependentsList;
|
||||
G4VStateDependent* theBottomDependent;
|
||||
G4int suppressAbortion;
|
||||
const char* msgptr;
|
||||
|
||||
public:
|
||||
inline void SetSuppressAbortion(G4int i) { suppressAbortion = i; }
|
||||
inline G4int GetSuppressAbortion() const { return suppressAbortion; }
|
||||
inline const char* GetMessage() const { return msgptr; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4String.hh,v 1.2 2001/11/29 14:45:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4String.hh,v 1.3 2002/03/25 15:32:18 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -116,11 +116,11 @@ public:
|
||||
inline G4String ( const char * );
|
||||
inline G4String ( const G4String& );
|
||||
inline G4String ( const G4SubString& );
|
||||
inline G4String ( const std_string& );
|
||||
inline G4String ( const G4std::string & );
|
||||
virtual ~G4String () {}
|
||||
|
||||
inline G4String& operator=(const G4String&);
|
||||
inline G4String& operator=(const std_string&);
|
||||
inline G4String& operator=(const G4std::string &);
|
||||
inline G4String& operator=(const char*);
|
||||
|
||||
inline char operator () (str_size) const;
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
|
||||
inline G4String& operator+=(const G4SubString&);
|
||||
inline G4String& operator+=(const char*);
|
||||
inline G4String& operator+=(const std_string&);
|
||||
inline G4String& operator+=(const G4std::string &);
|
||||
inline G4String& operator+=(const char&);
|
||||
inline G4bool operator==(const G4String&) const;
|
||||
inline G4bool operator==(const char*) const;
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
inline G4int first(char) const;
|
||||
inline G4int last(char) const;
|
||||
|
||||
inline G4bool contains(std_string) const;
|
||||
inline G4bool contains(G4std::string) const;
|
||||
inline G4bool contains(char) const;
|
||||
|
||||
// stripType = 0 beginning
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4String.icc,v 1.2 2001/11/29 14:45:12 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4String.icc,v 1.3 2002/03/25 15:32:18 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -150,7 +150,7 @@ G4String::G4String ( const G4String& s )
|
||||
G4String::G4String ( const G4SubString& s )
|
||||
: std_string(*(s.mystring),s.mystart,s.extent) {}
|
||||
|
||||
G4String::G4String ( const std_string& s )
|
||||
G4String::G4String ( const G4std::string &s )
|
||||
: std_string(s) {}
|
||||
|
||||
G4String& G4String::operator=(const G4String& s)
|
||||
@@ -159,7 +159,7 @@ G4String& G4String::operator=(const G4String& s)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4String& G4String::operator=(const std_string& s)
|
||||
G4String& G4String::operator=(const G4std::string &s)
|
||||
{
|
||||
std_string::operator=(s);
|
||||
return *this;
|
||||
@@ -199,7 +199,7 @@ G4String& G4String::operator+=(const char*s)
|
||||
return *this;
|
||||
}
|
||||
|
||||
G4String& G4String::operator+=(const std_string &s)
|
||||
G4String& G4String::operator+=(const G4std::string &s)
|
||||
{
|
||||
std_string::operator+=(s);
|
||||
return *this;
|
||||
@@ -344,7 +344,7 @@ G4int G4String::last(char c) const
|
||||
return rfind(c);
|
||||
}
|
||||
|
||||
G4bool G4String::contains(std_string s) const
|
||||
G4bool G4String::contains(G4std::string s) const
|
||||
{
|
||||
G4int i=std_string::find(s);
|
||||
if(i != G4int(std_string::npos))
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ThreeVector.hh,v 1.3 2001/07/11 10:00:51 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Timer.hh,v 1.11 2001/07/11 10:00:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Tokenizer.hh,v 1.1 2001/10/11 14:04:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Types.hh,v 1.5 2001/07/11 10:00:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// GEANT4 native types
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UnitsTable.hh,v 1.11 2001/07/11 10:00:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserLimits.hh,v 1.7 2001/07/11 10:00:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// class G4UserLimits
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UserLimits.icc,v 1.6 2001/07/11 10:00:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VStateDependent.hh,v 1.3 2001/07/11 10:00:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4coutDestination.hh,v 1.4 2001/07/11 10:00:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ios.hh,v 1.6 2001/07/11 10:00:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4strstreambuf.hh,v 1.8 2001/07/11 10:00:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4strstreambuf.icc,v 1.2 2001/07/11 10:00:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4strstreambuf.icc,v 1.6 2002/05/24 15:01:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------------
|
||||
@@ -35,7 +35,7 @@
|
||||
inline
|
||||
G4strstreambuf::G4strstreambuf()
|
||||
{
|
||||
destination = NULL;
|
||||
destination = 0;
|
||||
count = 0;
|
||||
size = 4095;
|
||||
buffer = new char[size+1];
|
||||
@@ -44,7 +44,7 @@ G4strstreambuf::G4strstreambuf()
|
||||
inline
|
||||
G4strstreambuf::~G4strstreambuf()
|
||||
{
|
||||
delete buffer;
|
||||
delete [] buffer;
|
||||
}
|
||||
|
||||
inline
|
||||
@@ -77,17 +77,20 @@ inline
|
||||
G4int G4strstreambuf::overflow(G4int c)
|
||||
{
|
||||
G4int result = 0;
|
||||
if(count>=size) {
|
||||
buffer[count] = '\0';
|
||||
count = 0;
|
||||
result = ReceiveString ();
|
||||
}
|
||||
if(count>=size) result = sync();
|
||||
buffer[count] = c;
|
||||
count++;
|
||||
if(c=='\n') {
|
||||
buffer[count] = '\0';
|
||||
count = 0;
|
||||
result = ReceiveString ();
|
||||
if(c=='\n')
|
||||
{
|
||||
result = sync();
|
||||
|
||||
// Fix to overcome a bug on GNU gcc-3.0.X compilers. The return value
|
||||
// for cout, cerr overflow() function has to be c instead of 0 when
|
||||
// buffer is flushed for carriage-return.
|
||||
//
|
||||
#if defined(GNU_GCC) && defined(G4USE_STD_NAMESPACE) && (__GNUC__==3) && (__GNUC_MINOR__==0)
|
||||
if (this == & G4coutbuf || this == & G4cerrbuf) result = c;
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -111,18 +114,19 @@ G4int G4strstreambuf::underflow()
|
||||
inline
|
||||
G4int G4strstreambuf::ReceiveString ()
|
||||
{
|
||||
G4String stringToSend = G4String(buffer);
|
||||
G4String stringToSend(buffer);
|
||||
G4int result =0;
|
||||
if(this == & G4coutbuf && destination != NULL) {
|
||||
if(this == & G4coutbuf && destination != 0) {
|
||||
result = destination->ReceiveG4cout(stringToSend);
|
||||
} else if(this == & G4cerrbuf && destination != NULL) {
|
||||
} else if(this == & G4cerrbuf && destination != 0) {
|
||||
result = destination->ReceiveG4cerr(stringToSend);
|
||||
} else if(this == & G4coutbuf && destination == NULL) {
|
||||
} else if(this == & G4coutbuf && destination == 0) {
|
||||
G4std::cout << stringToSend << G4std::flush;
|
||||
result =0;
|
||||
} else if(this == & G4cerrbuf && destination == NULL) {
|
||||
} else if(this == & G4cerrbuf && destination == 0) {
|
||||
G4std::cerr << stringToSend << G4std::flush;
|
||||
result =0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: PhysicalConstants.h,v 1.6 2001/07/11 10:00:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: SystemOfUnits.h,v 1.7 2001/07/11 10:00:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: algorithm,v 1.3 1999/11/16 17:42:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- algorithm ----------------
|
||||
//
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: complex,v 1.3 2000/06/15 17:32:10 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- complex ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: deque,v 1.2 2001/10/22 14:33:31 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- deque ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: fstream,v 1.3 1999/11/16 17:43:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- fstream ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: functional,v 1.3 1999/11/16 17:43:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- functional ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: iomanip,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- iomanip ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: iostream,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- iostream ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: list,v 1.1 2000/08/22 07:54:26 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- list ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: map,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- map ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: queue,v 1.1 2000/08/02 09:49:56 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- queue ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: set,v 1.3 1999/11/16 17:43:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- set ----------------
|
||||
//
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: streambuf,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- streambuf ----------------
|
||||
//
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: strstream,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: strstream,v 1.4 2002/05/24 15:01:05 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- strstream ----------------
|
||||
//
|
||||
@@ -20,6 +20,9 @@
|
||||
#include <strstream.h>
|
||||
#endif /* WIN32 */
|
||||
#else
|
||||
#if (__GNUC__==3) && (__GNUC_MINOR__>0)
|
||||
#undef __DEPRECATED
|
||||
#endif
|
||||
#include <strstream>
|
||||
#endif /* G4USE_STD_NAMESPACE */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: vector,v 1.3 1999/11/16 17:43:09 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// ---------------- vector ----------------
|
||||
//
|
||||
|
||||
@@ -2,9 +2,5 @@
|
||||
#define __CMATH__
|
||||
|
||||
#include <math.h>
|
||||
inline float abs (float x) { return fabs (x); }
|
||||
inline double abs (double x) { return fabs (x); }
|
||||
inline long double abs (long double x) { return fabs (x); }
|
||||
|
||||
|
||||
#endif // __CMATH__
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
#include <fstream.h>
|
||||
@@ -1 +0,0 @@
|
||||
#include <iomanip.h>
|
||||
@@ -1 +0,0 @@
|
||||
#include <iostream.h>
|
||||
@@ -1 +0,0 @@
|
||||
#include <strstream.h>
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef __CMATH__
|
||||
#define __CMATH__
|
||||
|
||||
#include <math.h>
|
||||
inline float abs (float x) { return fabs (x); }
|
||||
inline double abs (double x) { return fabs (x); }
|
||||
inline long double abs (long double x) { return fabs (x); }
|
||||
|
||||
|
||||
#endif // __CMATH__
|
||||
@@ -1 +0,0 @@
|
||||
#include<stdio.h>
|
||||
@@ -1,8 +0,0 @@
|
||||
// The -*- C++ -*- standard library header.
|
||||
// This file is part of the GNU ANSI C++ Library.
|
||||
|
||||
#ifndef __CSTDLIB__
|
||||
#define __CSTDLIB__
|
||||
#include <stdlib.h>
|
||||
|
||||
#endif
|
||||
@@ -1 +0,0 @@
|
||||
#include <string.h>
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: globals.hh,v 1.19 2001/10/12 12:18:21 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// Global Constants and typedefs
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: templates.hh,v 1.6 2001/07/11 10:00:55 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// -*- C++ -*-
|
||||
|
||||
Reference in New Issue
Block a user