AlarmNotifications
PANDA Slow Control Alarm Daemon
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Private Attributes | List of all members
AlarmNotifications::AlarmStatusEntry Class Referencefinal

Entry in the AlarmServerConnector statusmap. More...

#include <alarmstatusentry.h>

Collaboration diagram for AlarmNotifications::AlarmStatusEntry:
Collaboration graph
[legend]

Public Member Functions

 AlarmStatusEntry (const std::string &pvname, const std::string &severity, const std::string &status) noexcept
 Constructor. More...
 
 ~AlarmStatusEntry () noexcept
 Destructor. More...
 
bool operator== (const AlarmStatusEntry &other) noexcept
 Equality operator. More...
 
 AlarmStatusEntry (const AlarmStatusEntry &other) noexcept
 Copy constructor. More...
 
 AlarmStatusEntry (AlarmStatusEntry &&other) noexcept
 Move constructor (C++11) More...
 
AlarmStatusEntryoperator= (const AlarmStatusEntry &other) noexcept
 Copy assignment. More...
 
AlarmStatusEntryoperator= (AlarmStatusEntry &&other) noexcept
 Move assignment (C++11) More...
 
const std::string & getPVName () const noexcept
 Query PV name. More...
 
const std::string & getSeverity () const noexcept
 Query the severity. More...
 
void setSeverity (const std::string &severity) noexcept
 Change the severity. More...
 
const std::string & getStatus () const noexcept
 Query the status. More...
 
void setStatus (const std::string &status) noexcept
 Change the status. More...
 
time_t getTriggerTime () const noexcept
 Query the trigger time. More...
 
void setTriggerTime (const time_t triggertime) noexcept
 Change the trigger time_t. More...
 
void update (const AlarmStatusEntry &newdata) noexcept
 Update severity and status data. More...
 
bool getDesktopNotificationSent () const noexcept
 Query desktop notification flag. More...
 
void setDesktopNotificationSent (const bool desktopNotificationSent) noexcept
 Change desktop notification flag. More...
 
bool getEmailNotificationSent () const noexcept
 Query e-mail notification flag. More...
 
void setEmailNotificationSent (const bool emailNotificationSent) noexcept
 Change e-mail notification flag. More...
 

Private Attributes

std::string _pvname
 Name of the PV. More...
 
std::string _severity
 The severity of the alarm. More...
 
std::string _status
 The alarm status of the PV. More...
 
time_t _triggertime
 Time the alarm message was received. More...
 
bool _desktopNotificationSent
 Flag for sent desktop notification. More...
 
bool _emailNotificationSent
 Flag for sent e-mail notification. More...
 

Detailed Description

Entry in the AlarmServerConnector statusmap.

This class is a container for the information regarding the alarm status of a single PV. The class AlarmServerConnector manages a map of these entries. This class does not operate on or manage this information, it is a pure data container,

Definition at line 51 of file alarmstatusentry.h.

Constructor & Destructor Documentation

AlarmStatusEntry::AlarmStatusEntry ( const std::string &  pvname,
const std::string &  severity,
const std::string &  status 
)
noexcept

Constructor.

Writes the arguments to the internal storage and takes a timestamp. The notification flags are initialized as false.

Parameters
pvnameName of the PV triggering the alarm
severityThe Alarm Server severity string
statusThe Alarm Server status string

Definition at line 38 of file alarmstatusentry.cpp.

AlarmStatusEntry::~AlarmStatusEntry ( )
noexcept

Destructor.

Has nothing to do...

Definition at line 50 of file alarmstatusentry.cpp.

AlarmStatusEntry::AlarmStatusEntry ( const AlarmStatusEntry other)
noexcept

Copy constructor.

Creates a non-destructive copy of another status object.

Parameters
otherAnother instance of AlarmStatusEntry

Definition at line 55 of file alarmstatusentry.cpp.

AlarmStatusEntry::AlarmStatusEntry ( AlarmStatusEntry &&  other)
noexcept

Move constructor (C++11)

Creates a destructive copy of another status object. Accessing the other object afterwards may result in undefined behaviour.

Parameters
otherAnother instance of AlarmStatusEntry

Definition at line 67 of file alarmstatusentry.cpp.

Member Function Documentation

bool AlarmStatusEntry::getDesktopNotificationSent ( ) const
noexcept

Query desktop notification flag.

Flag to show if a desktop notification has already been sent out to avoid double messaging.

Returns
True if desktop notification has already been sent.

Definition at line 156 of file alarmstatusentry.cpp.

bool AlarmStatusEntry::getEmailNotificationSent ( ) const
noexcept

Query e-mail notification flag.

Flag to show if an e-mail notification has already been sent out to avoid double messaging.

Returns
True if e-mail notification has already been sent.

Definition at line 166 of file alarmstatusentry.cpp.

const std::string & AlarmStatusEntry::getPVName ( ) const
noexcept

Query PV name.

The name of the PV that triggerd the alarm.

Returns
Read-only reference to standard string

Definition at line 112 of file alarmstatusentry.cpp.

const std::string & AlarmStatusEntry::getSeverity ( ) const
noexcept

Query the severity.

The severity differs from the severity notation in EPICS because the CSS Alarm Server adds the functionality to acknowledge an alarm, a concept that does not exist in pure EPICS. An acknowledged alarm severity has "_ACK" added to the normal severity description.

Returns
Read-only reference to standard string

Definition at line 117 of file alarmstatusentry.cpp.

const std::string & AlarmStatusEntry::getStatus ( ) const
noexcept

Query the status.

The status of the PV within the CSS Alarm Server. This status can differ from the status within EPICS as the Alarm Server has the ability to latch alarms.

Returns
Read-only reference to standard string

Definition at line 127 of file alarmstatusentry.cpp.

time_t AlarmStatusEntry::getTriggerTime ( ) const
noexcept

Query the trigger time.

The timestamp saved in the constructor. The timestamp is used to calculate if the alarm is due to send out a notification, e.g. via e-mail.

Returns
POSIX time value

Definition at line 137 of file alarmstatusentry.cpp.

AlarmStatusEntry & AlarmStatusEntry::operator= ( const AlarmStatusEntry other)
noexcept

Copy assignment.

Overwrites the data of this instance with data copied from the other instance.

Parameters
otherAnother instance of AlarmStatusEntry
Returns
Reference to this instance

Definition at line 79 of file alarmstatusentry.cpp.

AlarmStatusEntry & AlarmStatusEntry::operator= ( AlarmStatusEntry &&  other)
noexcept

Move assignment (C++11)

Overwrites the data of this instance with data moved from the other object. Accessing the other object afterwards may result in undefined behaviour.

Parameters
otherAnother instance of AlarmStatusEntry
Returns
Reference to this instance

Definition at line 93 of file alarmstatusentry.cpp.

bool AlarmStatusEntry::operator== ( const AlarmStatusEntry other)
noexcept

Equality operator.

Checks if all parameters within two instances are equal,

Parameters
otherAnother instance of AlarmStatusEntry
Returns
Boolean to indicate equality

Definition at line 107 of file alarmstatusentry.cpp.

void AlarmStatusEntry::setDesktopNotificationSent ( const bool  desktopNotificationSent)
noexcept

Change desktop notification flag.

Flag to show if a desktop notification has already been sent out to avoid double messaging.

Parameters
desktopNotificationSentSet to true of notification has been sent
Returns
Nothing

Definition at line 161 of file alarmstatusentry.cpp.

void AlarmStatusEntry::setEmailNotificationSent ( const bool  emailNotificationSent)
noexcept

Change e-mail notification flag.

Flag to show if an e-mail notification has already been sent out to avoid double messaging.

Parameters
emailNotificationSentSet to true of notification has been sent
Returns
Nothing

Definition at line 171 of file alarmstatusentry.cpp.

void AlarmStatusEntry::setSeverity ( const std::string &  severity)
noexcept

Change the severity.

The severity differs from the severity notation in EPICS because the CSS Alarm Server adds the functionality to acknowledge an alarm, a concept that does not exist in pure EPICS. An acknowledged alarm severity has "_ACK" added to the normal severity description.

Parameters
severityThe new severity string
Returns
Nothing

Definition at line 122 of file alarmstatusentry.cpp.

void AlarmStatusEntry::setStatus ( const std::string &  status)
noexcept

Change the status.

The status of the PV within the CSS Alarm Server. This status can differ from the status within EPICS as the Alarm Server has the ability to latch alarms.

Parameters
statusThe new status string
Returns
Nothing

Definition at line 132 of file alarmstatusentry.cpp.

void AlarmStatusEntry::setTriggerTime ( const time_t  triggertime)
noexcept

Change the trigger time_t.

Changes the timestamp of the message reception. Should only be used when there is a really good reason for.

Parameters
triggertimePOSIX time value
Returns
Nothing

Definition at line 142 of file alarmstatusentry.cpp.

void AlarmStatusEntry::update ( const AlarmStatusEntry newdata)
noexcept

Update severity and status data.

The severity and status values are copied from the other instance of AlarmStatusEntry, all other values are left untouched.

Parameters
newdataAnother instance of AlarmStatusEntry
Returns
Nothing

Definition at line 147 of file alarmstatusentry.cpp.

Member Data Documentation

bool AlarmNotifications::AlarmStatusEntry::_desktopNotificationSent
private

Flag for sent desktop notification.

Indicator to show if a desktop notification has already been sent out to avoid double messaging.

Definition at line 83 of file alarmstatusentry.h.

bool AlarmNotifications::AlarmStatusEntry::_emailNotificationSent
private

Flag for sent e-mail notification.

Indicator to show id an e-mail has already been sent out to avoid double messaging.

Definition at line 89 of file alarmstatusentry.h.

std::string AlarmNotifications::AlarmStatusEntry::_pvname
private

Name of the PV.

The name of the PV that triggered the alarm. The pseudo-protocol prefix "epics://" used within the CSS Alarm Server is removed by CMSClient

Definition at line 59 of file alarmstatusentry.h.

std::string AlarmNotifications::AlarmStatusEntry::_severity
private

The severity of the alarm.

This severity differs from the severity notation in EPICS because the CSS Alarm Server adds the functionality to acknowledge an alarm, a concept that does not exist in pure EPICS. An acknowledged alarm severity has "_ACK" added to the normal severity description.

Definition at line 65 of file alarmstatusentry.h.

std::string AlarmNotifications::AlarmStatusEntry::_status
private

The alarm status of the PV.

The status of the PV within the CSS Alarm Server. This status can differ from the status within EPICS as the Alarm Server has the ability to latch alarms.

Definition at line 71 of file alarmstatusentry.h.

time_t AlarmNotifications::AlarmStatusEntry::_triggertime
private

Time the alarm message was received.

The constructor records the time when the entry is created. The timestamp is used to calculate if the alarm is due to send out a notification, e.g. via e-mail.

Definition at line 77 of file alarmstatusentry.h.


The documentation for this class was generated from the following files: