00001 #ifndef _ots_Utilities_SystemMessenger_h
00002 #define _ots_Utilities_SystemMessenger_h
00003
00004 #include "otsdaq-core/MessageFacility/MessageFacility.h"
00005 #include "otsdaq-core/Macros/CoutMacros.h"
00006
00007 #include <string>
00008 #include <vector>
00009 #include <iostream>
00010
00011 namespace ots
00012 {
00013
00014 class SystemMessenger
00015 {
00016 public:
00017
00018 SystemMessenger() : sysMsgLock_(false) {};
00019
00020 void addSystemMessage(std::string targetUser, std::string msg);
00021 std::string getSystemMessage(std::string targetUser);
00022
00023 private:
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 std::vector<std::string> sysMsgTargetUser_;
00034 std::vector<std::string> sysMsgMessage_;
00035 std::vector<time_t> sysMsgTime_;
00036 std::vector<bool> sysMsgDelivered_;
00037 void sysMsgSetLock(bool set);
00038 void sysMsgCleanup();
00039
00040 volatile bool sysMsgLock_;
00041
00042 enum {
00043 SYS_CLEANUP_WILDCARD_TIME = 30,
00044 };
00045 };
00046
00047
00048 }
00049
00050 #endif