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 (const AlarmSourceThread *updaterThread)
 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 ()
virtual void update (ACS::Time now)
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
const AlarmSourceThreadm_updaterThread_p
bool m_locallyInstantiatedThread
ACS::Time m_nextMapUpdateTime
ACS::Time m_nextFlushTime

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 ( const AlarmSourceThread updaterThread  ) 

Constructor

Parameters:
updaterThread The thread to update the state of the object
acsalarm::AlarmSourceImpl::AlarmSourceImpl (  ) 

Constructor

The thread to update the state of the object is instantiated by AlarmSourceImpl and therefore will not be shared between different instances.

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 
) [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::disableAlarms (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::enableAlarms (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::flushAlarms (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::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 (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::queueAlarms ( ACS::TimeInterval  time  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::raiseAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
Properties  properties 
) [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::raiseAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode 
) [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::setAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
Properties  alarmProps,
bool  active 
) [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::setAlarm ( std::string  faultFamily,
std::string  faultMember,
int  faultCode,
bool  active 
) [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::start (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::tearDown (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

void acsalarm::AlarmSourceImpl::terminateAllAlarms (  )  [virtual]
See also:
AlarmSource

Implements acsalarm::AlarmSource.

virtual void acsalarm::AlarmSourceImpl::update ( ACS::Time  now  )  [virtual]
See also:
AlarmSource

Reimplemented from acsalarm::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 map requires to be updated from time to time (

See also:
AlarmsMap documentation). The updating is explicitly requested by the thread loop.

The source to send alarms to the AS

true if the thread is instantiated locally (empty constructor) and false otherwise.

ACE_Recursive_Thread_Mutex acsalarm::AlarmSourceImpl::m_mutex [private]

The time when the alarms must be flushed.

See also:
AlarmSource.queueaAlarms(...)

The time when the map needs to be updated

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

The map of queued alarms

The key is the ID of the alarm

The thread to update


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