00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef XRDMONBUFFEREDOUTPUT_HH
00014 #define XRDMONBUFFEREDOUTPUT_HH
00015
00016 #include "XrdSys/XrdSysPthread.hh"
00017 #include <string>
00018 using std::string;
00019
00020 class XrdMonBufferedOutput {
00021 public:
00022 XrdMonBufferedOutput(const char* outFileName,
00023 const char* lockFileName,
00024 int bufSize);
00025 ~XrdMonBufferedOutput();
00026
00027 void add(const char* s);
00028 void flush(bool lockMutex=true);
00029
00030 private:
00031 char* _fName;
00032 char* _fNameLock;
00033
00034 char* _buf;
00035 const int _bufSize;
00036
00037 XrdSysMutex _mutex;
00038 };
00039
00040 #endif