This is Unofficial EPICS BASE Doxygen Site
epics::pvData::AlarmSeverityFunc Class Reference

methods for AlarmSeverity More...

#include "alarm.h"

Static Public Member Functions

static AlarmSeverity getSeverity (int value)
 
static StringArrayPtr getSeverityNames ()
 

Detailed Description

methods for AlarmSeverity

Definition at line 54 of file alarm.h.

Member Function Documentation

AlarmSeverity epics::pvData::AlarmSeverityFunc::getSeverity ( int  value)
static

Get the severity.

Parameters
valueGet the alarm severity corresponding to the integer value.
Returns
The severity.
Exceptions
ifseverity value is out of range.

Definition at line 25 of file alarm.cpp.

26 {
27  if(value<0 || value>4) {
28  throw std::logic_error(string("getSeverity value is illegal"));
29  }
30  switch (value) {
31  case 0: return noAlarm;
32  case 1: return minorAlarm;
33  case 2: return majorAlarm;
34  case 3: return invalidAlarm;
35  case 4: return undefinedAlarm;
36  }
37  throw std::logic_error(string("should never get here"));
38 }
Definition: link.h:174
StringArrayPtr epics::pvData::AlarmSeverityFunc::getSeverityNames ( )
static

Get the array of severity names.

Returns
The array of severity names.

Definition at line 40 of file alarm.cpp.

41 {
42  static size_t severityCount = 5;
43  static StringArrayPtr severityNames;
44  static Mutex mutex;
45  Lock xx(mutex);
46  if(severityNames.get()==NULL) {
47  severityNames = StringArrayPtr(new StringArray());
48  severityNames->reserve(severityCount);
49  severityNames->push_back("NONE");
50  severityNames->push_back("MINOR");
51  severityNames->push_back("MAJOR");
52  severityNames->push_back("INVALID");
53  severityNames->push_back("UNDEFINED");
54  }
55  return severityNames;
56 }
#define NULL
Definition: catime.c:38
epicsMutex mutex
Definition: pvAccess.cpp:71
std::vector< std::string > StringArray
Definition: pvType.h:110
epicsMutex Mutex
Definition: lock.h:28
std::tr1::shared_ptr< StringArray > StringArrayPtr
Definition: pvType.h:111

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