$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_Utilities_SystemMessenger_h 00002 #define _ots_Utilities_SystemMessenger_h 00003 00004 #include "otsdaq-core/Macros/CoutMacros.h" 00005 #include "otsdaq-core/MessageFacility/MessageFacility.h" 00006 00007 #include <iostream> 00008 #include <string> 00009 #include <vector> 00010 00011 namespace ots 00012 { 00013 class SystemMessenger 00014 { 00015 public: 00016 SystemMessenger() : sysMsgLock_(false){}; // constructor 00017 00018 void addSystemMessage(std::string targetUser, std::string msg); 00019 std::string getSystemMessage(std::string targetUser); 00020 00021 private: 00022 // Members for system messages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00023 // Set of vectors to delivers system messages to active users of the Web Gui 00024 // When a message is generated, sysMsgLock is set, 00025 // message is added the vector set sysMsgDelivered_[i] = false, 00026 // and sysMsgLock is unset. 00027 // When a message is delivered sysMsgDelivered_[i] = true, 00028 // During sysMsgCleanup(), sysMsgLock is set, delivered messages are removed, 00029 // and sysMsgLock is unset. 00030 std::vector<std::string> sysMsgTargetUser_; 00031 std::vector<std::string> sysMsgMessage_; 00032 std::vector<time_t> sysMsgTime_; 00033 std::vector<bool> sysMsgDelivered_; 00034 void sysMsgSetLock(bool set); 00035 void sysMsgCleanup(); 00036 00037 volatile bool sysMsgLock_; 00038 00039 enum 00040 { 00041 SYS_CLEANUP_WILDCARD_TIME = 30, // 30 seconds 00042 }; 00043 }; 00044 00045 } // namespace ots 00046 00047 #endif