00001 #ifndef HiggsAnalysis_CombinedLimit_CloseCoutSentry_ 00002 #define HiggsAnalysis_CombinedLimit_CloseCoutSentry_ 00003 00005 #include <cstdio> 00006 00007 class CloseCoutSentry { 00008 public: 00009 CloseCoutSentry(bool silent = true) ; 00010 ~CloseCoutSentry(); 00011 // clear, if I was the one closing it 00012 void clear() ; 00013 // break through any sentry, even the ones above myself (for critical error messages, or debug) 00014 static void breakFree() ; 00015 FILE *trueStdOut(); 00016 private: 00017 bool silent_; 00018 static int fdOut_, fdErr_; 00019 static bool open_; 00020 // always clear, even if I was not the one closing it 00021 void static reallyClear() ; 00022 static FILE *trueStdOut_; 00023 bool stdOutIsMine_; 00024 }; 00025 00026 #endif