114#define USE_DEFAULT_STREAMS
130#ifdef USE_DEFAULT_STREAMS
133#define mcout std::cout
135#define mcerr std::cerr
140#define OPEN_LOGFILE_EXPLICITLY
149 static std::ofstream& get_ofstream(
void) {
150 static std::ofstream prstream_output_file;
151 return prstream_output_file;
154 HelperForMcout(
void) {
155#ifndef OPEN_LOGFILE_EXPLICITLY
157 get_ofstream().open(
"prstream_log.out");
163 ~HelperForMcout(
void) {
165 get_ofstream().flush();
166 get_ofstream().close();
172HelperForMcout __helper_for_mcout;
177#define mcout HelperForMcout::get_ofstream()
178#define mcerr HelperForMcout::get_ofstream()
183#define scout(a) #a << " = " << a
199 for (n = 0; n < ind.
n; n++)
204std::ostream&
noindent(std::ostream& f);
207#define Ifile file << indn
208#define Imcout mcout << indn
209#define Iprint(file, name) \
210 file << indn << #name << "=" << noindent << name << yesindent;
211#define Iprintf(file, name) \
213 file << indn << #name << "=" << noindent << name << yesindent; \
216#define Iprintn(file, name) \
217 file << indn << #name << "=" << noindent << name << '\n' << yesindent;
218#define Iprintnf(file, name) \
220 file << indn << #name << "=" << noindent << name << '\n' << yesindent; \
223#define Iprintan(file, name, addition) \
224 file << indn << #name << "=" << noindent << name << ' ' << addition << '\n' \
227#define Iprintanf(file, name, addition) \
229 file << indn << #name << "=" << noindent << name << ' ' << addition \
230 << '\n' << yesindent; \
233#define Iprint2(file, name1, name2) \
234 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
235 << noindent << name2 << yesindent;
236#define Iprint2n(file, name1, name2) \
237 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
238 << noindent << name2 << '\n' << yesindent;
239#define Iprint2nf(file, name1, name2) \
241 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 \
242 << "=" << noindent << name2 << '\n' << yesindent; \
245#define Iprint3(file, name1, name2, name3) \
246 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
247 << noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
249#define Iprint3n(file, name1, name2, name3) \
250 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
251 << noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
252 << '\n' << yesindent;
253#define Iprint3nf(file, name1, name2, name3) \
255 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 \
256 << "=" << noindent << name2 << ", " << #name3 << "=" << noindent \
257 << name3 << '\n' << yesindent; \
260#define Iprint4n(file, name1, name2, name3, name4) \
261 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
262 << noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
263 << ", " << #name4 << "=" << noindent << name4 << '\n' << yesindent;
264#define Iprint4nf(file, name1, name2, name3, name4) \
266 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 \
267 << "=" << noindent << name2 << ", " << #name3 << "=" << noindent \
268 << name3 << ", " << #name4 << "=" << noindent << name4 << '\n' \
272#define Iprint5n(file, name1, name2, name3, name4, name5) \
273 file << indn << #name1 << "=" << noindent << name1 << ", " << #name2 << "=" \
274 << noindent << name2 << ", " << #name3 << "=" << noindent << name3 \
275 << ", " << #name4 << "=" << noindent << name4 << ", " << #name5 << "=" \
276 << noindent << name5 << '\n' << yesindent;
278#define Iprint_l(file, name, l) \
280 file << indn << #name << "=" << noindent; \
281 name.print(file, l); \
284#define Iprint_al(file, name, l) \
286 file << indn << #name << "=" << noindent; \
287 name->print(file, l); \
291#define Iprint_p(file, name) \
293 file << indn << #name << "=" << noindent; \
297#define Iprint_ap(file, name) \
299 file << indn << #name << "=" << noindent; \
std::ostream & operator<<(std::ostream &file, indentation &ind)
std::ostream & yesindent(std::ostream &f)
std::ostream & noindent(std::ostream &f)