34 #ifndef ALARMSERVERCONNECTOR_H
35 #define ALARMSERVERCONNECTOR_H
44 #include <boost/thread.hpp>
49 #if ( __WORDSIZE < 64 ) || ( LONG_MAX < 9223372036854775807L )
50 #warning Using this application on non-64bit architecture may cause it suffer from the year-2038-bug on 19 Jan 2038 03:14:07 UTC. Linux on 64bit is not affected as time_t is a long int and long int is 64bit wide there.
66 #if ( OLDGCC46COMPAT == 0 )
78 static const time_t
noAlarmActive = std::numeric_limits<long int>::min();
80 static const time_t noAlarmActive = LONG_MIN;
293 #endif // ALARMSERVERCONNECTOR_H
CMSClient _cmsclient
ActiveMQ client instance.
void sendDesktopNotification(const std::vector< AlarmStatusEntry > alarm)
Fire desktop notification.
const bool _desktopVersion
Desktop version flag.
boost::mutex _flashlightmutex
Mutex to protect the flashlight accessed.
void switchFlashLightOn()
Switch laboratory flashlight on.
static const time_t noAlarmActive
Time of last alarm if no alarm is active.
void prepareEMailNotification()
Select alarms to be included in an e-mail notification.
boost::mutex _statusmapmutex
Mutex to protect the _statusmap.
void prepareDesktopNotification()
Select alarms to be included in a desktop notification.
Compatibility macros for older versions of the GCC.
void notifyStatusChange(const AlarmStatusEntry status)
Notify AlarmServerConnector about alarm status change.
bool _flashlighton
Flashlight status flag.
bool checkSeverityString(const std::string &severity)
Check severity string in CSS Alarm Server message.
void switchFlashLightOff()
Switch laboratory flashlight off.
C++ Messaging Service client.
void startWatcher()
Start the watcher thread.
Alarm entry for the AlarmServerConnector.
boost::thread _watcher
Notification thread.
Entry in the AlarmServerConnector statusmap.
void sendEMailNotification(const std::vector< AlarmStatusEntry > alarm)
Fire desktop notification.
Interface to the CMS (C++ Messaging Service) library of Apache ActiveMQ.
const bool _activateBeedo
Beedo flag.
~AlarmServerConnector()
Destructor.
Namespace for Alarm Notifications application.
AlarmServerConnector & operator=(const AlarmServerConnector &other)=delete
Copy assignment (deleted)
size_t getNumberOfAlarms() const noexcept
Query number of active alarms.
#define noexcept
Allow using the noexcept keyword with GCC < 4.6.
AlarmServerConnector(const bool desktopVersion=false, const bool activateBeedo=false)
Constructor.
std::map< std::string, AlarmStatusEntry > _statusmap
Map of active alarms.
bool _runwatcher
Watcher thread abortion flag.
void operateFlashLight()
Operate the red flashlight in the laboratory.
Connect to a CSS Alarm Server.
time_t _oldestAlarm
Timestamp of oldest alarm in _statusmap.
boost::thread _flashlightthread
Flashlight operation thread.
void checkStatusMap()
Check the _statusmap for pending notifications.