Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -23,11 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// --------------------------------------------------------------------
// GEANT 4 class header file
// G4BuffercoutDestination
//
// Class Description:
//
@@ -37,10 +33,10 @@
// ---------------- G4BuffercoutDestination ----------------
//
// Author: A.Dotti (SLAC), April 2017
// Author: A.Dotti (SLAC), 14 April 2017
// --------------------------------------------------------------------
#ifndef G4BUFFERCOUTDESTINATION_HH_
#define G4BUFFERCOUTDESTINATION_HH_
#ifndef G4BUFFERCOUTDESTINATION_HH
#define G4BUFFERCOUTDESTINATION_HH
#include <sstream>
@@ -48,38 +44,36 @@
class G4BuffercoutDestination : public G4coutDestination
{
public:
public:
explicit G4BuffercoutDestination(std::size_t maxSize = 0);
virtual ~G4BuffercoutDestination();
explicit G4BuffercoutDestination(size_t maxSize = 0);
virtual ~G4BuffercoutDestination();
virtual G4int ReceiveG4cout(const G4String& msg) override;
virtual G4int ReceiveG4cerr(const G4String& msg) override;
// Flush buffer to std output
virtual G4int FlushG4cout();
// Flush buffer to std error
virtual G4int FlushG4cerr();
// Flsuh both buffers
virtual G4int ReceiveG4cout(const G4String& msg) override;
virtual G4int ReceiveG4cerr(const G4String& msg) override;
// Flush buffer to std output
virtual G4int FlushG4cout();
// Flush buffer to std error
virtual G4int FlushG4cerr();
// Flsuh both buffers
virtual void Finalize();
virtual void Finalize();
// Set maximum size of buffer, when buffer grows to specified size,
// it will trigger flush. Dimension in char
void SetMaxSize(std::size_t max) { m_maxSize = max; }
std::size_t GetMaxSize() const { return m_maxSize; }
std::size_t GetCurrentSizeOut() const { return m_currentSize_out; }
std::size_t GetCurrentSizeErr() const { return m_currentSize_err; }
// Set maximum size of buffer, when buffer grows to specified size,
// it will trigger flush. Dimension in char
void SetMaxSize(size_t max) { m_maxSize = max; }
size_t GetMaxSize() const { return m_maxSize; }
size_t GetCurrentSizeOut() const { return m_currentSize_out; }
size_t GetCurrentSizeErr() const { return m_currentSize_err; }
protected:
void ResetCout();
void ResetCerr();
protected:
void ResetCout();
void ResetCerr();
std::ostringstream m_buffer_out;
std::ostringstream m_buffer_err;
size_t m_currentSize_out;
size_t m_currentSize_err;
size_t m_maxSize;
std::ostringstream m_buffer_out;
std::ostringstream m_buffer_err;
std::size_t m_currentSize_out = 0;
std::size_t m_currentSize_err = 0;
std::size_t m_maxSize = 0;
};
#endif /* G4BUFFERCOUTDESTINATION_HH_ */
#endif