Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -1,73 +1,37 @@
// 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: G4strstreambuf.hh,v 1.4 1999/11/23 15:00:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
//
// ---------------------------------------------------------------
// GEANT 4 class header file
//
// G4strstrambuf.hh
//
// ---------------------------------------------------------------
#ifndef G4STRSTREAM_HH
#define G4STRSTREAM_HH
#include <iostream.h>
#ifdef WIN32
#include <Strstrea.h>
#else
#include <strstream.h>
#endif
#include "g4std/strstream"
#include "globals.hh"
#include "G4coutDestination.hh"
class G4strstreambuf;
extern G4strstreambuf G4coutbuf;
extern G4strstreambuf G4cerrbuf;
#ifndef G4STREAM_STREAMBUF_IMPLEMENTATION
class G4strstreambuf : public strstreambuf {
public:
G4strstreambuf() {
destination = NULL;
}
void SetDestination(G4coutDestination * value) {
destination = value;
}
int sync() {
G4String stringToSend;
int c;
int result;
result = EOF;
while (( c= sbumpc() ) != EOF) {
stringToSend += (char) c;
}
if(this == & G4coutbuf && destination != NULL) {
result = destination->ReceiveG4cout(stringToSend);
} else
if(this == & G4cerrbuf && destination != NULL) {
result = destination->ReceiveG4cerr(stringToSend);
} else
if(this == & G4coutbuf && destination == NULL) {
cout << stringToSend << flush;
result =0;
} else
if(this == & G4cerrbuf && destination == NULL) {
cerr << stringToSend << flush;
result =0;
}
return result;
};
private:
G4coutDestination *destination;
};
//
#else // G4STREAM_STREAMBUF_IMPLEMENTATION :
// On NT the upper implementation involves that
// first character is lost when sending to destination !
// Below implementation is correct on this platform.
class G4strstreambuf : public streambuf {
class G4strstreambuf : public G4std::streambuf {
public:
G4strstreambuf() {
destination = NULL;
count = 0;
size = 127;
size = 4095;
buffer = new char[size+1];
}
~G4strstreambuf() {
@@ -111,10 +75,10 @@ public:
} else if(this == & G4cerrbuf && destination != NULL) {
result = destination->ReceiveG4cerr(stringToSend);
} else if(this == & G4coutbuf && destination == NULL) {
cout << stringToSend << flush;
G4std::cout << stringToSend << G4std::flush;
result =0;
} else if(this == & G4cerrbuf && destination == NULL) {
cerr << stringToSend << flush;
G4std::cerr << stringToSend << G4std::flush;
result =0;
}
return result;
@@ -126,8 +90,6 @@ private:
int count,size;
};
#endif // G4STREAM_STREAMBUF_IMPLEMENTATION :
#endif