Public Member Functions | Private Member Functions | Private Attributes

acsalarm::AlarmSourceImpl Class Reference

#include <AlarmSourceImpl.h>

Inheritance diagram for acsalarm::AlarmSourceImpl:
Inheritance graph
[legend]
Collaboration diagram for acsalarm::AlarmSourceImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AlarmSourceImpl ()
virtual ~AlarmSourceImpl ()
void raiseAlarm (std::string faultFamily, std::string faultMember, int faultCode)
void raiseAlarm (std::string faultFamily, std::string faultMember, int faultCode, Properties properties)
void clearAlarm (std::string faultFamily, std::string faultMember, int faultCode)
void setAlarm (std::string faultFamily, std::string faultMember, int faultCode, Properties alarmProps, bool active)
void setAlarm (std::string faultFamily, std::string faultMember, int faultCode, bool active)
void terminateAllAlarms ()
void queueAlarms (ACS::TimeInterval time)
void queueAlarms ()
void flushAlarms ()
void disableAlarms ()
void enableAlarms ()
void runLoop ()
void start ()
void tearDown ()

Private Member Functions

std::string buildAlarmID (std::string faultFamily, std::string faultMember, int faultCode)
void internalAlarmSender (std::string faultFamily, std::string faultMember, int faultCode, Properties alarmProps, bool active)

Private Attributes

bool m_disabled
bool m_queuing
ACE_Recursive_Thread_Mutex m_mutex
std::map< std::string,
AlarmToQueue * > 
m_queue
std::set< std::string > m_activatedAlarms
AlarmsMap m_alarms
auto_ptr
< acsalarm::AlarmSystemInterface
m_alarmSource_ap

Detailed Description

An implementation of AlarmSource.

This class uses the ACSAlarmInterfaceFactory to publish alarms. It assumes that the ACSAlarmInterfaceFactory is already initialized before using this class. In the same way, it assumes that ACSAlarmInterfaceFactory is shutdown after terminated using objects from this class. At the present, this is usually done by ACS for example for the components and the clients.

It is possible to send alarms with several overloaded methods like raise(...), clear(...) and set(...). All the overloaded methods delegate to set(...). internalAlarmSend(..) does the real sending of alarms to the alarm server.

See also:
AlarmSource
Author:
acaproni

Constructor & Destructor Documentation

acsalarm::AlarmSourceImpl::AlarmSourceImpl (  ) 

Constructor

Parameters:
manager The ACS manager
virtual acsalarm::AlarmSourceImpl::~AlarmSourceImpl (  )  [virtual]

Destructor


Member Function Documentation

std::string acsalarm::AlarmSourceImpl::buildAlarmID ( std::string  faultFamily,
std::string  faultMember,
int  faultCode 
) [private]

Build the ID of an alarm from the triplet

Parameters:
faultFamily The Fault Family
faultMember The Fault Member
faultCode The Fault Code
void acsalarm::AlarmSourceImpl::clearAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode 
)
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::disableAlarms (  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::enableAlarms (  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::flushAlarms (  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::internalAlarmSender ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
Properties  alarmProps,
bool  active 
) [private]

Send an alarm to the alarm server.

Parameters:
faultFamily The FaultFamily
faultMember The FaultMember
faultCode The FaultCode
alarmProps The user properties. It can be null or empty.
active if true the alarm is activated otherwise it is terminated.
void acsalarm::AlarmSourceImpl::queueAlarms (  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::queueAlarms ( ACS::TimeInterval  time  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::raiseAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
Properties  properties 
)
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::raiseAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode 
)
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::runLoop (  )  [virtual]
See also:
ACS::Thread

Reimplemented from ACS::Thread.

void acsalarm::AlarmSourceImpl::setAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
Properties  alarmProps,
bool  active 
)
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::setAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
bool  active 
)
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::start (  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::tearDown (  ) 
See also:
AlarmSource
void acsalarm::AlarmSourceImpl::terminateAllAlarms (  ) 
See also:
AlarmSource

Member Data Documentation

std::set<std::string> acsalarm::AlarmSourceImpl::m_activatedAlarms [private]

The alarms that have been activated and not yet terminated.

This is used by the terminateAllAlarms()

The map to avoid repeating alarms if their states did not change.

The source to send alarms to the AS

ACE_Recursive_Thread_Mutex acsalarm::AlarmSourceImpl::m_mutex [private]
std::map<std::string, AlarmToQueue*> acsalarm::AlarmSourceImpl::m_queue [private]

The map of queued alarms

The key is the ID of the alarm


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