QDianaProcessStatus.hh

Go to the documentation of this file.
00001 /*
00002  * APOLLO: A complete DAQ and Online Data Analysis Framework for Cuore 
00003  * M.P. created 26/5/4
00004  * 
00005  * Class QDianaProcessStatus: class that describes the status of diana process
00006  *
00007  */
00008 
00022 #ifndef __QDIANA_PROCESS_STATUS_HH_
00023 #define __QDIANA_PROCESS_STATUS_HH_
00024 
00025 #include <string>
00026 
00027 #include "QCuore.hh"
00028 #include "QNamed.hh"
00029 #include "QId.hh"
00030 
00031 class QDianaProcessStatus : public QNamed, QId {
00032 public:
00034   enum ProcessStatus_t {QRunning_s, 
00035                         QError_s,   
00036                         QExiting_s  
00037   };
00038 
00040   static QDianaProcessStatus& GetInstance();
00041 
00042   virtual ~QDianaProcessStatus() {}
00043 
00045   volatile inline ProcessStatus_t GetState() const { return state; }
00046 
00047   // checks
00048   volatile bool isRunning() const { return (state == QRunning_s);}
00049   volatile bool isError() const {return (state == QError_s);}
00050   volatile bool isExiting() const {return (state == QExiting_s);}
00051 
00053   const std::string& GetError() const {return fError;}  
00054 
00055 private:
00056 
00057   QDianaProcessStatus(); 
00058   mutable ProcessStatus_t state;
00059   std::string fError;
00060 
00065   inline void SetState(const ProcessStatus_t s) { state=s; }
00066 
00071   void SetError(const std::string& s) {fError=s;}
00072   
00073   friend void ProcessControlSignalHandler(int);
00074 };
00075 
00076   void ProcessControlSignalHandler( int SignalId );  
00077 
00078 
00079 
00080 #endif

Generated on Tue Nov 16 10:49:56 2010 for CUORE Software by  doxygen 1.5.6