ROOT
6.10/09
Reference Guide
proof
pq2
src
redirguard.h
Go to the documentation of this file.
1
// @(#)root/proof:$Id$
2
// Author: G. Ganis, Mar 2010
3
4
/*************************************************************************
5
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#ifndef PQ2_redirguard
13
#define PQ2_redirguard
14
15
//////////////////////////////////////////////////////////////////////////
16
// //
17
// redirguard //
18
// //
19
// Auxilliary class used in PQ2 functions to redirect the logs //
20
// //
21
//////////////////////////////////////////////////////////////////////////
22
23
#include "
TSystem.h
"
24
25
class
redirguard
{
26
private
:
27
RedirectHandle_t
fRH
;
28
Bool_t
fDoIt
;
29
public
:
30
redirguard
(
const
char
*fn,
const
char
*mode =
"a"
,
Int_t
doit = 0)
31
{ fDoIt = (doit == 0) ?
kTRUE
:
kFALSE
;
32
if
(fDoIt)
gSystem
->
RedirectOutput
(fn, mode, &fRH); }
33
~redirguard
() {
if
(fDoIt)
gSystem
->
RedirectOutput
(0, 0, &fRH); }
34
};
35
#endif
redirguard::redirguard
redirguard(const char *fn, const char *mode="a", Int_t doit=0)
Definition:
redirguard.h:30
redirguard::fDoIt
Bool_t fDoIt
Definition:
redirguard.h:28
Int_t
int Int_t
Definition:
RtypesCore.h:41
Bool_t
bool Bool_t
Definition:
RtypesCore.h:59
TSystem.h
gSystem
R__EXTERN TSystem * gSystem
Definition:
TSystem.h:539
kFALSE
const Bool_t kFALSE
Definition:
RtypesCore.h:92
TSystem::RedirectOutput
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=0)
Redirect standard output (stdout, stderr) to the specified file.
Definition:
TSystem.cxx:1684
RedirectHandle_t
Definition:
TSystem.h:204
redirguard::~redirguard
~redirguard()
Definition:
redirguard.h:33
redirguard
Definition:
redirguard.h:25
redirguard::fRH
RedirectHandle_t fRH
Definition:
redirguard.h:27
kTRUE
const Bool_t kTRUE
Definition:
RtypesCore.h:91