#include <NotificationIDManager.h>
Public Member Functions | |
void | save () |
saves notification id collection TODO specify where the file is located | |
uint32_t | createNotificationID (const std::set< std::string > ¬ifiedProperties, const std::set< std::string > &deviceNames, const std::string &classname) |
This method creates a notification ID and puts it into the collection. | |
const std::map< uint32_t, NotificationID * > & | getNotificationIDCol () |
returns the notification id collection | |
Static Public Member Functions | |
static NotificationIDManager * | getInstance () |
returns the single instance of this class | |
Private Member Functions | |
NotificationIDManager () | |
private default constructor in singleton design pattern | |
NotificationIDManager (const NotificationIDManager &other) | |
private copy constructor in singleton design pattern | |
NotificationIDManager & | operator= (const NotificationIDManager &other) |
~NotificationIDManager () | |
void | storeNotificationIDCollection () |
this method stores the notification ids into the file | |
void | loadNotificationIDCollection () |
this method loads the notification ids from a file | |
void | load () |
loads notification id collection from file | |
Static Private Member Functions | |
static void | releaseInstance () |
releases the singleton instance. Method only called by the Abstract Equipment, therefore private and friend | |
Private Attributes | |
std::map< uint32_t, NotificationID * > | notificationIDCol_ |
this attribute stores all the notifications ids MutexProtection is not needed here, since the RTActions are generated in the same thread | |
Static Private Attributes | |
static NotificationIDManager * | theInstance_ = NULL |
single instance of notification id generator | |
Friends | |
class | AbstractEquipment |
Necessary to call private method releaseInstance from class AbstractEquipment. |
Definition at line 25 of file NotificationIDManager.h.
fesa::NotificationIDManager::NotificationIDManager | ( | ) | [private] |
private default constructor in singleton design pattern
Definition at line 30 of file NotificationIDManager.cpp.
Referenced by getInstance().
fesa::NotificationIDManager::NotificationIDManager | ( | const NotificationIDManager & | other | ) | [private] |
private copy constructor in singleton design pattern
fesa::NotificationIDManager::~NotificationIDManager | ( | ) | [private] |
Destructor
Definition at line 34 of file NotificationIDManager.cpp.
uint32_t fesa::NotificationIDManager::createNotificationID | ( | const std::set< std::string > & | notifiedProperties, | |
const std::set< std::string > & | deviceNames, | |||
const std::string & | classname | |||
) |
This method creates a notification ID and puts it into the collection.
notifiedProperties | the properties that will be notified | |
deviceCol | the devices that will be notified | |
classname | the class that contains the properties and devices |
Definition at line 243 of file NotificationIDManager.cpp.
References fesa::NotificationID::getIDKey(), and notificationIDCol_.
Referenced by fesa::AbstractRTAction::AbstractRTAction().
NotificationIDManager * fesa::NotificationIDManager::getInstance | ( | ) | [static] |
returns the single instance of this class
Definition at line 38 of file NotificationIDManager.cpp.
References NotificationIDManager(), and theInstance_.
Referenced by fesa::AbstractRTAction::AbstractRTAction(), getNotificationIDCol(), fesa::RTController::initialize(), fesa::SubscriptionTreeManager::initNotifications(), load(), loadNotificationIDCollection(), and save().
const std::map< uint32_t, NotificationID * > & fesa::NotificationIDManager::getNotificationIDCol | ( | ) |
returns the notification id collection
throws | FesaErrorGetNotificationIDCollection exception if the notification id collection file cannot be loaded |
Definition at line 160 of file NotificationIDManager.cpp.
References getInstance(), load(), notificationIDCol_, fesa::splitRealTimeOnly, fesa::splitServerOnly, and fesa::unsplit.
Referenced by fesa::SubscriptionTreeManager::initNotifications().
void fesa::NotificationIDManager::load | ( | ) | [private] |
loads notification id collection from file
Definition at line 118 of file NotificationIDManager.cpp.
References FesaErrorLoadNotificationIDCollection, fesa::DiagnosticUtils::framework, getInstance(), fesa::AbstractEquipment::getNotificationFileName(), loadNotificationIDCollection(), fesa::DiagnosticUtils::DiagnosticMessage::msg, fesa::DiagnosticUtils::DiagnosticMessage::name, fesa::DiagnosticUtils::notification, fesa::EquipmentData::notificationIDreadoutFlag_, fesa::DiagnosticUtils::DiagnosticMessage::side, and fesa::DiagnosticUtils::DiagnosticMessage::source.
Referenced by getNotificationIDCol().
void fesa::NotificationIDManager::loadNotificationIDCollection | ( | ) | [private] |
this method loads the notification ids from a file
Definition at line 174 of file NotificationIDManager.cpp.
References fesa::XMLParser::extractElements(), FesaErrorLoadNotificationIDCollection, fesa::StringUtilities::fromString(), getInstance(), and notificationIDCol_.
Referenced by load().
NotificationIDManager& fesa::NotificationIDManager::operator= | ( | const NotificationIDManager & | other | ) | [private] |
Private = operator in singleton design pattern
void fesa::NotificationIDManager::releaseInstance | ( | ) | [static, private] |
releases the singleton instance. Method only called by the Abstract Equipment, therefore private and friend
Definition at line 47 of file NotificationIDManager.cpp.
References theInstance_.
Referenced by fesa::AbstractEquipment::~AbstractEquipment().
void fesa::NotificationIDManager::save | ( | ) |
saves notification id collection TODO specify where the file is located
Definition at line 56 of file NotificationIDManager.cpp.
References fesa::DiagnosticUtils::framework, getInstance(), fesa::AbstractEquipment::getInstance(), fesa::DiagnosticUtils::DiagnosticMessage::msg, fesa::DiagnosticUtils::DiagnosticMessage::name, fesa::DiagnosticUtils::notification, fesa::EquipmentData::notificationIDreadoutFlag_, fesa::DiagnosticUtils::DiagnosticMessage::side, fesa::DiagnosticUtils::DiagnosticMessage::source, storeNotificationIDCollection(), and fesa::unsplit.
Referenced by fesa::RTController::initialize().
void fesa::NotificationIDManager::storeNotificationIDCollection | ( | ) | [private] |
this method stores the notification ids into the file
Definition at line 78 of file NotificationIDManager.cpp.
References fesa::XMLParser::createFile(), fesa::XMLParser::endDocument(), fesa::XMLParser::endElement(), fesa::AbstractEquipment::getInstance(), fesa::DiagnosticUtils::notification, fesa::NOTIFICATION_ID_COLLECTION_TAG, notificationIDCol_, fesa::XMLParser::startDocument(), fesa::XMLParser::startElement(), fesa::StringUtilities::toString(), fesa::XMLParser::writeElement(), and fesa::XMLParser::writeNewline().
Referenced by save().
friend class AbstractEquipment [friend] |
Necessary to call private method releaseInstance from class AbstractEquipment.
Definition at line 70 of file NotificationIDManager.h.
std::map<uint32_t, NotificationID*> fesa::NotificationIDManager::notificationIDCol_ [private] |
this attribute stores all the notifications ids MutexProtection is not needed here, since the RTActions are generated in the same thread
Definition at line 76 of file NotificationIDManager.h.
Referenced by createNotificationID(), getNotificationIDCol(), loadNotificationIDCollection(), and storeNotificationIDCollection().
NotificationIDManager * fesa::NotificationIDManager::theInstance_ = NULL [static, private] |
single instance of notification id generator
Definition at line 81 of file NotificationIDManager.h.
Referenced by getInstance(), and releaseInstance().