Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
prstream.h File Reference
#include <iostream>

Go to the source code of this file.

Classes

class  indentation
 

Macros

#define USE_DEFAULT_STREAMS
 
#define mcout   std::cout /* change to ordinary default C++ stream */
 
#define mcerr   std::cerr
 
#define eeee   '\n';
 
#define scout(a)   #a << " = " << a
 
#define Ifile   file << indn
 
#define Imcout   mcout << indn
 
#define Iprint(file, name)    file << indn << #name << "=" << noindent << name << yesindent;
 
#define Iprintf(file, name)
 
#define Iprintn(file, name)    file << indn << #name << "=" << noindent << name << '\n' << yesindent;
 
#define Iprintnf(file, name)
 
#define Iprintan(file, name, addition)
 
#define Iprintanf(file, name, addition)
 
#define Iprint2(file, name1, name2)
 
#define Iprint2n(file, name1, name2)
 
#define Iprint2nf(file, name1, name2)
 
#define Iprint3(file, name1, name2, name3)
 
#define Iprint3n(file, name1, name2, name3)
 
#define Iprint3nf(file, name1, name2, name3)
 
#define Iprint4n(file, name1, name2, name3, name4)
 
#define Iprint4nf(file, name1, name2, name3, name4)
 
#define Iprint5n(file, name1, name2, name3, name4, name5)
 
#define Iprint_l(file, name, l)
 
#define Iprint_al(file, name, l)
 
#define Iprint_p(file, name)
 
#define Iprint_ap(file, name)
 

Functions

std::ostream & operator<< (std::ostream &file, indentation &ind)
 
std::ostream & noindent (std::ostream &f)
 
std::ostream & yesindent (std::ostream &f)
 

Variables

indentation indn
 
int s_short_output
 

Macro Definition Documentation

◆ eeee

#define eeee   '\n';

Definition at line 182 of file prstream.h.

◆ Ifile

#define Ifile   file << indn

Definition at line 207 of file prstream.h.

◆ Imcout

#define Imcout   mcout << indn

Definition at line 208 of file prstream.h.

◆ Iprint

#define Iprint (   file,
  name 
)     file << indn << #name << "=" << noindent << name << yesindent;

Definition at line 209 of file prstream.h.

◆ Iprint2

#define Iprint2 (   file,
  name1,
  name2 
)
Value:
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
<< noindent << name2 << yesindent;
indentation indn
Definition: prstream.cpp:13
std::ostream & yesindent(std::ostream &f)
Definition: prstream.cpp:19
std::ostream & noindent(std::ostream &f)
Definition: prstream.cpp:15

Definition at line 233 of file prstream.h.

◆ Iprint2n

#define Iprint2n (   file,
  name1,
  name2 
)
Value:
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
<< noindent << name2 << '\n' << yesindent;

Definition at line 236 of file prstream.h.

◆ Iprint2nf

#define Iprint2nf (   file,
  name1,
  name2 
)
Value:
{ \
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 \
<< "=" << noindent << name2 << '\n' << yesindent; \
file.flush(); \
}

Definition at line 239 of file prstream.h.

◆ Iprint3

#define Iprint3 (   file,
  name1,
  name2,
  name3 
)
Value:
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
<< noindent << name2 << ", " << #name3 << "=" << noindent << name3 \

Definition at line 245 of file prstream.h.

◆ Iprint3n

#define Iprint3n (   file,
  name1,
  name2,
  name3 
)
Value:
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
<< noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
<< '\n' << yesindent;

Definition at line 249 of file prstream.h.

◆ Iprint3nf

#define Iprint3nf (   file,
  name1,
  name2,
  name3 
)
Value:
{ \
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 \
<< "=" << noindent << name2 << ", " << #name3 << "=" << noindent \
<< name3 << '\n' << yesindent; \
file.flush(); \
}

Definition at line 253 of file prstream.h.

◆ Iprint4n

#define Iprint4n (   file,
  name1,
  name2,
  name3,
  name4 
)
Value:
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
<< noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
<< ", " << #name4 << "=" << noindent << name4 << '\n' << yesindent;

Definition at line 260 of file prstream.h.

◆ Iprint4nf

#define Iprint4nf (   file,
  name1,
  name2,
  name3,
  name4 
)
Value:
{ \
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 \
<< "=" << noindent << name2 << ", " << #name3 << "=" << noindent \
<< name3 << ", " << #name4 << "=" << noindent << name4 << '\n' \
<< yesindent; \
file.flush(); \
}

Definition at line 264 of file prstream.h.

◆ Iprint5n

#define Iprint5n (   file,
  name1,
  name2,
  name3,
  name4,
  name5 
)
Value:
file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
<< noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
<< ", " << #name4 << "=" << noindent << name4 << ", " << #name5 << "=" \
<< noindent << name5 << '\n' << yesindent;

Definition at line 272 of file prstream.h.

◆ Iprint_al

#define Iprint_al (   file,
  name,
 
)
Value:
{ \
file << indn << #name << "=" << noindent; \
name->print(file, l); \
file << yesindent; \
}

Definition at line 284 of file prstream.h.

◆ Iprint_ap

#define Iprint_ap (   file,
  name 
)
Value:
{ \
file << indn << #name << "=" << noindent; \
name->print(file); \
file << yesindent; \
}

Definition at line 297 of file prstream.h.

◆ Iprint_l

#define Iprint_l (   file,
  name,
 
)
Value:
{ \
file << indn << #name << "=" << noindent; \
name.print(file, l); \
file << yesindent; \
}

Definition at line 278 of file prstream.h.

◆ Iprint_p

#define Iprint_p (   file,
  name 
)
Value:
{ \
file << indn << #name << "=" << noindent; \
name.print(file); \
file << yesindent; \
}

Definition at line 291 of file prstream.h.

◆ Iprintan

#define Iprintan (   file,
  name,
  addition 
)
Value:
file << indn << #name << "=" << noindent << name << ' ' << addition << '\n' \

Definition at line 223 of file prstream.h.

◆ Iprintanf

#define Iprintanf (   file,
  name,
  addition 
)
Value:
{ \
file << indn << #name << "=" << noindent << name << ' ' << addition \
<< '\n' << yesindent; \
file.flush(); \
}

Definition at line 227 of file prstream.h.

◆ Iprintf

#define Iprintf (   file,
  name 
)
Value:
{ \
file << indn << #name << "=" << noindent << name << yesindent; \
file.flush(); \
}

Definition at line 211 of file prstream.h.

◆ Iprintn

#define Iprintn (   file,
  name 
)     file << indn << #name << "=" << noindent << name << '\n' << yesindent;

Definition at line 216 of file prstream.h.

◆ Iprintnf

#define Iprintnf (   file,
  name 
)
Value:
{ \
file << indn << #name << "=" << noindent << name << '\n' << yesindent; \
file.flush(); \
}

Definition at line 218 of file prstream.h.

◆ mcerr

#define mcerr   std::cerr

Definition at line 135 of file prstream.h.

◆ mcout

#define mcout   std::cout /* change to ordinary default C++ stream */

Definition at line 133 of file prstream.h.

◆ scout

#define scout (   a)    #a << " = " << a

Definition at line 183 of file prstream.h.

◆ USE_DEFAULT_STREAMS

#define USE_DEFAULT_STREAMS

Definition at line 114 of file prstream.h.

Function Documentation

◆ noindent()

std::ostream & noindent ( std::ostream &  f)

◆ operator<<()

std::ostream & operator<< ( std::ostream &  file,
indentation ind 
)
inline

Definition at line 194 of file prstream.h.

194 {
195 int n;
196 if (ind.s_not == 1)
197 ind.s_not = 0;
198 else
199 for (n = 0; n < ind.n; n++)
200 file << ' ';
201 return file;
202}

◆ yesindent()

std::ostream & yesindent ( std::ostream &  f)

Variable Documentation

◆ indn

indentation indn
extern

◆ s_short_output

int s_short_output
extern

Definition at line 23 of file prstream.cpp.

Referenced by operator<<(), and operator>>().