00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __CALARMSERVER_H
00023 #define __CALARMSERVER_H
00024
00025
00026
00027
00028
00029 #ifndef __CSOCKET_H
00030 #include <CSocket.h>
00031 #endif
00032
00033 #ifndef __STL_STRING
00034 #define __STL_STRING
00035 #include <string>
00036 #endif
00037
00038 #ifndef __STL_MAP
00039 #define __STL_MAP
00040 #include <map>
00041 #endif
00042
00043 #ifndef __SPECTRODAQ_H
00044 #include <spectrodaq.h>
00045 #endif
00046
00047 #ifndef __SPECTROFRAMEWORK_H
00048 #include <SpectroFramework.h>
00049 #endif
00050
00051 #ifndef __GDBM_H
00052 #include <gdbm.h>
00053 #endif
00054
00055 #ifndef __GDBMEXCEPTION_H
00056 #include <CGDBMException.h>
00057 #endif
00058
00059 #ifndef __CALARMSERVEREXCEPTION_H
00060 #include <CAlarmServerException.h>
00061 #endif
00062
00063 using namespace std;
00064
00065 class CAlarmServer
00066 {
00067 string m_sPort;
00068 string m_sExpId;
00069 string m_sAlarmId;
00070
00071 public:
00072 enum ClientReason {
00073 LOG,
00074 ACKNOWLEDGE,
00075 DISMISS,
00076 UPDATE,
00077 INIT,
00078 CREATE,
00079 HISTORY
00080 };
00081
00082 public:
00083
00084 CAlarmServer();
00085
00086
00087 CAlarmServer(const CAlarmServer& aCAlarmServer);
00088
00089
00090 ~CAlarmServer() { }
00091
00092
00093 private:
00094
00095 CAlarmServer operator=(const CAlarmServer& aCAlarmServer);
00096
00097 int operator== (const CAlarmServer& aCAlarmServer);
00098
00099
00100 public:
00101 string getExpId() { return m_sExpId; }
00102 string getAlarmId() { return m_sAlarmId; }
00103
00104
00105 protected:
00106 void setExpId(const string& aExpId) { m_sExpId = aExpId; }
00107 void setAlarmId(const string& aAlarmId) { m_sAlarmId = aAlarmId; }
00108
00109
00110 public:
00111 bool operator()();
00112
00113
00114 protected:
00115 void Log(string& sFacility, string& sMessage, string& sDate);
00116 void EditAlarm(Int_t nReason);
00117 void Init(CSocket* newSock, CSocket* sock);
00118 void CreateExperiment();
00119 string GetExperimentHistory();
00120 };
00121
00122 #endif