Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
FunNameStack.cpp File Reference
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include "wcpplib/util/FunNameStack.h"
#include "wcpplib/util/emul_new_stand.h"
#include "util/FunNameStack.ic"

Go to the source code of this file.

Functions

void spexit_action (std::ostream &file)
 
std::ostream & operator<< (std::ostream &file, const FunNameStack &f)
 
std::ostream & operator<< (std::ostream &file, const FunNameWatch &f)
 

Variables

int s_throw_exception_in_spexit = 0
 
int s_exit_without_core = 0
 

Function Documentation

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream &  file,
const FunNameStack f 
)

Definition at line 476 of file FunNameStack.cpp.

476 {
477 if (f.s_act == 1) {
478#ifdef USE_BOOST_MULTITHREADING
479 file << "FunNameStack: s_init=" << f.s_init << '\n';
480 long nret, qret;
481 NameStack* ns = f.get_thread_stack_q(nret, qret);
482 file << " id=" << ns->id << " qname=" << ns->qname << '\n';
483 file << "At the time of scanning there were " << qret << " threads \n"
484 << "registered in FunNameStack system.\n";
485 file << "The current one appeared nth: " << nret << '\n';
486 int n;
487 for (n = 0; n < ns->qname; n++) {
488 //file << " n =" << std::setw(3) << n << " " << f.name[n] << '\n';
489 file << std::setw(3) << n << " " << ns->name[n] << " \n";
490 }
491#else
492 file << "FunNameStack: s_init=" << f.s_init << " qname=" << f.qname << '\n';
493 int n;
494 for (n = 0; n < f.qname; n++) {
495 //file << " n =" << std::setw(3) << n << " " << f.name[n] << '\n';
496 file << std::setw(3) << n << " " << f.name[n] << " \n";
497 }
498#endif
499 }
500 return file;
501}

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  file,
const FunNameWatch f 
)

Definition at line 503 of file FunNameStack.cpp.

503 {
504 f.hdr(file);
505 return file;
506}
std::ostream & hdr(std::ostream &file) const
Definition: FunNameStack.h:718

◆ spexit_action()

void spexit_action ( std::ostream &  file)

Definition at line 314 of file FunNameStack.cpp.

314 {
315 file << "spexit_action: the streams will be now flushed\n";
316 file.flush();
317 mcout.flush();
318 mcerr.flush();
320 if (s_exit_without_core == 1) {
321 file << "spexit_action: the exit(1) function is called\n";
322 exit(1);
323 } else {
324 file << "spexit_action: the abort function is called\n";
325 abort();
326 }
327 } else {
328 file << "spexit_action: an exception is now called\n";
329 throw ExcFromSpexit();
330 }
331}
int s_exit_without_core
int s_throw_exception_in_spexit
#define mcout
Definition: prstream.h:133
#define mcerr
Definition: prstream.h:135

Variable Documentation

◆ s_exit_without_core

int s_exit_without_core = 0

Definition at line 64 of file FunNameStack.cpp.

Referenced by spexit_action().

◆ s_throw_exception_in_spexit

int s_throw_exception_in_spexit = 0

Definition at line 63 of file FunNameStack.cpp.

Referenced by spexit_action().