Import Geant4 8.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:36:02 +02:00
parent d93e1e39a9
commit 8a51e0bc40
5471 changed files with 99628 additions and 55248 deletions
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Allocator.hh,v 1.16 2004/11/29 17:53:41 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Allocator.hh,v 1.17 2005/10/04 13:01:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -88,7 +88,7 @@ class G4Allocator
typedef const Type& const_reference;
template <class U> G4Allocator(const G4Allocator<U>& right) throw()
{ *this = right; }
: mem(right.mem) {}
// Copy constructor
pointer address(reference r) const { return &r; }
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AllocatorPool.hh,v 1.3 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4AllocatorPool.hh,v 1.4 2005/10/04 13:01:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// -------------------------------------------------------------------
@@ -49,7 +49,7 @@ class G4AllocatorPool
{
public:
explicit G4AllocatorPool( unsigned int n );
explicit G4AllocatorPool( unsigned int n=0 );
// Create a pool of elements of size n
~G4AllocatorPool();
// Destructor. Return storage to the free store
@@ -22,7 +22,7 @@
//
//
// $Id: G4ApplicationState.hh,v 1.3 2002/12/04 17:39:50 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
#ifndef G4APPLICATIONSTATE_H
@@ -22,7 +22,7 @@
//
//
// $Id: G4DataVector.hh,v 1.13 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4DataVector.icc,v 1.1 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// class G4DataVector inline implementation
@@ -22,7 +22,7 @@
//
//
// $Id: G4ExceptionSeverity.hh,v 1.2 2002/08/26 14:56:46 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
// Class Description:
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4FastVector.hh,v 1.4 2001/07/11 10:00:49 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4LPhysicsFreeVector.hh,v 1.7 2001/07/11 10:00:49 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4LPhysicsFreeVector.icc,v 1.6 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4OrderedTable.hh,v 1.12 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -0,0 +1,58 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * 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. *
// ********************************************************************
//
#include "CLHEP/Units/PhysicalConstants.h"
using CLHEP::pi;
using CLHEP::twopi;
using CLHEP::halfpi;
using CLHEP::pi2;
using CLHEP::Avogadro;
using CLHEP::c_light;
using CLHEP::c_squared;
using CLHEP::h_Planck;
using CLHEP::hbar_Planck;
using CLHEP::hbarc;
using CLHEP::hbarc_squared;
using CLHEP::electron_charge;
using CLHEP::e_squared;
using CLHEP::electron_mass_c2;
using CLHEP::proton_mass_c2;
using CLHEP::neutron_mass_c2;
using CLHEP::amu_c2;
using CLHEP::amu;
using CLHEP::mu0;
using CLHEP::epsilon0;
using CLHEP::elm_coupling;
using CLHEP::fine_structure_const;
using CLHEP::classic_electr_radius;
using CLHEP::electron_Compton_length;
using CLHEP::Bohr_radius;
using CLHEP::alpha_rcl2;
using CLHEP::twopi_mc2_rcl2;
using CLHEP::k_Boltzmann;
using CLHEP::STP_Temperature;
using CLHEP::STP_Pressure;
using CLHEP::kGasThreshold;
using CLHEP::universe_mean_density;
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsFreeVector.hh,v 1.9 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//--------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsLinearVector.hh,v 1.9 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//--------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsLnVector.hh,v 1.11 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//--------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsLogVector.hh,v 1.10 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//--------------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsOrderedFreeVector.hh,v 1.8 2001/07/11 10:00:50 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
////////////////////////////////////////////////////////////////////////
// PhysicsOrderedFreeVector Class Definition
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsOrderedFreeVector.icc,v 1.7 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
////////////////////////////////////////////////////////////////////////
// PhysicsOrderedFreeVector Class Inline Functions Definitions
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsTable.hh,v 1.16 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsTable.icc,v 1.7 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsVector.hh,v 1.13 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsVector.icc,v 1.8 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4PhysicsVectorType.hh,v 1.3 2001/07/11 10:00:51 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
// --------------------------------------------------------------
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4ReferenceCountedHandle.hh,v 1.14 2001/11/07 09:35:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Class G4ReferenceCountedHandle
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4RotationMatrix.hh,v 1.3 2001/07/11 10:00:51 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4RotationMatrix.hh,v 1.4 2005/11/04 08:18:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ----------------------------------------------------------------------
@@ -38,6 +38,6 @@
#include "G4ThreeVector.hh"
#include <CLHEP/Vector/Rotation.h>
typedef HepRotation G4RotationMatrix;
typedef CLHEP::HepRotation G4RotationMatrix;
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4SIunits.hh,v 1.3 2003/02/05 15:25:59 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
// ----------------------------------------------------------------------
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4StateManager.hh,v 1.9 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4StateManager.icc,v 1.1 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4String.hh,v 1.5 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//---------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4String.icc,v 1.7 2005/03/16 13:45:16 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//---------------------------------------------------------------
@@ -0,0 +1,137 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * 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. *
// ********************************************************************
//
#include "CLHEP/Units/SystemOfUnits.h"
using CLHEP::millimeter;
using CLHEP::millimeter2;
using CLHEP::millimeter3;
using CLHEP::centimeter;
using CLHEP::centimeter2;
using CLHEP::centimeter3;
using CLHEP::meter;
using CLHEP::meter2;
using CLHEP::meter3;
using CLHEP::kilometer;
using CLHEP::kilometer2;
using CLHEP::kilometer3;
using CLHEP::parsec;
using CLHEP::micrometer;
using CLHEP::nanometer;
using CLHEP::angstrom;
using CLHEP::fermi;
using CLHEP::barn;
using CLHEP::millibarn;
using CLHEP::microbarn;
using CLHEP::nanobarn;
using CLHEP::picobarn;
using CLHEP::mm;
using CLHEP::um;
using CLHEP::nm;
using CLHEP::mm2;
using CLHEP::mm3;
using CLHEP::cm;
using CLHEP::cm2;
using CLHEP::cm3;
using CLHEP::m;
using CLHEP::m2;
using CLHEP::m3;
using CLHEP::km;
using CLHEP::km2;
using CLHEP::km3;
using CLHEP::pc;
using CLHEP::radian;
using CLHEP::milliradian;
using CLHEP::degree;
using CLHEP::steradian;
using CLHEP::rad;
using CLHEP::mrad;
using CLHEP::sr;
using CLHEP::deg;
using CLHEP::nanosecond;
using CLHEP::second;
using CLHEP::millisecond;
using CLHEP::microsecond;
using CLHEP::picosecond;
using CLHEP::hertz;
using CLHEP::kilohertz;
using CLHEP::megahertz;
using CLHEP::ns;
using CLHEP::s;
using CLHEP::ms;
using CLHEP::eplus;
using CLHEP::e_SI;
using CLHEP::coulomb;
using CLHEP::megaelectronvolt;
using CLHEP::electronvolt;
using CLHEP::kiloelectronvolt;
using CLHEP::gigaelectronvolt;
using CLHEP::teraelectronvolt;
using CLHEP::petaelectronvolt;
using CLHEP::joule;
using CLHEP::MeV;
using CLHEP::eV;
using CLHEP::keV;
using CLHEP::GeV;
using CLHEP::TeV;
using CLHEP::PeV;
using CLHEP::kilogram;
using CLHEP::gram;
using CLHEP::milligram;
using CLHEP::kg;
using CLHEP::g;
using CLHEP::mg;
using CLHEP::watt;
using CLHEP::newton;
using CLHEP::hep_pascal;
using CLHEP::bar;
using CLHEP::atmosphere;
using CLHEP::ampere;
using CLHEP::milliampere;
using CLHEP::microampere;
using CLHEP::nanoampere;
using CLHEP::megavolt;
using CLHEP::kilovolt;
using CLHEP::volt;
using CLHEP::ohm;
using CLHEP::farad;
using CLHEP::millifarad;
using CLHEP::microfarad;
using CLHEP::nanofarad;
using CLHEP::picofarad;
using CLHEP::weber;
using CLHEP::tesla;
using CLHEP::gauss;
using CLHEP::kilogauss;
using CLHEP::henry;
using CLHEP::kelvin;
using CLHEP::mole;
using CLHEP::becquerel;
using CLHEP::curie;
using CLHEP::gray;
using CLHEP::candela;
using CLHEP::lumen;
using CLHEP::lux;
using CLHEP::perCent;
using CLHEP::perThousand;
using CLHEP::perMillion;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ThreeVector.hh,v 1.3 2001/07/11 10:00:51 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4ThreeVector.hh,v 1.4 2005/11/04 08:18:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ----------------------------------------------------------------------
@@ -37,6 +37,6 @@
#include "globals.hh"
#include <CLHEP/Vector/ThreeVector.h>
typedef Hep3Vector G4ThreeVector;
typedef CLHEP::Hep3Vector G4ThreeVector;
#endif
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Timer.hh,v 1.13 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ----------------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Timer.icc,v 1.1 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4Tokenizer.hh,v 1.1 2001/10/11 14:04:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//---------------------------------------------------------------
+7 -9
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Types.hh,v 1.12 2005/04/22 09:32:01 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Types.hh,v 1.13 2005/11/09 10:26:23 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// GEANT4 native types
@@ -54,13 +54,6 @@
#define G4DLLIMPORT
#endif
// Disable deprecated warnings for usage of strstream on Linux
// architectures with gcc >= 3.0 release
//
#if (__GNUC__>=3) && (__GNUC_MINOR__>=0)
#undef __DEPRECATED
#endif
#include <complex>
// Typedefs to decouple from library classes
@@ -73,4 +66,9 @@ typedef bool G4bool;
typedef long G4long;
typedef std::complex<G4double> G4complex;
// Forward declation of void type argument for usage in direct object
// persistency to define fake default constructors
//
class __void__;
#endif /* G4TYPES_HH */
@@ -22,7 +22,7 @@
//
//
// $Id: G4UnitsTable.hh,v 1.16 2005/03/21 16:04:56 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// -----------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4UnitsTable.icc,v 1.1 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4UserLimits.hh,v 1.8 2004/01/23 02:23:09 kurasige Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// class G4UserLimits
@@ -22,7 +22,7 @@
//
//
// $Id: G4UserLimits.icc,v 1.7 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4VExceptionHandler.hh,v 1.1 2002/08/19 18:20:11 asaim Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4VStateDependent.hh,v 1.4 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ------------------------------------------------------------
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * 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: G4Version.hh,v 1.1 2005/11/28 10:59:30 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// Version information
//
// History:
// 26.09.05 K.Murakami - Created
//
#ifndef G4VERSION_HH
#define G4VERSION_HH
// Numbering rule for "G4VERSION_NUMBER":
// - The number is consecutive (i.e. 711) as an integer.
// - The meaning of each digit is as follows;
//
// 711
// |--> major version number
// |--> minor version number
// |--> patch number
#ifndef G4VERSION_NUMBER
#define G4VERSION_NUMBER 800
#endif
#ifndef G4VERSION_TAG
#define G4VERSION_TAG "$Name: geant4-08-00 $"
#endif
// as variables
#include "G4String.hh"
static const G4String G4Version = "$Name: geant4-08-00 $";
static const G4String G4Date = "(16-December-2005)";
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4coutDestination.hh,v 1.5 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ios.hh,v 1.9 2004/06/09 07:30:01 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// ---------------------------------------------------------------
@@ -21,66 +21,59 @@
// ********************************************************************
//
//
// $Id: G4strstreambuf.hh,v 1.12 2004/06/09 07:30:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4strstreambuf.hh,v 1.14 2005/11/04 08:18:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
// ====================================================================
//
//
// ---------------------------------------------------------------
// GEANT 4 class header file
// G4strstreambuf
//
// G4strstrambuf.hh
//
// ---------------------------------------------------------------
#ifndef G4STRSTREAM_HH
#define G4STRSTREAM_HH
// ====================================================================
#ifndef G4_STR_STREAM_BUF_HH
#define G4_STR_STREAM_BUF_HH
#include "G4Types.hh"
#include <strstream>
#include "globals.hh"
#include "globals.hh"
#include "G4coutDestination.hh"
#include <streambuf>
class G4strstreambuf;
#if defined G4IOS_EXPORT
extern G4DLLEXPORT G4strstreambuf G4coutbuf;
extern G4DLLEXPORT G4strstreambuf G4cerrbuf;
extern G4DLLEXPORT G4strstreambuf G4coutbuf;
extern G4DLLEXPORT G4strstreambuf G4cerrbuf;
#else
extern G4DLLIMPORT G4strstreambuf G4coutbuf;
extern G4DLLIMPORT G4strstreambuf G4cerrbuf;
extern G4DLLIMPORT G4strstreambuf G4coutbuf;
extern G4DLLIMPORT G4strstreambuf G4cerrbuf;
#endif
class G4strstreambuf : public std::streambuf
class G4strstreambuf : public std::basic_streambuf<char>
{
typedef std::streambuf std_streambuf;
public:
G4strstreambuf();
~G4strstreambuf();
virtual G4int overflow(G4int c=EOF);
virtual G4int sync();
inline void SetDestination(G4coutDestination * value);
inline G4int overflow(G4int c=EOF);
inline G4int sync();
#ifdef WIN32
inline G4int underflow();
virtual G4int underflow();
#endif
inline G4int ReceiveString ();
void SetDestination(G4coutDestination* dest);
G4int ReceiveString ();
private:
char* buffer;
G4int count, size;
G4coutDestination* destination;
// hidden...
G4strstreambuf(const G4strstreambuf&);
G4strstreambuf& operator=(const G4strstreambuf&);
private:
G4coutDestination * destination;
char* buffer;
G4int count,size;
};
#include "G4strstreambuf.icc"
#endif
@@ -21,111 +21,125 @@
// ********************************************************************
//
//
// $Id: G4strstreambuf.icc,v 1.10 2005/03/15 19:11:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4strstreambuf.icc,v 1.12 2005/11/28 10:03:07 kmura Exp $
// GEANT4 tag $Name: geant4-08-00 $
// ====================================================================
// G4strstreambuf.icc
//
//
// ---------------------------------------------------------------
//
// class G4strstreambuf
// inline implementation
//
// ---------------------------------------------------------------
// ====================================================================
inline
G4strstreambuf::G4strstreambuf()
: destination(0), count(0)
///////////////////////////////////////
inline G4strstreambuf::G4strstreambuf()
: std::basic_streambuf<char>(),
count(0), destination(0)
///////////////////////////////////////
{
size = 4095;
buffer = new char[size+1];
size= 4095;
buffer= new char[size+1];
}
inline
G4strstreambuf::~G4strstreambuf()
////////////////////////////////////////
inline G4strstreambuf::~G4strstreambuf()
////////////////////////////////////////
{
// flushing buffer...
// std::cout is used because destination object may not be alive.
if(count !=0) std::cout << buffer;
delete [] buffer;
}
inline
G4strstreambuf::G4strstreambuf(const G4strstreambuf& right)
: std_streambuf(), destination(right.destination),
buffer(right.buffer), count(right.count), size(right.size)
//////////////////////////////////////////////////////////////////
inline G4strstreambuf::G4strstreambuf(const G4strstreambuf& right)
: std::basic_streambuf<char>(),
buffer(right.buffer),
count(right.count), size(right.size),
destination(right.destination)
//////////////////////////////////////////////////////////////////
{
}
inline
G4strstreambuf& G4strstreambuf::operator=(const G4strstreambuf& right)
{
if (&right==this) { return *this; }
destination = right.destination;
buffer = right.buffer;
count = right.count;
size = right.size;
/////////////////////////////////////////////////////////////////////////////
inline G4strstreambuf& G4strstreambuf::operator=(const G4strstreambuf& right)
/////////////////////////////////////////////////////////////////////////////
{
if(&right==this) return *this;
destination= right.destination;
buffer= right.buffer;
count= right.count;
size= right.size;
return *this;
}
inline
void G4strstreambuf::SetDestination(G4coutDestination * value)
{
destination = value;
}
inline
G4int G4strstreambuf::overflow(G4int c)
//////////////////////////////////////////////
inline G4int G4strstreambuf::overflow(G4int c)
//////////////////////////////////////////////
{
G4int result = 0;
if(count>=size) { result = sync(); }
buffer[count] = c;
G4int result= 0;
if(count>=size) result= sync();
buffer[count]= c;
count++;
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 (__GNUC__==3) && (__GNUC_MINOR__==0)
if (this == & G4coutbuf || this == & G4cerrbuf) result = c;
#endif
}
return result;
}
inline
G4int G4strstreambuf::sync()
///////////////////////////////////
inline G4int G4strstreambuf::sync()
///////////////////////////////////
{
buffer[count] = '\0';
count = 0;
return ReceiveString ();
count= 0;
return ReceiveString();
}
#ifdef WIN32
inline
G4int G4strstreambuf::underflow()
////////////////////////////////////////
inline G4int G4strstreambuf::underflow()
////////////////////////////////////////
{
return 0;
}
#endif
inline
G4int G4strstreambuf::ReceiveString ()
///////////////////////////////////////////////////////////////////
inline void G4strstreambuf::SetDestination(G4coutDestination* dest)
///////////////////////////////////////////////////////////////////
{
destination= dest;
}
/////////////////////////////////////////////
inline G4int G4strstreambuf::ReceiveString ()
/////////////////////////////////////////////
{
G4String stringToSend(buffer);
G4int result =0;
if(this == & G4coutbuf && destination != 0) {
result = destination->ReceiveG4cout(stringToSend);
} else if(this == & G4cerrbuf && destination != 0) {
result = destination->ReceiveG4cerr(stringToSend);
} else if(this == & G4coutbuf && destination == 0) {
G4int result= 0;
if(this == &G4coutbuf && destination != 0) {
result= destination-> ReceiveG4cout(stringToSend);
} else if(this == &G4cerrbuf && destination != 0) {
result= destination-> ReceiveG4cerr(stringToSend);
} else if(this == &G4coutbuf && destination == 0) {
std::cout << stringToSend << std::flush;
result =0;
} else if(this == & G4cerrbuf && destination == 0) {
result= 0;
} else if(this == &G4cerrbuf && destination == 0) {
std::cerr << stringToSend << std::flush;
result =0;
result= 0;
}
return result;
}
+6 -5
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: globals.hh,v 1.25 2004/11/12 16:25:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: globals.hh,v 1.26 2005/11/04 08:18:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Global Constants and typedefs
@@ -38,7 +38,7 @@
// 26.08.98 J.Allison,E.Tcherniaev - Introduced min/max/sqr/abs functions
// 22.09.98 G.Cosmo - Removed min/max/sqr/abs functions and replaced with
// inclusion of CLHEP/config/TemplateFunctions.h for CLHEP-1.3
// 15.12.99 G.Gracia - Included min, max definitions for NT with ISO standard
// 15.12.99 G.Garcia - Included min, max definitions for NT with ISO standard
// 15.06.01 G.Cosmo - Removed cbrt() definition
#ifndef GLOBALS_HH
@@ -64,8 +64,9 @@
// Includes some additional definitions: sqr, G4SwapPtr, G4SwapObj.
#include "templates.hh"
// System of Units and Physical Constants
#include <CLHEP/Units/PhysicalConstants.h>
// Includes Physical Constants and System of Units
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
// Global error function
#include "G4ExceptionSeverity.hh"
+15 -13
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: templates.hh,v 1.8 2004/11/12 17:38:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: templates.hh,v 1.9 2005/12/02 13:42:49 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// -*- C++ -*-
@@ -48,6 +48,8 @@
#ifndef templates_h
#define templates_h 1
#include <limits>
//
// If HIGH_PRECISION is defined to TRUE (ie. != 0) then the type "Float"
// is typedefed to "double". If it is FALSE (ie. 0) it is typedefed
@@ -67,39 +69,39 @@ typedef float Float;
// and temporarly defined for portability on HP-UX.
#ifndef DBL_MIN /* Min decimal value of a double */
#define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN std::numeric_limits<double>::min() // 2.2250738585072014e-308
#endif
#ifndef DBL_DIG /* Digits of precision of a double */
#define DBL_DIG 15
#define DBL_DIG std::numeric_limits<double>::digits10 // 15
#endif
#ifndef DBL_MAX /* Max decimal value of a double */
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX std::numeric_limits<double>::max() // 1.7976931348623157e+308
#endif
#ifndef DBL_EPSILON
#define DBL_EPSILON 2.2204460492503131e-16
#endif
#define DBL_EPSILON std::numeric_limits<double>::epsilon()
#endif // 2.2204460492503131e-16
#ifndef FLT_MIN /* Min decimal value of a float */
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN std::numeric_limits<float>::min() // 1.17549435e-38F
#endif
#ifndef FLT_DIG /* Digits of precision of a float */
#define FLT_DIG 6
#define FLT_DIG std::numeric_limits<float>::digits10 // 6
#endif
#ifndef FLT_MAX /* Max decimal value of a float */
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX std::numeric_limits<float>::max() // 3.40282347e+38F
#endif
#ifndef FLT_EPSILON
#define FLT_EPSILON 1.192092896e-07F
#endif
#define FLT_EPSILON std::numeric_limits<float>::epsilon()
#endif // 1.192092896e-07F
#ifndef MAXFLOAT /* Max decimal value of a float */
#define MAXFLOAT 3.40282347e+38F
#define MAXFLOAT std::numeric_limits<float>::max() // 3.40282347e+38F
#endif
//---------------------------------