51 : ref_defaultOut(nullptr), ref_masterOut(nullptr),
52 masterDestinationFlag(true),masterDestinationFmtFlag(true),
53 id(threadId), useBuffer(false), ignoreCout(false), ignoreInit(true),
71 std::ostringstream str;
91 output->AddCoutTransformer(
f);
92 output->AddCerrTransformer(
f);
93 push_back( std::move(output) );
94 if ( addmasterDestination )
113 if ( formatAlsoMaster )
117 std::ostringstream str;
124 forwarder->AddCoutTransformer(
f);
125 forwarder->AddCerrTransformer(
f);
127 push_back( std::move(forwarder ) );
149 std::ios_base::openmode mode = (ifAppend ? std::ios_base::app
150 : std::ios_base::trunc);
155 output->AddCerrTransformer( [](
G4String&) {
return false;} );
156 push_back(std::move(output));
158 if ( suppressDefault )
171 std::ios_base::openmode mode = (ifAppend ? std::ios_base::app
172 : std::ios_base::trunc);
174 output->AddCoutTransformer( [](
G4String&) {
return false;} );
175 push_back(std::move(output));
176 if ( suppressDefault )
189 if ( fileN !=
"**Screen**" )
211 const size_t infiniteSize = 0;
214 else { assert(
false); }
231 if ( fileN !=
"**Screen**")
257 std::ostringstream msg;
258 msg <<
"=======================\n";
259 msg <<
"cout buffer(s) for worker with ID:" <<
id << std::endl;
262 std::for_each( begin() , end(),
265 if ( cout !=
nullptr ) {
274 msg <<
"=======================\n";
275 msg <<
"cerr buffer(s) for worker with ID:" <<
id
276 <<
" (goes to std error)" << std::endl;
278 std::for_each( begin() , end(),
281 if ( cout !=
nullptr ) {
void AddMasterOutput(G4bool formatAlsoMaster)
void AddCoutFileName(const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
std::unique_ptr< G4coutDestination > G4coutDestinationUPtr
G4bool masterDestinationFlag
G4bool masterDestinationFmtFlag
virtual G4int FlushG4cerr()
G4StateManager * stateMgr
void SetDefaultOutput(G4bool addMasterDestination=true, G4bool formatAlsoMaster=true)
void AddCerrFileName(const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
#define G4MUTEX_INITIALIZER
void SetCerrFileName(const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
void EnableBuffering(G4bool flag=true)
void HandleFileCout(G4String fileN, G4bool appendFlag, G4bool suppressDefault)
void SetDestination(G4coutDestination *dest)
void AddCoutTransformer(const Transformer &t)
void SetIgnoreCout(G4int tid=0)
G4MTcoutDestination(const G4int &threadId)
void HandleFileCerr(G4String fileN, G4bool appendFlag, G4bool suppressDefault)
virtual ~G4MTcoutDestination()
G4ApplicationState GetCurrentState() const
virtual G4int FlushG4cout()
void AddCerrTransformer(const Transformer &t)
G4coutDestination * ref_masterOut
virtual G4int ReceiveG4cout(const G4String &msg)
void SetCoutFileName(const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
G4coutDestination * ref_defaultOut
static G4StateManager * GetStateManager()