AlarmNotifications
PANDA Slow Control Alarm Daemon
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
alarmstatusentry.h
Go to the documentation of this file.
1 
34 #ifndef ALARMSTATUSENTRY_H
35 #define ALARMSTATUSENTRY_H
36 
37 #include "oldgcccompat.h" // Compatibilty macros for GCC < 4.7
38 
39 #include <ctime>
40 #include <ostream>
41 #include <string>
42 
43 namespace AlarmNotifications
44 {
45 
52 {
53 private:
59  std::string _pvname;
65  std::string _severity;
71  std::string _status;
77  time_t _triggertime;
90 
91 public:
100  AlarmStatusEntry ( const std::string& pvname, const std::string& severity, const std::string& status ) noexcept;
114  bool operator== ( const AlarmStatusEntry& other ) noexcept;
121  AlarmStatusEntry ( const AlarmStatusEntry& other ) noexcept;
128  AlarmStatusEntry ( AlarmStatusEntry&& other ) noexcept;
136  AlarmStatusEntry& operator= ( const AlarmStatusEntry& other ) noexcept;
144  AlarmStatusEntry& operator= ( AlarmStatusEntry&& other ) noexcept;
151  const std::string& getPVName() const noexcept;
158  const std::string& getSeverity() const noexcept;
166  void setSeverity ( const std::string& severity ) noexcept;
173  const std::string& getStatus() const noexcept;
181  void setStatus ( const std::string& status ) noexcept;
188  time_t getTriggerTime() const noexcept;
196  void setTriggerTime ( const time_t triggertime ) noexcept;
204  void update ( const AlarmStatusEntry& newdata ) noexcept;
211  bool getDesktopNotificationSent() const noexcept;
219  void setDesktopNotificationSent ( const bool desktopNotificationSent ) noexcept;
226  bool getEmailNotificationSent() const noexcept;
234  void setEmailNotificationSent ( const bool emailNotificationSent ) noexcept;
235 };
236 
245 std::ostream& operator<< ( std::ostream& os, const AlarmNotifications::AlarmStatusEntry& ase );
246 
247 }
248 
249 #endif // ALARMSTATUSENTRY_H
const std::string & getPVName() const noexcept
Query PV name.
#define final
Allow using the final keyword with GCC < 4.7.
Definition: oldgcccompat.h:72
Compatibility macros for older versions of the GCC.
std::string _status
The alarm status of the PV.
~AlarmStatusEntry() noexcept
Destructor.
STL namespace.
void setSeverity(const std::string &severity) noexcept
Change the severity.
void setDesktopNotificationSent(const bool desktopNotificationSent) noexcept
Change desktop notification flag.
std::string _severity
The severity of the alarm.
Entry in the AlarmServerConnector statusmap.
time_t _triggertime
Time the alarm message was received.
bool getEmailNotificationSent() const noexcept
Query e-mail notification flag.
bool _emailNotificationSent
Flag for sent e-mail notification.
Namespace for Alarm Notifications application.
void setStatus(const std::string &status) noexcept
Change the status.
#define noexcept
Allow using the noexcept keyword with GCC < 4.6.
Definition: oldgcccompat.h:52
std::string _pvname
Name of the PV.
time_t getTriggerTime() const noexcept
Query the trigger time.
const std::string & getSeverity() const noexcept
Query the severity.
void setTriggerTime(const time_t triggertime) noexcept
Change the trigger time_t.
AlarmStatusEntry(const std::string &pvname, const std::string &severity, const std::string &status) noexcept
Constructor.
void setEmailNotificationSent(const bool emailNotificationSent) noexcept
Change e-mail notification flag.
bool getDesktopNotificationSent() const noexcept
Query desktop notification flag.
bool _desktopNotificationSent
Flag for sent desktop notification.
void update(const AlarmStatusEntry &newdata) noexcept
Update severity and status data.
const std::string & getStatus() const noexcept
Query the status.