TStatus.h

Go to the documentation of this file.
00001 // @(#)root/proofplayer:$Id: TStatus.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Maarten Ballintijn   12/03/2004
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TStatus
00013 #define ROOT_TStatus
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // TStatus                                                              //
00018 //                                                                      //
00019 // This class holds the status of a ongoing operation and collects      //
00020 // error messages. It provides a Merge() operation allowing it to       //
00021 // be used in PROOF to monitor status in the slaves.                    //
00022 // No messages indicates success.                                       //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TNamed
00027 #include "TNamed.h"
00028 #endif
00029 
00030 #include <set>
00031 #include <string>
00032 #ifdef R__GLOBALSTL
00033 namespace std { using ::set; using ::string; }
00034 #endif
00035 
00036 
00037 class TCollection;
00038 
00039 class TStatus : public TNamed {
00040 
00041 private:
00042    typedef std::set<std::string>                 MsgSet_t;
00043    typedef std::set<std::string>::const_iterator MsgIter_t;
00044    MsgSet_t    fMsgs;   // list of error messages
00045    MsgIter_t   fIter;   //!iterator in messages
00046 
00047 public:
00048    TStatus();
00049    virtual ~TStatus() { }
00050 
00051    Bool_t         IsOk() const { return fMsgs.empty(); }
00052    void           Add(const char *mesg);
00053    virtual Int_t  Merge(TCollection *list);
00054    virtual void   Print(Option_t *option="") const;
00055    void           Reset();
00056    const char    *NextMesg();
00057 
00058    ClassDef(TStatus,1);  // Status class
00059 };
00060 
00061 #endif

Generated on Tue Jul 5 14:28:13 2011 for ROOT_528-00b_version by  doxygen 1.5.1