Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes

ACSAlarmSystemInterfaceFactory Class Reference

#include <ACSAlarmSystemInterfaceFactory.h>

Collaboration diagram for ACSAlarmSystemInterfaceFactory:
Collaboration graph
[legend]

List of all members.

Static Public Member Functions

static maci::Manager_ptr getManager ()
static bool init (maci::Manager_ptr manager) throw (acsErrTypeAlarmSourceFactory::ErrorLoadingCERNDLLExImpl)
static AlarmSystemType usingACSAlarmSystem () throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)
static void done ()
static
acsalarm::AlarmSystemInterface
createSource (std::string sourceName) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)
static
acsalarm::AlarmSystemInterface
createSource () throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)
static std::auto_ptr
< acsalarm::FaultState
createFaultState (std::string family, std::string member, int code) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)
static std::auto_ptr
< acsalarm::FaultState
createFaultState () throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)
static void createAndSendAlarm (std::string &faultFamily, std::string &faultMember, int faultCode, bool active, std::string sourceName=asiConfigurationConstants::ALARM_SOURCE_NAME) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)
static void createAndSendAlarm (std::string &faultFamily, std::string &faultMember, int faultCode, bool active, acsalarm::Properties &faultProperties, std::string sourceName=asiConfigurationConstants::ALARM_SOURCE_NAME) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl)

Private Member Functions

 ACSAlarmSystemInterfaceFactory ()
 ACSAlarmSystemInterfaceFactory (const ACSAlarmSystemInterfaceFactory &)
ACSAlarmSystemInterfaceFactory operator= (const ACSAlarmSystemInterfaceFactory &)
 ~ACSAlarmSystemInterfaceFactory ()

Static Private Member Functions

static void cleanUpAlarmSystemInterfacePtr ()
static void cleanUpSourceSingleton ()
static void cleanUpDLL ()
static void cleanUpManagerReference ()
static void initImplementationType (maci::Manager_ptr manager)
static bool initDLL ()
static
acsalarm::AlarmSystemInterface
getSourceSingleton ()

Static Private Attributes

static void * dllHandle
static
acsalarm::AlarmSystemInterface
m_sourceSingleton_p
static AlarmSystemType m_AlarmSystemType
static maci::Manager_ptr m_manager
static
AlarmSystemInterfaceFactory
m_AlarmSystemInterfaceFactory_p
static ACE_Recursive_Thread_Mutex main_mutex

Detailed Description

The class to create sources and fault states. It extends the laser source but it returns different implementations of the sources depending of a value of a property of the CDB

The ACS implementation of the source logs a message for each alarm

Before using the static methods of this class, the init method must be called otherwise an exception is thrown.


Constructor & Destructor Documentation

ACSAlarmSystemInterfaceFactory::ACSAlarmSystemInterfaceFactory (  )  [private]

Default constructor.

ACSAlarmSystemInterfaceFactory::ACSAlarmSystemInterfaceFactory ( const ACSAlarmSystemInterfaceFactory  )  [private]
ACSAlarmSystemInterfaceFactory::~ACSAlarmSystemInterfaceFactory (  )  [private]

Member Function Documentation

static void ACSAlarmSystemInterfaceFactory::cleanUpAlarmSystemInterfacePtr (  )  [static, private]
static void ACSAlarmSystemInterfaceFactory::cleanUpDLL (  )  [static, private]
static void ACSAlarmSystemInterfaceFactory::cleanUpManagerReference (  )  [static, private]
static void ACSAlarmSystemInterfaceFactory::cleanUpSourceSingleton (  )  [static, private]
static void ACSAlarmSystemInterfaceFactory::createAndSendAlarm ( std::string &  faultFamily,
std::string &  faultMember,
int  faultCode,
bool  active,
std::string  sourceName = asiConfigurationConstants::ALARM_SOURCE_NAME 
) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Convenience API for creating/sending an alarm in a single step, without user defined properties.

Parameters:
family a string indicating the 'family' of the alarm (see alarm system documentation for explanation).
member a string indicating the 'member' of the alarm (see alarm system documentation for explanation).
code an int indicating the 'code' of the alarm (see alarm system documentation for explanation).
active a boolean indicating if the alarm is active (true) or not (false)
sourceName the source name, defaults to ALARM_SOURCE_NAME constant defined in "asiConfigurationConstants.h"
Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
static void ACSAlarmSystemInterfaceFactory::createAndSendAlarm ( std::string &  faultFamily,
std::string &  faultMember,
int  faultCode,
bool  active,
acsalarm::Properties faultProperties,
std::string  sourceName = asiConfigurationConstants::ALARM_SOURCE_NAME 
) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Convenience API for creating/sending an alarm in a single step, with user-defined properties.

Parameters:
family a string indicating the 'family' of the alarm (see alarm system documentation for explanation).
member a string indicating the 'member' of the alarm (see alarm system documentation for explanation).
code an int indicating the 'code' of the alarm (see alarm system documentation for explanation).
active a boolean indicating if the alarm is active (true) or not (false)
faultProperties user-defined properties associated with the alarm.
sourceName the source name, defaults to ALARM_SOURCE_NAME constant defined in "asiConfigurationConstants.h"
Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
static std::auto_ptr<acsalarm::FaultState> ACSAlarmSystemInterfaceFactory::createFaultState (  )  throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Create a fault state

Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
static std::auto_ptr<acsalarm::FaultState> ACSAlarmSystemInterfaceFactory::createFaultState ( std::string  family,
std::string  member,
int  code 
) throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Create a fault state with the given family, member and code

Parameters:
family a string indicating the 'family' of the alarm (see alarm system documentation for explanation).
member a string indicating the 'member' of the alarm (see alarm system documentation for explanation).
code an int indicating the 'code' of the alarm (see alarm system documentation for explanation).
Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
static acsalarm::AlarmSystemInterface* ACSAlarmSystemInterfaceFactory::createSource ( std::string  sourceName  )  throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Create a new instance of an alarm system interface.

Parameters:
sourceName the source name.
Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
Returns:
the interface instance.
static acsalarm::AlarmSystemInterface* ACSAlarmSystemInterfaceFactory::createSource (  )  throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Create a new instance of an alarm system interface without binding it to any source.

Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
Returns:
the interface instance.
static void ACSAlarmSystemInterfaceFactory::done (  )  [static]

Release the resources: must be called when finished using the methods of this class

static maci::Manager_ptr ACSAlarmSystemInterfaceFactory::getManager (  )  [static]
static acsalarm::AlarmSystemInterface* ACSAlarmSystemInterfaceFactory::getSourceSingleton (  )  [static, private]

Return the source singleton;

If the singleton is null, this method instatiates a new one.

static bool ACSAlarmSystemInterfaceFactory::init ( maci::Manager_ptr  manager  )  throw (acsErrTypeAlarmSourceFactory::ErrorLoadingCERNDLLExImpl) [static]

Init the object of the class: must be called before using the other methods of this class otherwise an exception will be thrown.

Parameters:
manager ptr to the acs manager.
Exceptions:
acsErrTypeAlarmSourceFactory::ErrorLoadingCERNDLLExImpl if there was a problem loading the DLL
Returns:
true if the initialization went ok
static bool ACSAlarmSystemInterfaceFactory::initDLL (  )  [static, private]
static void ACSAlarmSystemInterfaceFactory::initImplementationType ( maci::Manager_ptr  manager  )  [static, private]
ACSAlarmSystemInterfaceFactory ACSAlarmSystemInterfaceFactory::operator= ( const ACSAlarmSystemInterfaceFactory  )  [private]
static AlarmSystemType ACSAlarmSystemInterfaceFactory::usingACSAlarmSystem (  )  throw (acsErrTypeAlarmSourceFactory::ACSASFactoryNotInitedExImpl) [static]

Getter for whether we're using the ACS Alarm system (true) or not (false).

Exceptions:
ACSASFactoryNotInitedExImpl if the alarm system has not been previously initialized.
Returns:
boolean indicating whether the ACS alarm system is in use (true) or not (false), where ACS alarm system means alarms are sent to the logs, otherwise they are sent to the alarm channel.

Member Data Documentation

maci::Manager_ptr ACSAlarmSystemInterfaceFactory::m_manager [static, private]
ACE_Recursive_Thread_Mutex ACSAlarmSystemInterfaceFactory::main_mutex [static, private]

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